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
4d624635
Commit
4d624635
authored
Oct 01, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added more test cases
parent
66ea81cd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
59 additions
and
0 deletions
+59
-0
mysql-test/r/partition_column.result
mysql-test/r/partition_column.result
+40
-0
mysql-test/t/partition_column.test
mysql-test/t/partition_column.test
+19
-0
No files found.
mysql-test/r/partition_column.result
View file @
4d624635
drop table if exists t1;
drop table if exists t1;
create table t1 (a int, b int)
partition by list column_list(a,b)
( partition p0 values in (column_list(1, NULL), column_list(2, NULL),
column_list(NULL, NULL)),
partition p1 values in (column_list(1,1), column_list(2,2)),
partition p2 values in (column_list(3, NULL), column_list(NULL, 1)));
insert into t1 values (3, NULL);
insert into t1 values (NULL, 1);
insert into t1 values (NULL, NULL);
insert into t1 values (1, NULL);
insert into t1 values (2, NULL);
insert into t1 values (1,1);
insert into t1 values (2,2);
select * from t1 where a = 1;
a b
1 NULL
1 1
select * from t1 where a = 2;
a b
2 NULL
2 2
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL,
`b` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN_LIST(a,b)
(PARTITION p0 VALUES IN ( COLUMN_LIST(1,NULL), COLUMN_LIST(2,NULL), COLUMN_LIST(NULL,NULL)) ENGINE = MyISAM,
PARTITION p1 VALUES IN ( COLUMN_LIST(1,1), COLUMN_LIST(2,2)) ENGINE = MyISAM,
PARTITION p2 VALUES IN ( COLUMN_LIST(3,NULL), COLUMN_LIST(NULL,1)) ENGINE = MyISAM) */
drop table t1;
create table t1 (a int)
create table t1 (a int)
partition by list (a)
partition by list (a)
( partition p0 values in (1),
( partition p0 values in (1),
...
@@ -27,6 +59,14 @@ insert into t1 values (4);
...
@@ -27,6 +59,14 @@ insert into t1 values (4);
insert into t1 values (NULL);
insert into t1 values (NULL);
insert into t1 values (5);
insert into t1 values (5);
ERROR HY000: Table has no partition for value from column_list
ERROR HY000: Table has no partition for value from column_list
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY LIST COLUMN_LIST(a)
(PARTITION p0 VALUES IN ( COLUMN_LIST(2), COLUMN_LIST(1)) ENGINE = MyISAM,
PARTITION p1 VALUES IN ( COLUMN_LIST(4), COLUMN_LIST(NULL), COLUMN_LIST(3)) ENGINE = MyISAM) */
drop table t1;
drop table t1;
create table t1 (a int, b char(10), c varchar(25), d datetime)
create table t1 (a int, b char(10), c varchar(25), d datetime)
partition by range column_list(a,b,c,d)
partition by range column_list(a,b,c,d)
...
...
mysql-test/t/partition_column.test
View file @
4d624635
...
@@ -8,6 +8,24 @@
...
@@ -8,6 +8,24 @@
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
--
enable_warnings
--
enable_warnings
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column_list
(
a
,
b
)
(
partition
p0
values
in
(
column_list
(
1
,
NULL
),
column_list
(
2
,
NULL
),
column_list
(
NULL
,
NULL
)),
partition
p1
values
in
(
column_list
(
1
,
1
),
column_list
(
2
,
2
)),
partition
p2
values
in
(
column_list
(
3
,
NULL
),
column_list
(
NULL
,
1
)));
insert
into
t1
values
(
3
,
NULL
);
insert
into
t1
values
(
NULL
,
1
);
insert
into
t1
values
(
NULL
,
NULL
);
insert
into
t1
values
(
1
,
NULL
);
insert
into
t1
values
(
2
,
NULL
);
insert
into
t1
values
(
1
,
1
);
insert
into
t1
values
(
2
,
2
);
select
*
from
t1
where
a
=
1
;
select
*
from
t1
where
a
=
2
;
show
create
table
t1
;
drop
table
t1
;
--
error
ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
--
error
ER_MULTIPLE_DEF_CONST_IN_LIST_PART_ERROR
create
table
t1
(
a
int
)
create
table
t1
(
a
int
)
partition
by
list
(
a
)
partition
by
list
(
a
)
...
@@ -38,6 +56,7 @@ insert into t1 values (4);
...
@@ -38,6 +56,7 @@ insert into t1 values (4);
insert
into
t1
values
(
NULL
);
insert
into
t1
values
(
NULL
);
--
error
ER_NO_PARTITION_FOR_GIVEN_VALUE
--
error
ER_NO_PARTITION_FOR_GIVEN_VALUE
insert
into
t1
values
(
5
);
insert
into
t1
values
(
5
);
show
create
table
t1
;
drop
table
t1
;
drop
table
t1
;
create
table
t1
(
a
int
,
b
char
(
10
),
c
varchar
(
25
),
d
datetime
)
create
table
t1
(
a
int
,
b
char
(
10
),
c
varchar
(
25
),
d
datetime
)
...
...
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