mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Added support sql_mode, which can be used to produce various outputs
of SHOW CREATE TABLE 'name'. Depending on the mode, the output can be compatible with various databases, including earlier versions of MySQL . sql/field.cc: Added support for sql_mode. Changed find_set() to be aware of possible error. If the argument contains a value that is not legal in the set, err_pos and err_len are set. sql/field.h: Added support for sql_mode. Changed find_set() to be aware of possible error. If the argument contains a value that is not legal in the set, err_pos and err_len are set. sql/item_func.cc: Added support for sql_mode. sql/mysql_priv.h: Some new sql modes. sql/mysqld.cc: Added support for sql mode, including some new modes. sql/set_var.cc: Added support for sql_mode. Added function that can be used to check values in a set. sql/set_var.h: Added support for sql_mode. Added function that can be used to check values in a set. sql/sql_class.cc: Removed previous usage of opt_sql_mode. sql/sql_class.h: Removed previous usage of opt_sql_mode. sql/sql_lex.cc: Changed previous version of sql_mode to the new noe. sql/sql_parse.cc: Changed previous version of sql_mode to the new noe. sql/sql_select.cc: Changed previous version of sql_mode to the new noe. sql/sql_show.cc: Added support for various sql_modes for printing CREATE TABLE. sql/sql_yacc.yy: Changed previous version of sql_mode to the new noe.
This commit is contained in:
@ -424,12 +424,12 @@ double log_10[32]; /* 10 potences */
|
||||
I_List<THD> threads,thread_cache;
|
||||
time_t start_time;
|
||||
|
||||
ulong opt_sql_mode = 0L;
|
||||
const char *sql_mode_names[] =
|
||||
{
|
||||
"REAL_AS_FLOAT", "PIPES_AS_CONCAT", "ANSI_QUOTES", "IGNORE_SPACE",
|
||||
"SERIALIZE", "ONLY_FULL_GROUP_BY", "NO_UNSIGNED_SUBTRACTION",
|
||||
"POSTGRESQL", "ORACLE", "MSSQL", "SAPDB",
|
||||
"POSTGRESQL", "ORACLE", "MSSQL", "DB2", "SAPDB", "NO_KEY_OPTIONS",
|
||||
"NO_TABLE_OPTIONS", "NO_FIELD_OPTIONS", "MYSQL323", "MYSQL40",
|
||||
NullS
|
||||
};
|
||||
TYPELIB sql_mode_typelib= {array_elements(sql_mode_names)-1,"",
|
||||
@ -4301,9 +4301,10 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
opt_endinfo=1; /* unireg: memory allocation */
|
||||
break;
|
||||
case 'a':
|
||||
opt_sql_mode = (MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT |
|
||||
MODE_ANSI_QUOTES | MODE_IGNORE_SPACE | MODE_SERIALIZABLE |
|
||||
MODE_ONLY_FULL_GROUP_BY);
|
||||
global_system_variables.sql_mode=
|
||||
(MODE_REAL_AS_FLOAT | MODE_PIPES_AS_CONCAT |
|
||||
MODE_ANSI_QUOTES | MODE_IGNORE_SPACE | MODE_SERIALIZABLE |
|
||||
MODE_ONLY_FULL_GROUP_BY);
|
||||
global_system_variables.tx_isolation= ISO_SERIALIZABLE;
|
||||
break;
|
||||
case 'b':
|
||||
@ -4730,16 +4731,17 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
}
|
||||
case OPT_SQL_MODE:
|
||||
{
|
||||
sql_mode_str = argument;
|
||||
if ((opt_sql_mode =
|
||||
find_bit_type(argument, &sql_mode_typelib)) == ~(ulong) 0)
|
||||
sql_mode_str= argument;
|
||||
if ((global_system_variables.sql_mode=
|
||||
find_bit_type(argument, &sql_mode_typelib)) == ~(ulong) 0)
|
||||
{
|
||||
fprintf(stderr, "Unknown option to sql-mode: %s\n", argument);
|
||||
exit(1);
|
||||
}
|
||||
global_system_variables.tx_isolation= ((opt_sql_mode & MODE_SERIALIZABLE) ?
|
||||
ISO_SERIALIZABLE :
|
||||
ISO_REPEATABLE_READ);
|
||||
global_system_variables.tx_isolation=
|
||||
((global_system_variables.sql_mode & MODE_SERIALIZABLE) ?
|
||||
ISO_SERIALIZABLE :
|
||||
ISO_REPEATABLE_READ);
|
||||
break;
|
||||
}
|
||||
case OPT_MASTER_PASSWORD:
|
||||
|
Reference in New Issue
Block a user