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
f6ec131f
Commit
f6ec131f
authored
Nov 18, 2009
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
58f43459
3faaf333
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
16 deletions
+70
-16
mysql-test/r/partition.result
mysql-test/r/partition.result
+18
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+23
-0
sql/sql_partition.cc
sql/sql_partition.cc
+29
-16
No files found.
mysql-test/r/partition.result
View file @
f6ec131f
drop table if exists t1, t2;
CREATE TABLE t1 (a INT, b INT)
PARTITION BY LIST (a)
SUBPARTITION BY HASH (b)
(PARTITION p1 VALUES IN (1));
ALTER TABLE t1 ADD COLUMN c INT;
DROP TABLE t1;
CREATE TABLE t1 (
a int NOT NULL,
b int NOT NULL);
...
...
@@ -50,6 +56,13 @@ t1 CREATE TABLE `t1` (
PARTITION p3 VALUES LESS THAN (733969) ENGINE = MyISAM,
PARTITION pmax VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
DROP TABLE t1;
create table t1 (a int NOT NULL, b varchar(5) NOT NULL)
default charset=utf8
partition by list (a)
subpartition by key (b)
(partition p0 values in (1),
partition p1 values in (2));
drop table t1;
create table t1 (a int, b int, key(a))
partition by list (a)
( partition p0 values in (1),
...
...
@@ -2045,10 +2058,15 @@ DROP TABLE t1;
#
# Bug #45807: crash accessing partitioned table and sql_mode
# contains ONLY_FULL_GROUP_BY
# Bug#46923: select count(*) from partitioned table fails with
# ONLY_FULL_GROUP_BY
#
SET SESSION SQL_MODE='ONLY_FULL_GROUP_BY';
CREATE TABLE t1(id INT,KEY(id)) ENGINE=MYISAM
PARTITION BY HASH(id) PARTITIONS 2;
SELECT COUNT(*) FROM t1;
COUNT(*)
0
DROP TABLE t1;
SET SESSION SQL_MODE=DEFAULT;
#
...
...
mysql-test/t/partition.test
View file @
f6ec131f
...
...
@@ -14,6 +14,15 @@
drop
table
if
exists
t1
,
t2
;
--
enable_warnings
#
# Bug#48276: can't add column if subpartition exists
CREATE
TABLE
t1
(
a
INT
,
b
INT
)
PARTITION
BY
LIST
(
a
)
SUBPARTITION
BY
HASH
(
b
)
(
PARTITION
p1
VALUES
IN
(
1
));
ALTER
TABLE
t1
ADD
COLUMN
c
INT
;
DROP
TABLE
t1
;
#
# Bug#46639: 1030 (HY000): Got error 124 from storage engine on
# INSERT ... SELECT ...
...
...
@@ -61,6 +70,17 @@ SELECT * FROM t1;
SHOW
CREATE
TABLE
t1
;
DROP
TABLE
t1
;
#
# Bug#45904: Error when CHARSET=utf8 and subpartitioning
#
create
table
t1
(
a
int
NOT
NULL
,
b
varchar
(
5
)
NOT
NULL
)
default
charset
=
utf8
partition
by
list
(
a
)
subpartition
by
key
(
b
)
(
partition
p0
values
in
(
1
),
partition
p1
values
in
(
2
));
drop
table
t1
;
#
# Bug#44059: rec_per_key on empty partition gives weird optimiser results
#
...
...
@@ -2031,11 +2051,14 @@ DROP TABLE t1;
--
echo
#
--
echo
# Bug #45807: crash accessing partitioned table and sql_mode
--
echo
# contains ONLY_FULL_GROUP_BY
--
echo
# Bug#46923: select count(*) from partitioned table fails with
--
echo
# ONLY_FULL_GROUP_BY
--
echo
#
SET
SESSION
SQL_MODE
=
'ONLY_FULL_GROUP_BY'
;
CREATE
TABLE
t1
(
id
INT
,
KEY
(
id
))
ENGINE
=
MYISAM
PARTITION
BY
HASH
(
id
)
PARTITIONS
2
;
SELECT
COUNT
(
*
)
FROM
t1
;
DROP
TABLE
t1
;
SET
SESSION
SQL_MODE
=
DEFAULT
;
...
...
sql/sql_partition.cc
View file @
f6ec131f
...
...
@@ -196,26 +196,27 @@ bool partition_default_handling(TABLE *table, partition_info *part_info,
{
DBUG_ENTER
(
"partition_default_handling"
);
if
(
part_info
->
use_default_no_partitions
)
if
(
!
is_create_table_ind
)
{
if
(
!
is_create_table_ind
&&
table
->
file
->
get_no_parts
(
normalized_path
,
&
part_info
->
no_parts
))
if
(
part_info
->
use_default_no_partitions
)
{
DBUG_RETURN
(
TRUE
);
if
(
table
->
file
->
get_no_parts
(
normalized_path
,
&
part_info
->
no_parts
))
{
DBUG_RETURN
(
TRUE
);
}
}
}
else
if
(
part_info
->
is_sub_partitioned
()
&&
part_info
->
use_default_no_subpartitions
)
{
uint
no_parts
;
if
(
!
is_create_table_ind
&&
(
table
->
file
->
get_no_parts
(
normalized_path
,
&
no_parts
)))
else
if
(
part_info
->
is_sub_partitioned
()
&&
part_info
->
use_default_no_subpartitions
)
{
DBUG_RETURN
(
TRUE
);
uint
no_parts
;
if
(
table
->
file
->
get_no_parts
(
normalized_path
,
&
no_parts
))
{
DBUG_RETURN
(
TRUE
);
}
DBUG_ASSERT
(
part_info
->
no_parts
>
0
);
DBUG_ASSERT
((
no_parts
%
part_info
->
no_parts
)
==
0
);
part_info
->
no_subparts
=
no_parts
/
part_info
->
no_parts
;
}
DBUG_ASSERT
(
part_info
->
no_parts
>
0
);
part_info
->
no_subparts
=
no_parts
/
part_info
->
no_parts
;
DBUG_ASSERT
((
no_parts
%
part_info
->
no_parts
)
==
0
);
}
part_info
->
set_up_defaults_for_partitioning
(
table
->
file
,
(
ulonglong
)
0
,
(
uint
)
0
);
...
...
@@ -905,6 +906,8 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
char
*
db_name
;
char
db_name_string
[
FN_REFLEN
];
bool
save_use_only_table_context
;
uint8
saved_full_group_by_flag
;
nesting_map
saved_allow_sum_func
;
DBUG_ENTER
(
"fix_fields_part_func"
);
if
(
part_info
->
fixed
)
...
...
@@ -974,9 +977,19 @@ bool fix_fields_part_func(THD *thd, Item* func_expr, TABLE *table,
save_use_only_table_context
=
thd
->
lex
->
use_only_table_context
;
thd
->
lex
->
use_only_table_context
=
TRUE
;
thd
->
lex
->
current_select
->
cur_pos_in_select_list
=
UNDEF_POS
;
saved_full_group_by_flag
=
thd
->
lex
->
current_select
->
full_group_by_flag
;
saved_allow_sum_func
=
thd
->
lex
->
allow_sum_func
;
thd
->
lex
->
allow_sum_func
=
0
;
error
=
func_expr
->
fix_fields
(
thd
,
(
Item
**
)
&
func_expr
);
/*
Restore full_group_by_flag and allow_sum_func,
fix_fields should not affect mysql_select later, see Bug#46923.
*/
thd
->
lex
->
current_select
->
full_group_by_flag
=
saved_full_group_by_flag
;
thd
->
lex
->
allow_sum_func
=
saved_allow_sum_func
;
thd
->
lex
->
use_only_table_context
=
save_use_only_table_context
;
context
->
table_list
=
save_table_list
;
...
...
@@ -1679,7 +1692,7 @@ bool fix_partition_func(THD *thd, TABLE *table,
if
(((
part_info
->
part_type
!=
HASH_PARTITION
||
part_info
->
list_of_part_fields
==
FALSE
)
&&
check_part_func_fields
(
part_info
->
part_field_array
,
TRUE
))
||
(
part_info
->
list_of_part_fields
==
FALSE
&&
(
part_info
->
list_of_
sub
part_fields
==
FALSE
&&
part_info
->
is_sub_partitioned
()
&&
check_part_func_fields
(
part_info
->
subpart_field_array
,
TRUE
)))
{
...
...
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