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
a6df8abf
Commit
a6df8abf
authored
Aug 16, 2006
by
mikael/pappa@dator5.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge dator5.(none):/home/pappa/bug21143
into dator5.(none):/home/pappa/bug21388
parents
8d8b2b38
79ab9cef
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
11 deletions
+38
-11
mysql-test/r/partition_mgm.result
mysql-test/r/partition_mgm.result
+10
-0
mysql-test/t/partition_mgm.test
mysql-test/t/partition_mgm.test
+17
-0
sql/ha_partition.cc
sql/ha_partition.cc
+2
-4
sql/sql_partition.cc
sql/sql_partition.cc
+9
-7
No files found.
mysql-test/r/partition_mgm.result
View file @
a6df8abf
DROP TABLE IF EXISTS t1;
create table t1 (a int)
partition by range (a)
subpartition by key (a)
(partition p0 values less than (10) (subpartition sp00, subpartition sp01),
partition p1 values less than (20) (subpartition sp10, subpartition sp11));
alter table t1 reorganize partition p0 into
(partition p0 values less than (10) (subpartition sp00,
subpartition sp01, subpartition sp02));
ERROR HY000: Wrong number of subpartitions defined, mismatch with previous setting
drop table t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
SHOW CREATE TABLE t1;
...
...
mysql-test/t/partition_mgm.test
View file @
a6df8abf
...
...
@@ -2,6 +2,23 @@
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
#
# Bug 21143: mysqld hang when error in number of subparts in
# REORGANIZE command
#
create
table
t1
(
a
int
)
partition
by
range
(
a
)
subpartition
by
key
(
a
)
(
partition
p0
values
less
than
(
10
)
(
subpartition
sp00
,
subpartition
sp01
),
partition
p1
values
less
than
(
20
)
(
subpartition
sp10
,
subpartition
sp11
));
--
error
ER_PARTITION_WRONG_NO_SUBPART_ERROR
alter
table
t1
reorganize
partition
p0
into
(
partition
p0
values
less
than
(
10
)
(
subpartition
sp00
,
subpartition
sp01
,
subpartition
sp02
));
drop
table
t1
;
CREATE
TABLE
t1
(
f_date
DATE
,
f_varchar
VARCHAR
(
30
))
PARTITION
BY
HASH
(
CAST
(
YEAR
(
f_date
)
AS
SIGNED
INTEGER
))
PARTITIONS
2
;
SHOW
CREATE
TABLE
t1
;
...
...
sql/ha_partition.cc
View file @
a6df8abf
...
...
@@ -5155,13 +5155,12 @@ void ha_partition::print_error(int error, myf errflag)
DBUG_ENTER
(
"ha_partition::print_error"
);
/* Should probably look for my own errors first */
/* monty: needs to be called for the last used partition ! */
DBUG_PRINT
(
"enter"
,
(
"error: %d"
,
error
));
if
(
error
==
HA_ERR_NO_PARTITION_FOUND
)
m_part_info
->
print_no_partition_found
(
table
);
else
m_file
[
0
]
->
print_error
(
error
,
errflag
);
m_file
[
m_last_part
]
->
print_error
(
error
,
errflag
);
DBUG_VOID_RETURN
;
}
...
...
@@ -5171,8 +5170,7 @@ bool ha_partition::get_error_message(int error, String *buf)
DBUG_ENTER
(
"ha_partition::get_error_message"
);
/* Should probably look for my own errors first */
/* monty: needs to be called for the last used partition ! */
DBUG_RETURN
(
m_file
[
0
]
->
get_error_message
(
error
,
buf
));
DBUG_RETURN
(
m_file
[
m_last_part
]
->
get_error_message
(
error
,
buf
));
}
...
...
sql/sql_partition.cc
View file @
a6df8abf
...
...
@@ -3474,14 +3474,9 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
}
table
->
part_info
=
part_info
;
table
->
file
->
set_part_info
(
part_info
);
if
(
part_info
->
default_engine_type
==
NULL
)
{
if
(
!
part_info
->
default_engine_type
)
part_info
->
default_engine_type
=
default_db_type
;
}
else
{
DBUG_ASSERT
(
part_info
->
default_engine_type
==
default_db_type
);
}
part_info
->
item_free_list
=
thd
->
free_list
;
{
...
...
@@ -4395,6 +4390,13 @@ state of p1.
my_error
(
ER_REORG_HASH_ONLY_ON_SAME_NO
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
if
(
tab_part_info
->
is_sub_partitioned
()
&&
alt_part_info
->
no_subparts
&&
alt_part_info
->
no_subparts
!=
tab_part_info
->
no_subparts
)
{
my_error
(
ER_PARTITION_WRONG_NO_SUBPART_ERROR
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
check_total_partitions
=
tab_part_info
->
no_parts
+
no_parts_new
;
check_total_partitions
-=
no_parts_reorged
;
if
(
check_total_partitions
>
MAX_PARTITIONS
)
...
...
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