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
5937da69
Commit
5937da69
authored
Mar 16, 2010
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
8347e1ea
5eaa7936
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
95 additions
and
24 deletions
+95
-24
mysql-test/r/partition_column.result
mysql-test/r/partition_column.result
+40
-10
mysql-test/t/partition_column.test
mysql-test/t/partition_column.test
+53
-12
sql/sql_partition.cc
sql/sql_partition.cc
+2
-2
No files found.
mysql-test/r/partition_column.result
View file @
5937da69
drop table if exists t1;
CREATE TABLE t1 (a DECIMAL)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN (0));
ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
CREATE TABLE t1 (a BLOB)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN ("X"));
ERROR HY000: A BLOB field is not allowed in partition function
CREATE TABLE t1 (a TEXT)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN ("X"));
ERROR HY000: A BLOB field is not allowed in partition function
CREATE TABLE t1 (a FLOAT)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN (0.0));
ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
CREATE TABLE t1 (a DOUBLE)
PARTITION BY RANGE COLUMNS (a)
(PARTITION p0 VALUES LESS THAN (0.0));
ERROR HY000: Field 'a' is of a not allowed type for this type of partitioning
CREATE TABLE t1 (d TIMESTAMP)
PARTITION BY RANGE COLUMNS(d)
(PARTITION p0 VALUES LESS THAN ('2000-01-01'),
PARTITION p1 VALUES LESS THAN ('2040-01-01'));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
CREATE TABLE t1 (d BIT(1))
PARTITION BY RANGE COLUMNS(d)
(PARTITION p0 VALUES LESS THAN (0),
PARTITION p1 VALUES LESS THAN (1));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
CREATE TABLE t1 (d ENUM("YES","NO"))
PARTITION BY RANGE COLUMNS(d)
(PARTITION p0 VALUES LESS THAN ("NO"),
PARTITION p1 VALUES LESS THAN (MAXVALUE));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
CREATE TABLE t1 (d SET("Car","MC"))
PARTITION BY RANGE COLUMNS(d)
(PARTITION p0 VALUES LESS THAN ("MC"),
PARTITION p1 VALUES LESS THAN (MAXVALUE));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (a int, b int)
partition by range columns (a,b)
( partition p0 values less than (maxvalue, 10),
...
...
@@ -430,16 +470,6 @@ partition by range columns(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
ERROR HY000: Partition column values of incorrect type
create table t1 (d timestamp)
partition by range columns(d)
( partition p0 values less than ('2000-01-01'),
partition p1 values less than ('2040-01-01'));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (d bit(1))
partition by range columns(d)
( partition p0 values less than (0),
partition p1 values less than (1));
ERROR HY000: Field 'd' is of a not allowed type for this type of partitioning
create table t1 (a int, b int)
partition by range columns(a,b)
(partition p0 values less than (maxvalue, 10));
...
...
mysql-test/t/partition_column.test
View file @
5937da69
...
...
@@ -8,6 +8,59 @@
drop
table
if
exists
t1
;
--
enable_warnings
#
# Bug#51347: assertion with show create table + partition by columns
# on decimal column
#
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
a
DECIMAL
)
PARTITION
BY
RANGE
COLUMNS
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
0
));
--
error
ER_BLOB_FIELD_IN_PART_FUNC_ERROR
CREATE
TABLE
t1
(
a
BLOB
)
PARTITION
BY
RANGE
COLUMNS
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
"X"
));
--
error
ER_BLOB_FIELD_IN_PART_FUNC_ERROR
CREATE
TABLE
t1
(
a
TEXT
)
PARTITION
BY
RANGE
COLUMNS
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
"X"
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
a
FLOAT
)
PARTITION
BY
RANGE
COLUMNS
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
0.0
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
a
DOUBLE
)
PARTITION
BY
RANGE
COLUMNS
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
0.0
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
d
TIMESTAMP
)
PARTITION
BY
RANGE
COLUMNS
(
d
)
(
PARTITION
p0
VALUES
LESS
THAN
(
'2000-01-01'
),
PARTITION
p1
VALUES
LESS
THAN
(
'2040-01-01'
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
d
BIT
(
1
))
PARTITION
BY
RANGE
COLUMNS
(
d
)
(
PARTITION
p0
VALUES
LESS
THAN
(
0
),
PARTITION
p1
VALUES
LESS
THAN
(
1
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
d
ENUM
(
"YES"
,
"NO"
))
PARTITION
BY
RANGE
COLUMNS
(
d
)
(
PARTITION
p0
VALUES
LESS
THAN
(
"NO"
),
PARTITION
p1
VALUES
LESS
THAN
(
MAXVALUE
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
CREATE
TABLE
t1
(
d
SET
(
"Car"
,
"MC"
))
PARTITION
BY
RANGE
COLUMNS
(
d
)
(
PARTITION
p0
VALUES
LESS
THAN
(
"MC"
),
PARTITION
p1
VALUES
LESS
THAN
(
MAXVALUE
));
#
# BUG#49180, Possible to define empty intervals for column list partitioning
#
...
...
@@ -285,18 +338,6 @@ partition by range columns(d)
(
partition
p0
values
less
than
(
'2000-01-01'
),
partition
p1
values
less
than
(
'2040-01-01'
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
create
table
t1
(
d
timestamp
)
partition
by
range
columns
(
d
)
(
partition
p0
values
less
than
(
'2000-01-01'
),
partition
p1
values
less
than
(
'2040-01-01'
));
--
error
ER_FIELD_TYPE_NOT_ALLOWED_AS_PARTITION_FIELD
create
table
t1
(
d
bit
(
1
))
partition
by
range
columns
(
d
)
(
partition
p0
values
less
than
(
0
),
partition
p1
values
less
than
(
1
));
create
table
t1
(
a
int
,
b
int
)
partition
by
range
columns
(
a
,
b
)
(
partition
p0
values
less
than
(
maxvalue
,
10
));
...
...
sql/sql_partition.cc
View file @
5937da69
...
...
@@ -2128,8 +2128,6 @@ static int check_part_field(enum_field_types sql_type,
}
switch
(
sql_type
)
{
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_DECIMAL
:
case
MYSQL_TYPE_TINY
:
case
MYSQL_TYPE_SHORT
:
case
MYSQL_TYPE_LONG
:
...
...
@@ -2151,6 +2149,8 @@ static int check_part_field(enum_field_types sql_type,
*
result_type
=
STRING_RESULT
;
*
need_cs_check
=
TRUE
;
return
FALSE
;
case
MYSQL_TYPE_NEWDECIMAL
:
case
MYSQL_TYPE_DECIMAL
:
case
MYSQL_TYPE_TIMESTAMP
:
case
MYSQL_TYPE_NULL
:
case
MYSQL_TYPE_FLOAT
:
...
...
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