mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-recentcommmerge
into zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1 client/mysqlcheck.c: Auto merged configure.in: Auto merged include/config-win.h: Auto merged mysql-test/r/func_in.result: Auto merged mysql-test/r/information_schema.result: Auto merged mysql-test/t/func_in.test: Auto merged mysql-test/t/information_schema.test: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_delete.cc: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_repl.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/sql_view.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/table.h: Auto merged storage/myisam/ha_myisam.cc: Auto merged sql/sql_lex.h: SCCS merged
This commit is contained in:
commit
38ed305e15
368 changed files with 12513 additions and 12537 deletions
|
|
@ -386,17 +386,43 @@ sp_eval_expr(THD *thd, Field *result_field, Item **expr_item_ptr)
|
|||
*
|
||||
*/
|
||||
|
||||
sp_name::sp_name(THD *thd, char *key, uint key_len)
|
||||
{
|
||||
m_sroutines_key.str= key;
|
||||
m_sroutines_key.length= key_len;
|
||||
m_qname.str= ++key;
|
||||
m_qname.length= key_len - 1;
|
||||
if ((m_name.str= strchr(m_qname.str, '.')))
|
||||
{
|
||||
m_db.length= m_name.str - key;
|
||||
m_db.str= strmake_root(thd->mem_root, key, m_db.length);
|
||||
m_name.str++;
|
||||
m_name.length= m_qname.length - m_db.length - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_name.str= m_qname.str;
|
||||
m_name.length= m_qname.length;
|
||||
m_db.str= 0;
|
||||
m_db.length= 0;
|
||||
}
|
||||
m_explicit_name= false;
|
||||
}
|
||||
|
||||
void
|
||||
sp_name::init_qname(THD *thd)
|
||||
{
|
||||
m_sroutines_key.length= m_db.length + m_name.length + 2;
|
||||
const uint dot= !!m_db.length;
|
||||
/* m_sroutines format: m_type + [database + dot] + name + nul */
|
||||
m_sroutines_key.length= 1 + m_db.length + dot + m_name.length;
|
||||
if (!(m_sroutines_key.str= (char*) thd->alloc(m_sroutines_key.length + 1)))
|
||||
return;
|
||||
m_qname.length= m_sroutines_key.length - 1;
|
||||
m_qname.str= m_sroutines_key.str + 1;
|
||||
sprintf(m_qname.str, "%.*s.%.*s",
|
||||
(int) m_db.length, (m_db.length ? m_db.str : ""),
|
||||
(int) m_name.length, m_name.str);
|
||||
sprintf(m_qname.str, "%.*s%.*s%.*s",
|
||||
(int) m_db.length, (m_db.length ? m_db.str : ""),
|
||||
dot, ".",
|
||||
(int) m_name.length, m_name.str);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2699,7 +2725,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
|
|||
|
||||
query= thd->query;
|
||||
query_length= thd->query_length;
|
||||
if (!(res= alloc_query(thd, m_query.str, m_query.length+1)) &&
|
||||
if (!(res= alloc_query(thd, m_query.str, m_query.length)) &&
|
||||
!(res=subst_spvars(thd, this, &m_query)))
|
||||
{
|
||||
/*
|
||||
|
|
@ -2707,7 +2733,7 @@ sp_instr_stmt::execute(THD *thd, uint *nextp)
|
|||
queries with SP vars can't be cached)
|
||||
*/
|
||||
if (unlikely((thd->options & OPTION_LOG_OFF)==0))
|
||||
general_log_print(thd, COM_QUERY, "%s", thd->query);
|
||||
general_log_write(thd, COM_QUERY, thd->query, thd->query_length);
|
||||
|
||||
if (query_cache_send_result_to_client(thd,
|
||||
thd->query, thd->query_length) <= 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue