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
0e8cda61
Commit
0e8cda61
authored
Jan 25, 2024
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-33313 Incorrect error message for "ALTER TABLE ... DROP CONSTRAINT ..., DROP col, DROP col"
parent
67115405
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
mysql-test/main/alter_table.result
mysql-test/main/alter_table.result
+8
-0
mysql-test/main/alter_table.test
mysql-test/main/alter_table.test
+9
-0
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
mysql-test/main/alter_table.result
View file @
0e8cda61
...
...
@@ -3124,5 +3124,13 @@ CREATE TEMPORARY TABLE t2 LIKE t1;
DROP TEMPORARY TABLE t2;
DROP TABLE t1;
#
# MDEV-33313 Incorrect error message for "ALTER TABLE ... DROP CONSTRAINT ..., DROP col, DROP col"
#
create table t2(id int primary key) engine=innodb;
create table t1(id int primary key, t2_id int, constraint t1_fk_t2_id foreign key(t2_id) references t2(id)) engine=innodb;
alter table t1 drop constraint t1_fk_t2_id, drop t2_id, drop t2_id;
ERROR 42000: Can't DROP COLUMN `t2_id`; check that it exists
drop table t1, t2;
#
# End of 10.6 tests
#
mysql-test/main/alter_table.test
View file @
0e8cda61
...
...
@@ -2406,6 +2406,15 @@ CREATE TEMPORARY TABLE t2 LIKE t1;
DROP
TEMPORARY
TABLE
t2
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-33313 Incorrect error message for "ALTER TABLE ... DROP CONSTRAINT ..., DROP col, DROP col"
--
echo
#
create
table
t2
(
id
int
primary
key
)
engine
=
innodb
;
create
table
t1
(
id
int
primary
key
,
t2_id
int
,
constraint
t1_fk_t2_id
foreign
key
(
t2_id
)
references
t2
(
id
))
engine
=
innodb
;
--
error
ER_CANT_DROP_FIELD_OR_KEY
alter
table
t1
drop
constraint
t1_fk_t2_id
,
drop
t2_id
,
drop
t2_id
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# End of 10.6 tests
--
echo
#
sql/sql_table.cc
View file @
0e8cda61
...
...
@@ -8804,7 +8804,7 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
case
Alter_drop
:
:
CHECK_CONSTRAINT
:
case
Alter_drop
:
:
PERIOD
:
my_error
(
ER_CANT_DROP_FIELD_OR_KEY
,
MYF
(
0
),
drop
->
type_name
(),
alter_info
->
drop_list
.
head
()
->
name
);
drop
->
name
);
goto
err
;
case
Alter_drop
:
:
FOREIGN_KEY
:
// Leave the DROP FOREIGN KEY names in the alter_info->drop_list.
...
...
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