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
a5eff044
Commit
a5eff044
authored
Nov 03, 2022
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-22602 Disable UPDATE CASCADE for SQL constraints
fix it for named constraints too
parent
107d5460
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
1 deletion
+5
-1
mysql-test/suite/innodb/r/foreign_key.result
mysql-test/suite/innodb/r/foreign_key.result
+2
-0
mysql-test/suite/innodb/t/foreign_key.test
mysql-test/suite/innodb/t/foreign_key.test
+2
-0
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
mysql-test/suite/innodb/r/foreign_key.result
View file @
a5eff044
...
...
@@ -943,6 +943,8 @@ DROP TABLE t1;
#
# TODO: enable them after MDEV-16417 is finished
create or replace table t1 (a int primary key) engine=innodb;
create or replace table t2 (a int, constraint foo check(a > 0), foreign key(a) references t1(a) on update cascade) engine=innodb;
ERROR HY000: Function or expression 'a' cannot be used in the CHECK clause of `foo`
create or replace table t2 (a int, check(a > 0), foreign key(a) references t1(a) on update cascade) engine=innodb;
ERROR HY000: Function or expression 'a' cannot be used in the CHECK clause of `CONSTRAINT_1`
create or replace table t1 (f1 int, f2 date, f3 date, key(f1,f3,f2)) engine=innodb;
...
...
mysql-test/suite/innodb/t/foreign_key.test
View file @
a5eff044
...
...
@@ -971,6 +971,8 @@ DROP TABLE t1;
--
echo
# TODO: enable them after MDEV-16417 is finished
create
or
replace
table
t1
(
a
int
primary
key
)
engine
=
innodb
;
--
error
ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create
or
replace
table
t2
(
a
int
,
constraint
foo
check
(
a
>
0
),
foreign
key
(
a
)
references
t1
(
a
)
on
update
cascade
)
engine
=
innodb
;
--
error
ER_GENERATED_COLUMN_FUNCTION_IS_NOT_ALLOWED
create
or
replace
table
t2
(
a
int
,
check
(
a
>
0
),
foreign
key
(
a
)
references
t1
(
a
)
on
update
cascade
)
engine
=
innodb
;
create
or
replace
table
t1
(
f1
int
,
f2
date
,
f3
date
,
key
(
f1
,
f3
,
f2
))
engine
=
innodb
;
...
...
sql/sql_table.cc
View file @
a5eff044
...
...
@@ -4622,7 +4622,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info,
my_error
(
ER_TOO_LONG_IDENT
,
MYF
(
0
),
check
->
name
.
str
);
DBUG_RETURN
(
TRUE
);
}
if
(
check_expression
(
check
,
&
check
->
name
,
VCOL_CHECK_TABLE
))
if
(
check_expression
(
check
,
&
check
->
name
,
VCOL_CHECK_TABLE
,
alter_info
))
DBUG_RETURN
(
TRUE
);
}
}
...
...
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