diff options
author | unknown <bell@sanja.is.com.ua> | 2005-07-28 22:39:11 +0300 |
---|---|---|
committer | unknown <bell@sanja.is.com.ua> | 2005-07-28 22:39:11 +0300 |
commit | a66928bb24d3f543593d092c085b915459ca5c88 (patch) | |
tree | e93bc8d2975b833cb357ca7658f47ed7c4100ac2 /sql/set_var.cc | |
parent | 482cf550f9cb1bf060aba73ef64d85edee791118 (diff) | |
download | mariadb-git-a66928bb24d3f543593d092c085b915459ca5c88.tar.gz |
store/restore sql_mode which was in force during ctrigger creation (BUG#5891)
other sql_mode fixes
mysql-test/r/information_schema.result:
changes in information schema
mysql-test/r/trigger.result:
storing and restoring sql modes for triggers
mysql-test/t/trigger.test:
storing and restoring parsing modes for triggers
sql/mysqld.cc:
add length of mode names
sql/parse_file.cc:
new type of list (ulonglong)
sql/parse_file.h:
new type of list (ulonglong)
sql/set_var.cc:
mode output made as static method
sql/set_var.h:
mode output made as static method
sql/sp_head.cc:
added sql_mode storing/restoring during SP execution
optimised sql_mode printing
sql/sp_head.h:
comment fixed according this changes
sql/sql_show.cc:
added sql_mode field
sql/sql_trigger.cc:
store/restore sql_mode which was in force during ctrigger creation
sql/sql_trigger.h:
store/restore sql_mode which was in force during ctrigger creation
sql/sql_view.cc:
fixed sql_mode
Diffstat (limited to 'sql/set_var.cc')
-rw-r--r-- | sql/set_var.cc | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sql/set_var.cc b/sql/set_var.cc index 09581aed217..d3f3f62c259 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -3196,29 +3196,46 @@ bool sys_var_thd_table_type::update(THD *thd, set_var *var) Functions to handle sql_mode ****************************************************************************/ -byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, - LEX_STRING *base) +/* + Make string representation of mode + + SINOPSYS + thd thread handler + val sql_mode value + len pointer on length of string +*/ + +byte *sys_var_thd_sql_mode::symbolic_mode_representation(THD *thd, ulong val, + ulong *len) { - ulong val; char buff[256]; String tmp(buff, sizeof(buff), &my_charset_latin1); tmp.length(0); - val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : - thd->variables.*offset); for (uint i= 0; val; val>>= 1, i++) { if (val & 1) { - tmp.append(enum_names->type_names[i]); + tmp.append(sql_mode_typelib.type_names[i], + sql_mode_typelib.type_lengths[i]); tmp.append(','); } } if (tmp.length()) tmp.length(tmp.length() - 1); + *len= tmp.length(); return (byte*) thd->strmake(tmp.ptr(), tmp.length()); } +byte *sys_var_thd_sql_mode::value_ptr(THD *thd, enum_var_type type, + LEX_STRING *base) +{ + ulong val= ((type == OPT_GLOBAL) ? global_system_variables.*offset : + thd->variables.*offset); + ulong length_unused; + return symbolic_mode_representation(thd, val, &length_unused); +} + void sys_var_thd_sql_mode::set_default(THD *thd, enum_var_type type) { |