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:
@ -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;
|
||||
|
Reference in New Issue
Block a user