summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorunknown <lars/lthalmann@mysql.com/dl145j.mysql.com>2007-01-17 19:30:05 +0100
committerunknown <lars/lthalmann@mysql.com/dl145j.mysql.com>2007-01-17 19:30:05 +0100
commit55fbeec175b9f9080824f47a5f9a066ee2ae0c70 (patch)
tree9365e90bbc9cc325b9b5e53f0ac8911d3811f4aa /sql/sp_head.cc
parentc9078c40af0cb23e6482dfb99351d1868bd6cb06 (diff)
parentecc3a61944047d9acb931dde1fd1bd8df25124a1 (diff)
downloadmariadb-git-55fbeec175b9f9080824f47a5f9a066ee2ae0c70.tar.gz
Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge sql/item_timefunc.cc: Auto merged sql/mysql_priv.h: Auto merged sql/sp_head.cc: Auto merged sql/sql_parse.cc: Auto merged
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index fb99ed1bb5c..de0edabda3e 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -92,7 +92,7 @@ sp_map_item_type(enum enum_field_types type)
*/
static String *
-sp_get_item_value(Item *item, String *str)
+sp_get_item_value(THD *thd, Item *item, String *str)
{
Item_result result_type= item->result_type();
@@ -112,15 +112,16 @@ sp_get_item_value(Item *item, String *str)
{
char buf_holder[STRING_BUFFER_USUAL_SIZE];
String buf(buf_holder, sizeof(buf_holder), result->charset());
+ CHARSET_INFO *cs= thd->variables.character_set_client;
/* We must reset length of the buffer, because of String specificity. */
buf.length(0);
buf.append('_');
buf.append(result->charset()->csname);
- if (result->charset()->escape_with_backslash_is_dangerous)
+ if (cs->escape_with_backslash_is_dangerous)
buf.append(' ');
- append_query_string(result->charset(), result, &buf);
+ append_query_string(cs, result, &buf);
str->copy(buf);
return str;
@@ -843,7 +844,7 @@ subst_spvars(THD *thd, sp_instr *instr, LEX_STRING *query_str)
val= (*splocal)->this_item();
DBUG_PRINT("info", ("print %p", val));
- str_value= sp_get_item_value(val, &str_value_holder);
+ str_value= sp_get_item_value(thd, val, &str_value_holder);
if (str_value)
res|= qbuf.append(*str_value);
else
@@ -1427,6 +1428,8 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
{
binlog_buf.length(0);
binlog_buf.append(STRING_WITH_LEN("SELECT "));
+ append_identifier(thd, &binlog_buf, m_db.str, m_db.length);
+ binlog_buf.append('.');
append_identifier(thd, &binlog_buf, m_name.str, m_name.length);
binlog_buf.append('(');
for (arg_no= 0; arg_no < argcount; arg_no++)
@@ -1437,7 +1440,7 @@ sp_head::execute_function(THD *thd, Item **argp, uint argcount,
if (arg_no)
binlog_buf.append(',');
- str_value= sp_get_item_value(nctx->get_item(arg_no),
+ str_value= sp_get_item_value(thd, nctx->get_item(arg_no),
&str_value_holder);
if (str_value)