Commit 7d865e0b authored by unknown's avatar unknown

bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names

sql/sql_table.cc: print an error with a function that respects width modifiers (%.64s)


mysql-test/r/drop.result:
  bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names
mysql-test/t/drop.test:
  bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names
sql/share/english/errmsg.txt:
  allow longer "table names" as DROP TABLE puts a list here
sql/share/russian/errmsg.txt:
  allow longer "table names" as DROP TABLE puts a list here
sql/share/ukrainian/errmsg.txt:
  allow longer "table names" as DROP TABLE puts a list here
sql/sql_table.cc:
  print an error with a function that respects width modifiers (%.64s)
parent 98be74b7
......@@ -22,6 +22,20 @@ n
4
drop database if exists mysqltest;
create database mysqltest;
use mysqltest;
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28;
Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28, table29, table30;
Unknown table 'table1,table2,table3,table4,table5,table6,table7,table8,table9,table10,table11,table12,table13,table14,table15,table16,table17,table18,table19,table20,table21,table22,table23,table'
use test;
drop database mysqltest;
flush tables with read lock;
create database mysqltest;
......
......@@ -22,6 +22,28 @@ insert into mysqltest.mysqltest values (4);
select * from mysqltest.mysqltest;
drop database if exists mysqltest;
create database mysqltest;
#
# drop many tables - bug#3891
# we'll do it in mysqltest db, to be able to use longer table names
# (tableN instead on tN)
#
use mysqltest;
--error 1051
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28;
--error 1051
drop table table1, table2, table3, table4, table5, table6,
table7, table8, table9, table10, table11, table12, table13,
table14, table15, table16, table17, table18, table19, table20,
table21, table22, table23, table24, table25, table26, table27,
table28, table29, table30;
use test;
drop database mysqltest;
# test drop/create database and FLUSH TABLES WITH READ LOCK
......@@ -39,3 +61,4 @@ drop database mysqltest;
show databases;
--error 1008
drop database mysqltest;
......@@ -65,7 +65,7 @@
"Column '%-.64s' cannot be null",
"Unknown database '%-.64s'",
"Table '%-.64s' already exists",
"Unknown table '%-.64s'",
"Unknown table '%-.180s'",
"Column: '%-.64s' in %-.64s is ambiguous",
"Server shutdown in progress",
"Unknown column '%-.64s' in '%-.64s'",
......
......@@ -70,7 +70,7 @@
" '%-.64s' NULL",
" '%-.64s'",
" '%-.64s' ",
" '%-.64s'",
" '%-.175s'",
" '%-.64s' %-.64s ",
" ",
" '%-.64s' '%-.64s'",
......
......@@ -71,7 +71,7 @@
" '%-.64s' ",
"צ '%-.64s'",
" '%-.64s' դ",
"צ '%-.64s'",
"צ '%-.180s'",
" '%-.64s' %-.64s ",
"դ ",
"צ '%-.64s' '%-.64s'",
......
......@@ -237,7 +237,8 @@ int mysql_rm_table_part2(THD *thd, TABLE_LIST *tables, bool if_exists,
if (wrong_tables.length())
{
if (!foreign_key_error)
my_error(ER_BAD_TABLE_ERROR,MYF(0),wrong_tables.c_ptr());
my_printf_error(ER_BAD_TABLE_ERROR, ER(ER_BAD_TABLE_ERROR), MYF(0),
wrong_tables.c_ptr());
else
my_error(ER_ROW_IS_REFERENCED,MYF(0));
error= 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment