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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
9686e7bf
Commit
9686e7bf
authored
May 31, 2006
by
mikael@c-3d08e253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#20161: LINEAR keyword on subpartitions not displayed in information schema for partitions
and in SHOW CREATE TABLE
parent
2e6b5157
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
9 deletions
+65
-9
mysql-test/r/information_schema_part.result
mysql-test/r/information_schema_part.result
+29
-0
mysql-test/t/information_schema_part.test
mysql-test/t/information_schema_part.test
+22
-0
sql/sql_partition.cc
sql/sql_partition.cc
+2
-0
sql/sql_show.cc
sql/sql_show.cc
+12
-9
No files found.
mysql-test/r/information_schema_part.result
View file @
9686e7bf
...
...
@@ -111,3 +111,32 @@ NULL test t1 p0 NULL 1 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0
NULL test t1 p1 NULL 2 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default
NULL test t1 p2 NULL 3 NULL LINEAR HASH NULL month(f1) NULL NULL 0 0 0 # 1024 0 # # NULL NULL default 0 default
drop table t1;
create table t1 (a int)
PARTITION BY RANGE (a)
SUBPARTITION BY LINEAR HASH (a)
(PARTITION p0 VALUES LESS THAN (10));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY RANGE (a) SUBPARTITION BY LINEAR HASH (a) (PARTITION p0 VALUES LESS THAN (10) )
select SUBPARTITION_METHOD FROM information_schema.partitions WHERE
table_schema="test" AND table_name="t1";
SUBPARTITION_METHOD
LINEAR HASH
drop table t1;
create table t1 (a int)
PARTITION BY LIST (a)
(PARTITION p0 VALUES IN
(10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,
32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p0 VALUES IN (10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53) ENGINE = MyISAM)
SELECT PARTITION_DESCRIPTION FROM information_schema.partitions WHERE
table_schema = "test" AND table_name = "t1";
PARTITION_DESCRIPTION
10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53
drop table t1;
mysql-test/t/information_schema_part.test
View file @
9686e7bf
...
...
@@ -99,3 +99,25 @@ select * from information_schema.partitions where table_schema="test"
and
table_name
=
"t1"
;
drop
table
t1
;
#
# Bug 20161 Partitions: SUBPARTITION METHOD doesn't show LINEAR keyword
#
create
table
t1
(
a
int
)
PARTITION
BY
RANGE
(
a
)
SUBPARTITION
BY
LINEAR
HASH
(
a
)
(
PARTITION
p0
VALUES
LESS
THAN
(
10
));
SHOW
CREATE
TABLE
t1
;
select
SUBPARTITION_METHOD
FROM
information_schema
.
partitions
WHERE
table_schema
=
"test"
AND
table_name
=
"t1"
;
drop
table
t1
;
create
table
t1
(
a
int
)
PARTITION
BY
LIST
(
a
)
(
PARTITION
p0
VALUES
IN
(
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
,
38
,
39
,
40
,
41
,
42
,
43
,
44
,
45
,
46
,
47
,
48
,
49
,
50
,
51
,
52
,
53
));
SHOW
CREATE
TABLE
t1
;
SELECT
PARTITION_DESCRIPTION
FROM
information_schema
.
partitions
WHERE
table_schema
=
"test"
AND
table_name
=
"t1"
;
drop
table
t1
;
sql/sql_partition.cc
View file @
9686e7bf
...
...
@@ -1843,6 +1843,8 @@ char *generate_partition_syntax(partition_info *part_info,
{
err
+=
add_subpartition_by
(
fptr
);
/* Must be hash partitioning for subpartitioning */
if
(
part_info
->
linear_hash_ind
)
err
+=
add_string
(
fptr
,
partition_keywords
[
PKW_LINEAR
].
str
);
if
(
part_info
->
list_of_subpart_fields
)
err
+=
add_key_partition
(
fptr
,
part_info
->
subpart_field_list
);
else
...
...
sql/sql_show.cc
View file @
9686e7bf
...
...
@@ -3911,24 +3911,28 @@ static int get_schema_partitions_record(THD *thd, struct st_table_list *tables,
{
table
->
field
[
9
]
->
store
(
part_info
->
part_func_string
,
part_info
->
part_func_len
,
cs
);
table
->
field
[
9
]
->
set_notnull
();
}
else
if
(
part_info
->
list_of_part_fields
)
{
collect_partition_expr
(
part_info
->
part_field_list
,
&
tmp_str
);
table
->
field
[
9
]
->
store
(
tmp_str
.
ptr
(),
tmp_str
.
length
(),
cs
);
table
->
field
[
9
]
->
set_notnull
();
}
table
->
field
[
9
]
->
set_notnull
();
if
(
part_info
->
is_sub_partitioned
())
{
/* Subpartition method */
tmp_res
.
length
(
0
);
if
(
part_info
->
linear_hash_ind
)
tmp_res
.
append
(
partition_keywords
[
PKW_LINEAR
].
str
,
partition_keywords
[
PKW_LINEAR
].
length
);
if
(
part_info
->
list_of_subpart_fields
)
t
able
->
field
[
8
]
->
store
(
partition_keywords
[
PKW_KEY
].
str
,
partition_keywords
[
PKW_KEY
].
length
,
cs
);
t
mp_res
.
append
(
partition_keywords
[
PKW_KEY
].
str
,
partition_keywords
[
PKW_KEY
].
length
);
else
table
->
field
[
8
]
->
store
(
partition_keywords
[
PKW_HASH
].
str
,
partition_keywords
[
PKW_HASH
].
length
,
cs
);
tmp_res
.
append
(
partition_keywords
[
PKW_HASH
].
str
,
partition_keywords
[
PKW_HASH
].
length
);
table
->
field
[
8
]
->
store
(
tmp_res
.
ptr
(),
tmp_res
.
length
(),
cs
);
table
->
field
[
8
]
->
set_notnull
();
/* Subpartition expression */
...
...
@@ -3936,14 +3940,13 @@ static int get_schema_partitions_record(THD *thd, struct st_table_list *tables,
{
table
->
field
[
10
]
->
store
(
part_info
->
subpart_func_string
,
part_info
->
subpart_func_len
,
cs
);
table
->
field
[
10
]
->
set_notnull
();
}
else
if
(
part_info
->
list_of_subpart_fields
)
{
collect_partition_expr
(
part_info
->
subpart_field_list
,
&
tmp_str
);
table
->
field
[
10
]
->
store
(
tmp_str
.
ptr
(),
tmp_str
.
length
(),
cs
);
table
->
field
[
10
]
->
set_notnull
();
}
table
->
field
[
10
]
->
set_notnull
();
}
while
((
part_elem
=
part_it
++
))
...
...
@@ -5241,7 +5244,7 @@ ST_FIELD_INFO partitions_fields_info[]=
{
"PARTITION_ORDINAL_POSITION"
,
21
,
MYSQL_TYPE_LONG
,
0
,
1
,
0
},
{
"SUBPARTITION_ORDINAL_POSITION"
,
21
,
MYSQL_TYPE_LONG
,
0
,
1
,
0
},
{
"PARTITION_METHOD"
,
12
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"SUBPARTITION_METHOD"
,
5
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"SUBPARTITION_METHOD"
,
12
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PARTITION_EXPRESSION"
,
65535
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"SUBPARTITION_EXPRESSION"
,
65535
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
{
"PARTITION_DESCRIPTION"
,
65535
,
MYSQL_TYPE_STRING
,
0
,
1
,
0
},
...
...
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