diff options
Diffstat (limited to 'sql/sql_parse.cc')
-rw-r--r-- | sql/sql_parse.cc | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 4dd5d126cc9..14fc748c288 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1692,7 +1692,7 @@ mysql_execute_command(void) tables->real_name, &lex->create_info, lex->create_list, - lex->key_list,0, 0); // do logging + lex->key_list,0); if (!res) send_ok(&thd->net); } @@ -2046,7 +2046,7 @@ mysql_execute_command(void) send_error(&thd->net,ER_LOCK_OR_ACTIVE_TRANSACTION,NullS); goto error; } - res=mysql_truncate(thd,tables); + res=mysql_truncate(thd, tables, 0); break; case SQLCOM_DELETE: { @@ -2869,10 +2869,10 @@ bool check_stack_overrun(THD *thd,char *buf __attribute__((unused))) #define MY_YACC_INIT 1000 // Start with big alloc #define MY_YACC_MAX 32000 // Because of 'short' -bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, int *yystacksize) +bool my_yyoverflow(short **yyss, YYSTYPE **yyvs, ulong *yystacksize) { LEX *lex=current_lex; - int old_info=0; + ulong old_info=0; if ((uint) *yystacksize >= MY_YACC_MAX) return 1; if (!lex->yacc_yyvs) @@ -3231,8 +3231,12 @@ bool add_field_to_list(char *field_name, enum_field_types type, case FIELD_TYPE_TIMESTAMP: if (!length) new_field->length= 14; // Full date YYYYMMDDHHMMSS - else + else if (new_field->length != 19) { + /* + We support only even TIMESTAMP lengths less or equal than 14 + and 19 as length of 4.1 compatible representation. + */ new_field->length=((new_field->length+1)/2)*2; /* purecov: inspected */ new_field->length= min(new_field->length,14); /* purecov: inspected */ } @@ -3704,8 +3708,12 @@ bool reload_acl_and_cache(THD *thd, ulong options, TABLE_LIST *tables) { if (lock_global_read_lock(thd)) return 1; + result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, + tables); + make_global_read_lock_block_commit(thd); } - result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, tables); + else + result=close_cached_tables(thd,(options & REFRESH_FAST) ? 0 : 1, tables); } if (options & REFRESH_HOSTS) hostname_cache_refresh(); |