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:
@ -588,7 +588,7 @@ check_connections(THD *thd)
|
||||
|
||||
thd->client_capabilities=uint2korr(net->read_pos);
|
||||
if (thd->client_capabilities & CLIENT_IGNORE_SPACE)
|
||||
thd->sql_mode|= MODE_IGNORE_SPACE;
|
||||
thd->variables.sql_mode|= MODE_IGNORE_SPACE;
|
||||
#ifdef HAVE_OPENSSL
|
||||
DBUG_PRINT("info", ("client capabilities: %d", thd->client_capabilities));
|
||||
if (thd->client_capabilities & CLIENT_SSL)
|
||||
@ -3458,10 +3458,14 @@ bool add_field_to_list(THD *thd, char *field_name, enum_field_types type,
|
||||
set_if_smaller(new_field->length,MAX_FIELD_WIDTH-1);
|
||||
if (default_value)
|
||||
{
|
||||
char *not_used;
|
||||
uint not_used2;
|
||||
|
||||
thd->cuted_fields=0;
|
||||
String str,*res;
|
||||
res=default_value->val_str(&str);
|
||||
(void) find_set(interval,res->ptr(),res->length());
|
||||
(void) find_set(interval, res->ptr(), res->length(), ¬_used,
|
||||
¬_used2);
|
||||
if (thd->cuted_fields)
|
||||
{
|
||||
net_printf(thd,ER_INVALID_DEFAULT,field_name);
|
||||
|
Reference in New Issue
Block a user