mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Auto-merge from mysql-trunk.
This commit is contained in:
@@ -1160,8 +1160,23 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
We have name + wildcard in packet, separated by endzero
|
||||
*/
|
||||
arg_end= strend(packet);
|
||||
uint arg_length= arg_end - packet;
|
||||
|
||||
/* Check given table name length. */
|
||||
if (arg_length >= packet_length || arg_length > NAME_LEN)
|
||||
{
|
||||
my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
|
||||
break;
|
||||
}
|
||||
thd->convert_string(&conv_name, system_charset_info,
|
||||
packet, (uint) (arg_end - packet), thd->charset());
|
||||
packet, arg_length, thd->charset());
|
||||
if (check_table_name(conv_name.str, conv_name.length, FALSE))
|
||||
{
|
||||
/* this is OK due to convert_string() null-terminating the string */
|
||||
my_error(ER_WRONG_TABLE_NAME, MYF(0), conv_name.str);
|
||||
break;
|
||||
}
|
||||
|
||||
table_list.alias= table_list.table_name= conv_name.str;
|
||||
packet= arg_end + 1;
|
||||
|
||||
@@ -3238,7 +3253,7 @@ end_with_restore_list:
|
||||
TODO: this is workaround. right way will be move invalidating in
|
||||
the unlock procedure.
|
||||
*/
|
||||
if (first_table->lock_type == TL_WRITE_CONCURRENT_INSERT &&
|
||||
if (!res && first_table->lock_type == TL_WRITE_CONCURRENT_INSERT &&
|
||||
thd->lock)
|
||||
{
|
||||
/* INSERT ... SELECT should invalidate only the very first table */
|
||||
@@ -6042,7 +6057,7 @@ TABLE_LIST *st_select_lex::add_table_to_list(THD *thd,
|
||||
DBUG_RETURN(0); // End of memory
|
||||
alias_str= alias ? alias->str : table->table.str;
|
||||
if (!test(table_options & TL_OPTION_ALIAS) &&
|
||||
check_table_name(table->table.str, table->table.length))
|
||||
check_table_name(table->table.str, table->table.length, FALSE))
|
||||
{
|
||||
my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.str);
|
||||
DBUG_RETURN(0);
|
||||
|
||||
Reference in New Issue
Block a user