mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Make status of NO_BACKSLASH_ESCAPES mode known to the client so
it can use it to switch to only quoting apostrophes by doubling them when it is in effect. (Bug #10214) include/my_sys.h: Add new escape_quotes_for_mysql() function include/mysql_com.h: Add SERVER_STATUS_NO_BACKSLASH_ESCAPES libmysql/libmysql.c: Use SERVER_STATUS_NO_BACKSLASH_ESCAPES in server_status to determine how mysql_real_escape_string() should do quoting. mysys/charset.c: Add new escape_quotes_for_mysql() function that only quotes apostrophes by doubling them up. sql/set_var.cc: Set SERVER_STATUS_NO_BACKSLASH_ESCAPES when MODE_NO_BACKSLASH_ESCAPES changes. sql/sql_class.cc: Set SERVER_STATUS_NO_BACKSLASH_ESCAPES when necessary on thread creation. tests/mysql_client_test.c: Add new test for sending NO_BACKSLASH_ESCAPES as part of server_status.
This commit is contained in:
@ -3238,7 +3238,16 @@ void fix_sql_mode_var(THD *thd, enum_var_type type)
|
||||
global_system_variables.sql_mode=
|
||||
fix_sql_mode(global_system_variables.sql_mode);
|
||||
else
|
||||
{
|
||||
thd->variables.sql_mode= fix_sql_mode(thd->variables.sql_mode);
|
||||
/*
|
||||
Update thd->server_status
|
||||
*/
|
||||
if (thd->variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES)
|
||||
thd->server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES;
|
||||
else
|
||||
thd->server_status&= ~SERVER_STATUS_NO_BACKSLASH_ESCAPES;
|
||||
}
|
||||
}
|
||||
|
||||
/* Map database specific bits to function bits */
|
||||
|
Reference in New Issue
Block a user