Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5c764a0e
Commit
5c764a0e
authored
Jul 02, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clarify ER_CANT_DROP_FIELD_OR_KEY
include the dropped object type
parent
5e3a1ea1
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
54 additions
and
56 deletions
+54
-56
mysql-test/extra/rpl_tests/rpl_extra_col_master.test
mysql-test/extra/rpl_tests/rpl_extra_col_master.test
+1
-1
mysql-test/r/alter_table.result
mysql-test/r/alter_table.result
+10
-10
mysql-test/r/check_constraint.result
mysql-test/r/check_constraint.result
+1
-1
mysql-test/r/create_drop_binlog.result
mysql-test/r/create_drop_binlog.result
+1
-1
mysql-test/r/create_drop_index.result
mysql-test/r/create_drop_index.result
+1
-1
mysql-test/r/key.result
mysql-test/r/key.result
+1
-1
mysql-test/suite/engines/funcs/r/ix_drop_error.result
mysql-test/suite/engines/funcs/r/ix_drop_error.result
+1
-1
mysql-test/suite/innodb/r/innodb-index.result
mysql-test/suite/innodb/r/innodb-index.result
+2
-2
mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
+1
-1
mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
+1
-1
sql/share/errmsg-utf8.txt
sql/share/errmsg-utf8.txt
+21
-23
sql/sql_class.h
sql/sql_class.h
+6
-0
sql/sql_table.cc
sql/sql_table.cc
+2
-8
storage/connect/mysql-test/connect/r/xml_mdev5261.result
storage/connect/mysql-test/connect/r/xml_mdev5261.result
+2
-2
storage/innobase/handler/handler0alter.cc
storage/innobase/handler/handler0alter.cc
+1
-1
storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
...okudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
+1
-1
storage/xtradb/handler/handler0alter.cc
storage/xtradb/handler/handler0alter.cc
+1
-1
No files found.
mysql-test/extra/rpl_tests/rpl_extra_col_master.test
View file @
5c764a0e
...
...
@@ -126,7 +126,7 @@ SELECT f1,f2,f3,f4,f5,f6,f7,f8,f9,
--
disable_query_log
call
mtr
.
add_suppression
(
"Slave SQL.*Table definition on master and slave does not match: Column 2 type mismatch.* 1535"
);
call
mtr
.
add_suppression
(
"Slave.*Can.t DROP .c7.; check that .* exists.* error.* 1091"
);
call
mtr
.
add_suppression
(
"Slave.*Can.t DROP
COLUMN
.c7.; check that .* exists.* error.* 1091"
);
call
mtr
.
add_suppression
(
"Slave.*Unknown column .c7. in .t15.* error.* 1054"
);
call
mtr
.
add_suppression
(
"Slave.*Key column .c6. doesn.t exist in table.* error.* 1072"
);
call
mtr
.
add_suppression
(
"Slave SQL.*Column 2 of table .test.t1.. cannot be converted from type.* error.* 1677"
);
...
...
mysql-test/r/alter_table.result
View file @
5c764a0e
...
...
@@ -414,12 +414,12 @@ t1 CREATE TABLE `t1` (
UNIQUE KEY `b` (`b`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t1 DROP PRIMARY KEY;
ERROR 42000: Can't DROP `PRIMARY`; check that it exists
ERROR 42000: Can't DROP
INDEX
`PRIMARY`; check that it exists
DROP TABLE t1;
create table t1 (a int, b int, key(a));
insert into t1 values (1,1), (2,2);
alter table t1 drop key no_such_key;
ERROR 42000: Can't DROP `no_such_key`; check that it exists
ERROR 42000: Can't DROP
INDEX
`no_such_key`; check that it exists
alter table t1 drop key a;
drop table t1;
CREATE TABLE T12207(a int) ENGINE=MYISAM;
...
...
@@ -1374,7 +1374,7 @@ Note 1060 Duplicate column name 'lol'
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
Warnings:
Note 1091 Can't DROP `lol`; check that it exists
Note 1091 Can't DROP
COLUMN
`lol`; check that it exists
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
Warnings:
...
...
@@ -1385,7 +1385,7 @@ Note 1054 Unknown column 'lol' in 't1'
DROP INDEX IF EXISTS x_param ON t1;
DROP INDEX IF EXISTS x_param ON t1;
Warnings:
Note 1091 Can't DROP `x_param`; check that it exists
Note 1091 Can't DROP
INDEX
`x_param`; check that it exists
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
Warnings:
...
...
@@ -1416,7 +1416,7 @@ Note 1060 Duplicate column name 'lol'
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
ALTER TABLE t1 DROP COLUMN IF EXISTS lol;
Warnings:
Note 1091 Can't DROP `lol`; check that it exists
Note 1091 Can't DROP
COLUMN
`lol`; check that it exists
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
ALTER TABLE t1 ADD KEY IF NOT EXISTS x_param(x_param);
Warnings:
...
...
@@ -1427,7 +1427,7 @@ Note 1054 Unknown column 'lol' in 't1'
DROP INDEX IF EXISTS x_param ON t1;
DROP INDEX IF EXISTS x_param ON t1;
Warnings:
Note 1091 Can't DROP `x_param`; check that it exists
Note 1091 Can't DROP
INDEX
`x_param`; check that it exists
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
CREATE INDEX IF NOT EXISTS x_param1 ON t1(x_param);
Warnings:
...
...
@@ -1447,7 +1447,7 @@ Note 1061 Duplicate key name 'fk'
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS fk;
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS fk;
Warnings:
Note 1091 Can't DROP `fk`; check that it exists
Note 1091 Can't DROP
FOREIGN KEY
`fk`; check that it exists
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
...
...
@@ -1461,7 +1461,7 @@ Note 1061 Duplicate key name 't2_ibfk_1'
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS t2_ibfk_1;
ALTER TABLE t2 DROP FOREIGN KEY IF EXISTS t2_ibfk_1;
Warnings:
Note 1091 Can't DROP `t2_ibfk_1`; check that it exists
Note 1091 Can't DROP
FOREIGN KEY
`t2_ibfk_1`; check that it exists
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
...
...
@@ -1486,10 +1486,10 @@ t2 CREATE TABLE `t2` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
ALTER TABLE t2 DROP KEY k_id, DROP KEY IF EXISTS k_id;
Warnings:
Note 1091 Can't DROP `k_id`; check that it exists
Note 1091 Can't DROP
INDEX
`k_id`; check that it exists
ALTER TABLE t2 DROP COLUMN a, DROP COLUMN IF EXISTS a;
Warnings:
Note 1091 Can't DROP `a`; check that it exists
Note 1091 Can't DROP
COLUMN
`a`; check that it exists
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
...
...
mysql-test/r/check_constraint.result
View file @
5c764a0e
...
...
@@ -83,7 +83,7 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t2 drop constraint c;
ERROR 42000: Can't DROP `c`; check that it exists
ERROR 42000: Can't DROP
CONSTRAINT
`c`; check that it exists
alter table t2 drop constraint min;
show create table t2;
Table Create Table
...
...
mysql-test/r/create_drop_binlog.result
View file @
5c764a0e
...
...
@@ -363,7 +363,7 @@ t1 CREATE TABLE `t1` (
DROP INDEX IF EXISTS i1 ON t1;
DROP INDEX IF EXISTS i1 ON t1;
Warnings:
Note 1091 Can't DROP `i1`; check that it exists
Note 1091 Can't DROP
INDEX
`i1`; check that it exists
DROP TABLE t1;
DROP TABLE IF EXISTS t1;
Warnings:
...
...
mysql-test/r/create_drop_index.result
View file @
5c764a0e
...
...
@@ -16,7 +16,7 @@ t1 CREATE TABLE `t1` (
) ENGINE=MyISAM DEFAULT CHARSET=latin1
DROP INDEX IF EXISTS i1 ON t1;
Warnings:
Note 1091 Can't DROP `i1`; check that it exists
Note 1091 Can't DROP
INDEX
`i1`; check that it exists
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
mysql-test/r/key.result
View file @
5c764a0e
...
...
@@ -467,7 +467,7 @@ alter table t1 drop index c2, add index (c2(4),c3(7));
alter table t1 add primary key (c1, c2), drop primary key;
alter table t1 drop primary key;
alter table t1 add primary key (c1, c2), drop primary key;
ERROR 42000: Can't DROP `PRIMARY`; check that it exists
ERROR 42000: Can't DROP
INDEX
`PRIMARY`; check that it exists
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
...
...
mysql-test/suite/engines/funcs/r/ix_drop_error.result
View file @
5c764a0e
DROP TABLE IF EXISTS t9;
CREATE TABLE t9(c1 INTEGER NOT NULL);
DROP INDEX i1 ON t9;
ERROR 42000: Can't DROP `i1`; check that it exists
ERROR 42000: Can't DROP
INDEX
`i1`; check that it exists
DROP TABLE t9;
SHOW TABLES;
Tables_in_test
mysql-test/suite/innodb/r/innodb-index.result
View file @
5c764a0e
...
...
@@ -544,9 +544,9 @@ t2 CREATE TABLE `t2` (
delete from t1;
ERROR 23000: Cannot delete or update a parent row: a foreign key constraint fails (`test`.`t4`, CONSTRAINT `dc` FOREIGN KEY (`a`) REFERENCES `t1` (`a`))
drop index dc on t4;
ERROR 42000: Can't DROP `dc`; check that it exists
ERROR 42000: Can't DROP
INDEX
`dc`; check that it exists
alter table t3 drop foreign key dc;
ERROR 42000: Can't DROP `dc`; check that it exists
ERROR 42000: Can't DROP
FOREIGN KEY
`dc`; check that it exists
alter table t4 drop foreign key dc;
affected rows: 0
info: Records: 0 Duplicates: 0 Warnings: 0
...
...
mysql-test/suite/rpl/r/rpl_extra_col_master_innodb.result
View file @
5c764a0e
...
...
@@ -636,7 +636,7 @@ c1 c3 hex(c4) c5 c6
************
connection slave;
include/wait_for_slave_sql_error.inc [errno=1091]
Last_SQL_Error = 'Error 'Can't DROP `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
Last_SQL_Error = 'Error 'Can't DROP
COLUMN
`c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
RESET SLAVE;
...
...
mysql-test/suite/rpl/r/rpl_extra_col_master_myisam.result
View file @
5c764a0e
...
...
@@ -636,7 +636,7 @@ c1 c3 hex(c4) c5 c6
************
connection slave;
include/wait_for_slave_sql_error.inc [errno=1091]
Last_SQL_Error = 'Error 'Can't DROP `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
Last_SQL_Error = 'Error 'Can't DROP
COLUMN
`c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
RESET SLAVE;
...
...
sql/share/errmsg-utf8.txt
View file @
5c764a0e
...
...
@@ -2071,29 +2071,27 @@ ER_CANT_REMOVE_ALL_FIELDS 42000
swe "Man kan inte radera alla fält med ALTER TABLE. Använd DROP TABLE istället"
ukr "Не можливо видалити всі стовбці за допомогою ALTER TABLE. Для цього скористайтеся DROP TABLE"
ER_CANT_DROP_FIELD_OR_KEY 42000
cze "Nemohu zrušit %`-.192s (provést DROP). Zkontrolujte, zda neexistují záznamy/klíče"
dan "Kan ikke udføre DROP %`-.192s. Undersøg om feltet/nøglen eksisterer."
nla "Kan %`-.192s niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat."
eng "Can't DROP %`-.192s; check that it exists"
est "Ei suuda kustutada %`-.192s. Kontrolli kas tulp/võti eksisteerib"
fre "Ne peut effacer (DROP) %`-.192s. Vérifiez s'il existe"
ger "Kann %`-.192s nicht löschen. Existiert es?"
greek "Αδύνατη η διαγραφή (DROP) %`-.192s. Παρακαλώ ελέγξτε αν το πεδίο/κλειδί υπάρχει"
hun "A DROP %`-.192s nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e"
ita "Impossibile cancellare %`-.192s. Controllare che il campo chiave esista"
jpn "%`-.192s を削除できません。列/索引の存在を確認して下さい。"
kor "%`-.192s를 DROP할 수 없습니다. 칼럼이나 키가 존재하는지 채크하세요."
nor "Kan ikke DROP %`-.192s. Undersøk om felt/nøkkel eksisterer."
norwegian-ny "Kan ikkje DROP %`-.192s. Undersøk om felt/nøkkel eksisterar."
pol "Nie można wykonać operacji DROP %`-.192s. SprawdĽ, czy to pole/klucz istnieje"
por "Não se pode fazer DROP %`-.192s. Confira se esta coluna/chave existe"
rum "Nu pot sa DROP %`-.192s. Verifica daca coloana/cheia exista"
rus "Невозможно удалить (DROP) %`-.192s. Убедитесь что он действительно существует"
serbian "Ne mogu da izvršim komandu drop 'DROP' na %`-.192s. Proverite da li ta kolona (odnosno ključ) postoji"
slo "Nemôžem zrušiť (DROP) %`-.192s. Skontrolujte, či neexistujú záznamy/kľúče"
spa "No puedo ELIMINAR %`-.192s. compuebe que el campo/clave existe"
swe "Kan inte ta bort %`-.192s. Kontrollera att begränsningen/fältet/nyckel finns"
ukr "Не можу DROP %`-.192s. Перевірте, чи він існує"
cze "Nemohu zrušit (DROP %s) %`-.192s. Zkontrolujte, zda neexistují záznamy/klíče"
dan "Kan ikke udføre DROP %s %`-.192s. Undersøg om feltet/nøglen eksisterer."
nla "DROP %s: Kan %`-.192s niet weggooien. Controleer of het veld of de zoeksleutel daadwerkelijk bestaat."
eng "Can't DROP %s %`-.192s; check that it exists"
est "Ei suuda kustutada (DROP %s) %`-.192s. Kontrolli kas tulp/võti eksisteerib"
fre "Ne peut effacer (DROP %s) %`-.192s. Vérifiez s'il existe"
ger "DROP %s: Kann %`-.192s nicht löschen. Existiert es?"
greek "Αδύνατη η διαγραφή (DROP %s) %`-.192s. Παρακαλώ ελέγξτε αν το πεδίο/κλειδί υπάρχει"
hun "A DROP %s %`-.192s nem lehetseges. Ellenorizze, hogy a mezo/kulcs letezik-e"
ita "Impossibile cancellare (DROP %s) %`-.192s. Controllare che il campo chiave esista"
nor "Kan ikke DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterer."
norwegian-ny "Kan ikkje DROP %s %`-.192s. Undersøk om felt/nøkkel eksisterar."
pol "Nie można wykonać operacji DROP %s %`-.192s. SprawdĽ, czy to pole/klucz istnieje"
por "Não se pode fazer DROP %s %`-.192s. Confira se esta coluna/chave existe"
rum "Nu pot sa DROP %s %`-.192s. Verifica daca coloana/cheia exista"
rus "Невозможно удалить (DROP %s) %`-.192s. Убедитесь что он действительно существует"
serbian "Ne mogu da izvršim komandu drop 'DROP %s' na %`-.192s. Proverite da li ta kolona (odnosno ključ) postoji"
slo "Nemôžem zrušiť (DROP %s) %`-.192s. Skontrolujte, či neexistujú záznamy/kľúče"
spa "No puedo eliminar (DROP %s) %`-.192s. compuebe que el campo/clave existe"
swe "Kan inte ta bort (DROP %s) %`-.192s. Kontrollera att begränsningen/fältet/nyckel finns"
ukr "Не можу DROP %s %`-.192s. Перевірте, чи він існує"
ER_INSERT_INFO
cze "Záznamů: %ld Zdvojených: %ld Varování: %ld"
dan "Poster: %ld Ens: %ld Advarsler: %ld"
...
...
sql/sql_class.h
View file @
5c764a0e
...
...
@@ -272,6 +272,12 @@ class Alter_drop :public Sql_alloc {
*/
Alter_drop
*
clone
(
MEM_ROOT
*
mem_root
)
const
{
return
new
(
mem_root
)
Alter_drop
(
*
this
);
}
const
char
*
type_name
()
{
return
type
==
COLUMN
?
"COLUMN"
:
type
==
CHECK_CONSTRAINT
?
"CONSTRAINT"
:
type
==
KEY
?
"INDEX"
:
"FOREIGN KEY"
;
}
};
...
...
sql/sql_table.cc
View file @
5c764a0e
...
...
@@ -5947,7 +5947,7 @@ handle_if_exists_options(THD *thd, TABLE *table, Alter_info *alter_info)
push_warning_printf
(
thd
,
Sql_condition
::
WARN_LEVEL_NOTE
,
ER_CANT_DROP_FIELD_OR_KEY
,
ER_THD
(
thd
,
ER_CANT_DROP_FIELD_OR_KEY
),
drop
->
name
);
drop
->
type_name
(),
drop
->
name
);
drop_it
.
remove
();
if
(
alter_info
->
drop_list
.
is_empty
())
alter_info
->
flags
&=
~
(
Alter_info
::
ALTER_DROP_COLUMN
|
...
...
@@ -7890,7 +7890,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
case
Alter_drop
:
:
KEY
:
case
Alter_drop
:
:
COLUMN
:
case
Alter_drop
:
:
CHECK_CONSTRAINT
:
my_error
(
ER_CANT_DROP_FIELD_OR_KEY
,
MYF
(
0
),
my_error
(
ER_CANT_DROP_FIELD_OR_KEY
,
MYF
(
0
),
drop
->
type_name
(),
alter_info
->
drop_list
.
head
()
->
name
);
goto
err
;
case
Alter_drop
:
:
FOREIGN_KEY
:
...
...
@@ -7899,12 +7899,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
}
}
}
if
(
alter_info
->
alter_list
.
elements
)
{
my_error
(
ER_CANT_DROP_FIELD_OR_KEY
,
MYF
(
0
),
alter_info
->
alter_list
.
head
()
->
name
);
goto
err
;
}
if
(
!
create_info
->
comment
.
str
)
{
...
...
storage/connect/mysql-test/connect/r/xml_mdev5261.result
View file @
5c764a0e
...
...
@@ -19,7 +19,7 @@ SELECT * FROM t1 WHERE i = 5;
i
5
ALTER TABLE t1 DROP INDEX i;
ERROR 42000: Can't DROP `i`; check that it exists
ERROR 42000: Can't DROP
INDEX
`i`; check that it exists
DROP INDEX i ON t1;
ERROR 42000: Can't DROP `i`; check that it exists
ERROR 42000: Can't DROP
INDEX
`i`; check that it exists
DROP TABLE t1;
storage/innobase/handler/handler0alter.cc
View file @
5c764a0e
...
...
@@ -3789,7 +3789,7 @@ ha_innobase::prepare_inplace_alter_table(
}
my_error
(
ER_CANT_DROP_FIELD_OR_KEY
,
MYF
(
0
),
drop
->
name
);
drop
->
type_name
(),
drop
->
name
);
goto
err_exit
;
found_fk:
continue
;
...
...
storage/tokudb/mysql-test/rpl/r/rpl_extra_col_master_tokudb.result
View file @
5c764a0e
...
...
@@ -636,7 +636,7 @@ c1 c3 hex(c4) c5 c6
************
connection slave;
include/wait_for_slave_sql_error.inc [errno=1091]
Last_SQL_Error = 'Error 'Can't DROP `c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
Last_SQL_Error = 'Error 'Can't DROP
COLUMN
`c7`; check that it exists' on query. Default database: 'test'. Query: 'ALTER TABLE t14 DROP COLUMN c7''
STOP SLAVE;
RESET SLAVE;
...
...
storage/xtradb/handler/handler0alter.cc
View file @
5c764a0e
...
...
@@ -3803,7 +3803,7 @@ ha_innobase::prepare_inplace_alter_table(
}
my_error
(
ER_CANT_DROP_FIELD_OR_KEY
,
MYF
(
0
),
drop
->
name
);
drop
->
type_name
(),
drop
->
name
);
goto
err_exit
;
found_fk:
continue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment