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
519e244b
Commit
519e244b
authored
Jun 26, 2016
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for auto-generated constraint names
parent
99e48cb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
1 deletion
+49
-1
mysql-test/r/check_constraint.result
mysql-test/r/check_constraint.result
+33
-0
mysql-test/t/check_constraint.test
mysql-test/t/check_constraint.test
+16
-0
mysql-test/t/constraints.test
mysql-test/t/constraints.test
+0
-1
No files found.
mysql-test/r/check_constraint.result
View file @
519e244b
...
...
@@ -95,3 +95,36 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `CONSTRAINT_1` CHECK (a+b+c < 500)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1,t2;
create or replace table t1 (a int, b int, constraint check (a>b));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>b)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a int, b int,
constraint CONSTRAINT_1 check (a>1),
constraint check (b>1));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>1),
CONSTRAINT `CONSTRAINT_2` CHECK (b>1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
create or replace table t1 (a int, b int,
constraint CONSTRAINT_1 check (a>1),
constraint check (b>1),
constraint CONSTRAINT_2 check (a>b));
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL,
CONSTRAINT `CONSTRAINT_1` CHECK (a>1),
CONSTRAINT `CONSTRAINT_3` CHECK (b>1),
CONSTRAINT `CONSTRAINT_2` CHECK (a>b)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
mysql-test/t/check_constraint.test
View file @
519e244b
...
...
@@ -52,3 +52,19 @@ alter table t2 drop constraint min;
show
create
table
t2
;
drop
table
t1
,
t2
;
#
# check constraint name auto-generation:
#
create
or
replace
table
t1
(
a
int
,
b
int
,
constraint
check
(
a
>
b
));
show
create
table
t1
;
create
or
replace
table
t1
(
a
int
,
b
int
,
constraint
CONSTRAINT_1
check
(
a
>
1
),
constraint
check
(
b
>
1
));
show
create
table
t1
;
create
or
replace
table
t1
(
a
int
,
b
int
,
constraint
CONSTRAINT_1
check
(
a
>
1
),
constraint
check
(
b
>
1
),
constraint
CONSTRAINT_2
check
(
a
>
b
));
show
create
table
t1
;
drop
table
t1
;
mysql-test/t/constraints.test
View file @
519e244b
#
# Testing of constraints
# Currently MySQL only ignores the syntax.
#
--
disable_warnings
drop
table
if
exists
t1
;
...
...
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