Skip to content

Commit 57b3d60

Browse files
author
Igor Pesic
committed
Bug#36931281: Charset of prepared statement param was wrongly interpreted [noclose]
- added collation_connection_charset thd attribute Change-Id: I0f0df2153e5ef82d8dc999b1df2fb4fd301b6ded
1 parent 2ab7690 commit 57b3d60

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sql/server_component/mysql_thd_attributes_imp.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ DEFINE_BOOL_METHOD(mysql_thd_attributes_imp::get,
119119
val.length = strlen(t->charset()->csname);
120120
}
121121
*((mysql_cstring_with_length *)inout_pvalue) = val;
122+
} else if (!strcmp(name, "collation_connection_charset")) {
123+
auto collation_charset = t->variables.collation_connection->csname;
124+
auto val = mysql_cstring_with_length{collation_charset,
125+
strlen(collation_charset)};
126+
*((mysql_cstring_with_length *)inout_pvalue) = val;
122127
} else if (!strcmp(name, "sql_command")) {
123128
const char *sql_command = get_sql_command_string(t->lex->sql_command);
124129
if (t->lex->sql_command == SQLCOM_END &&

0 commit comments

Comments
 (0)