summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authormats@mysql.com <>2006-03-21 14:35:49 +0100
committermats@mysql.com <>2006-03-21 14:35:49 +0100
commit1d4ee057ee6d0e1e0c71adaccdcd8b4d58842e46 (patch)
treea303ad6570ce2e7f70c098ba3441aef72e5ee8c8 /sql/sp_head.cc
parentc5337540af078722ca006287fb9e0d55e70dd845 (diff)
downloadmariadb-git-1d4ee057ee6d0e1e0c71adaccdcd8b4d58842e46.tar.gz
BUG#18293 (Values in stored procedures written to binlog unescaped):
Generating character set-independent quoting of strings for the binary log when executing statements from inside stored procedure.
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index c0b566f9b9b..bba9479c8f3 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -80,8 +80,8 @@ sp_map_item_type(enum enum_field_types type)
/*
Return a string representation of the Item value.
- NOTE: this is a legacy-compatible implementation. It fails if the value
- contains non-ordinary symbols, which should be escaped.
+ NOTE: If the item has a string result type, the string is escaped
+ according to its character set.
SYNOPSIS
item a pointer to the Item
@@ -119,9 +119,9 @@ sp_get_item_value(Item *item, String *str)
buf.append('_');
buf.append(result->charset()->csname);
- buf.append('\'');
- buf.append(*result);
- buf.append('\'');
+ if (result->charset()->escape_with_backslash_is_dangerous)
+ buf.append(' ');
+ append_query_string(result->charset(), result, &buf);
str->copy(buf);
return str;