1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

ADD CONSTRAINT IF NOT EXISTS didn't work in SP

"if not exists" must be stored in a separate read-only property
This commit is contained in:
Sergei Golubchik
2022-11-03 19:17:25 +01:00
parent a5eff044cb
commit cce76fef38
5 changed files with 54 additions and 5 deletions

View File

@ -151,7 +151,9 @@ show create table t1;
DROP PROCEDURE sp;
DROP TABLE t1;
--echo #
--echo # End of 10.2 tests
--echo #
#
# Check that we don't lose constraints as part of CREATE ... SELECT
@ -172,3 +174,18 @@ insert into t1 values ("ccc");
insert into t1 values ("");
select * from t1;
drop table t1;
#
# add if not exists in SP
#
create table t1 (a int, b int);
create procedure sp() alter table t1 add constraint if not exists foo check (b > 0);
call sp;
show create table t1;
call sp;
show create table t1;
call sp;
show create table t1;
drop procedure sp;
drop table t1;