mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-trigger-5.0 mysql-test/r/information_schema.result: Auto merged mysql-test/t/mysqldump.test: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_show.cc: Auto merged mysql-test/r/mysqldump.result: merge sql/sql_trigger.cc: merge
This commit is contained in:
commit
7dafc7336b
20 changed files with 426 additions and 113 deletions
|
|
@ -3202,29 +3202,49 @@ 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
|
||||
|
||||
SYNOPSIS
|
||||
thd in thread handler
|
||||
val in sql_mode value
|
||||
len out pointer on length of string
|
||||
|
||||
RETURN
|
||||
pointer to string with sql_mode representation
|
||||
*/
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue