diff options
author | jimw@mysql.com <> | 2005-06-23 18:29:56 -0700 |
---|---|---|
committer | jimw@mysql.com <> | 2005-06-23 18:29:56 -0700 |
commit | 3ccb90c0857653669bfc4e7048821c6dd0fed167 (patch) | |
tree | b5f6e8ddaa771fd03ce4b741cc2723ea99b358ca /sql | |
parent | 539d63d09afc91b3286611bee8991d5f257fc226 (diff) | |
download | mariadb-git-3ccb90c0857653669bfc4e7048821c6dd0fed167.tar.gz |
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)
Diffstat (limited to 'sql')
-rw-r--r-- | sql/set_var.cc | 9 | ||||
-rw-r--r-- | sql/sql_class.cc | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 1c0de702e4e..9c35e10026a 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -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 */ diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 20f48da9283..6f61b086314 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -282,6 +282,8 @@ void THD::init(void) #endif pthread_mutex_unlock(&LOCK_global_system_variables); server_status= SERVER_STATUS_AUTOCOMMIT; + if (variables.sql_mode & MODE_NO_BACKSLASH_ESCAPES) + server_status|= SERVER_STATUS_NO_BACKSLASH_ESCAPES; options= thd_startup_options; open_options=ha_open_options; update_lock_default= (variables.low_priority_updates ? |