mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
fixed Bug #2985
"Table truncated when creating another table name with Spaces" added to check_db_name, check_table_name and check_column_name test for end space
This commit is contained in:
@ -1123,8 +1123,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
|
||||
statistic_increment(com_stat[SQLCOM_CREATE_DB],&LOCK_status);
|
||||
// null test to handle EOM
|
||||
if (!db || !strip_sp(db) || !(alias= thd->strdup(db)) ||
|
||||
check_db_name(db))
|
||||
if (!db || !(alias= thd->strdup(db)) || check_db_name(db))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
|
||||
break;
|
||||
@ -1140,8 +1139,7 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
|
||||
statistic_increment(com_stat[SQLCOM_DROP_DB],&LOCK_status);
|
||||
char *db=thd->strdup(packet), *alias;
|
||||
// null test to handle EOM
|
||||
if (!db || !strip_sp(db) || !(alias= thd->strdup(db)) ||
|
||||
check_db_name(db))
|
||||
if (!db || !(alias= thd->strdup(db)) || check_db_name(db))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, db ? db : "NULL");
|
||||
break;
|
||||
@ -2320,8 +2318,7 @@ mysql_execute_command(void)
|
||||
case SQLCOM_CREATE_DB:
|
||||
{
|
||||
char *alias;
|
||||
if (!strip_sp(lex->name) || !(alias=thd->strdup(lex->name)) ||
|
||||
check_db_name(lex->name))
|
||||
if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
|
||||
break;
|
||||
@ -2350,8 +2347,7 @@ mysql_execute_command(void)
|
||||
case SQLCOM_DROP_DB:
|
||||
{
|
||||
char *alias;
|
||||
if (!strip_sp(lex->name) || !(alias=thd->strdup(lex->name)) ||
|
||||
check_db_name(lex->name))
|
||||
if (!(alias=thd->strdup(lex->name)) || check_db_name(lex->name))
|
||||
{
|
||||
net_printf(&thd->net,ER_WRONG_DB_NAME, lex->name);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user