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
ae171f1e
Commit
ae171f1e
authored
May 21, 2010
by
Mattias Jonsson
Browse files
Options
Browse Files
Download
Plain Diff
merge into mysql-5.1-bugteam
parents
836bb54c
a58331b1
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
8 deletions
+40
-8
mysql-test/r/partition_error.result
mysql-test/r/partition_error.result
+8
-0
mysql-test/t/partition_error.test
mysql-test/t/partition_error.test
+9
-0
sql/ha_partition.cc
sql/ha_partition.cc
+10
-1
sql/sql_table.cc
sql/sql_table.cc
+13
-7
No files found.
mysql-test/r/partition_error.result
View file @
ae171f1e
drop table if exists t1;
drop table if exists t1;
#
#
# Bug#49477: Assertion `0' failed in ha_partition.cc:5530
# with temporary table and partitions
#
CREATE TABLE t1 (a INT) PARTITION BY HASH(a);
CREATE TEMPORARY TABLE tmp_t1 LIKE t1;
ERROR HY000: Cannot create temporary table with partitions
DROP TABLE t1;
#
# Bug#50392: insert_id is not reset for partitioned tables
# Bug#50392: insert_id is not reset for partitioned tables
# auto_increment on duplicate entry
# auto_increment on duplicate entry
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY);
...
...
mysql-test/t/partition_error.test
View file @
ae171f1e
...
@@ -8,6 +8,15 @@
...
@@ -8,6 +8,15 @@
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
--
enable_warnings
--
enable_warnings
--
echo
#
--
echo
# Bug#49477: Assertion `0' failed in ha_partition.cc:5530
--
echo
# with temporary table and partitions
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
PARTITION
BY
HASH
(
a
);
--
error
ER_PARTITION_NO_TEMPORARY
CREATE
TEMPORARY
TABLE
tmp_t1
LIKE
t1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
#
--
echo
# Bug#50392: insert_id is not reset for partitioned tables
--
echo
# Bug#50392: insert_id is not reset for partitioned tables
--
echo
# auto_increment on duplicate entry
--
echo
# auto_increment on duplicate entry
...
...
sql/ha_partition.cc
View file @
ae171f1e
...
@@ -88,7 +88,9 @@ static int partition_initialize(void *p)
...
@@ -88,7 +88,9 @@ static int partition_initialize(void *p)
partition_hton
->
create
=
partition_create_handler
;
partition_hton
->
create
=
partition_create_handler
;
partition_hton
->
partition_flags
=
partition_flags
;
partition_hton
->
partition_flags
=
partition_flags
;
partition_hton
->
alter_table_flags
=
alter_table_flags
;
partition_hton
->
alter_table_flags
=
alter_table_flags
;
partition_hton
->
flags
=
HTON_NOT_USER_SELECTABLE
|
HTON_HIDDEN
;
partition_hton
->
flags
=
HTON_NOT_USER_SELECTABLE
|
HTON_HIDDEN
|
HTON_TEMPORARY_NOT_SUPPORTED
;
return
0
;
return
0
;
}
}
...
@@ -1837,6 +1839,13 @@ uint ha_partition::del_ren_cre_table(const char *from,
...
@@ -1837,6 +1839,13 @@ uint ha_partition::del_ren_cre_table(const char *from,
handler
**
file
,
**
abort_file
;
handler
**
file
,
**
abort_file
;
DBUG_ENTER
(
"del_ren_cre_table()"
);
DBUG_ENTER
(
"del_ren_cre_table()"
);
/* Not allowed to create temporary partitioned tables */
if
(
create_info
&&
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
{
my_error
(
ER_PARTITION_NO_TEMPORARY
,
MYF
(
0
));
DBUG_RETURN
(
TRUE
);
}
if
(
get_from_handler_file
(
from
,
ha_thd
()
->
mem_root
))
if
(
get_from_handler_file
(
from
,
ha_thd
()
->
mem_root
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
DBUG_ASSERT
(
m_file_buffer
);
DBUG_ASSERT
(
m_file_buffer
);
...
...
sql/sql_table.cc
View file @
ae171f1e
...
@@ -5288,6 +5288,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
...
@@ -5288,6 +5288,11 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
*/
*/
if
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
if
(
create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
{
{
if
(
src_table
->
table
->
file
->
ht
==
partition_hton
)
{
my_error
(
ER_PARTITION_NO_TEMPORARY
,
MYF
(
0
));
goto
err
;
}
if
(
find_temporary_table
(
thd
,
db
,
table_name
))
if
(
find_temporary_table
(
thd
,
db
,
table_name
))
goto
table_exists
;
goto
table_exists
;
dst_path_length
=
build_tmptable_filename
(
thd
,
dst_path
,
sizeof
(
dst_path
));
dst_path_length
=
build_tmptable_filename
(
thd
,
dst_path
,
sizeof
(
dst_path
));
...
@@ -5352,14 +5357,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
...
@@ -5352,14 +5357,15 @@ bool mysql_create_like_table(THD* thd, TABLE_LIST* table, TABLE_LIST* src_table,
/*
/*
For partitioned tables we need to copy the .par file as well since
For partitioned tables we need to copy the .par file as well since
it is used in open_table_def to even be able to create a new handler.
it is used in open_table_def to even be able to create a new handler.
There is no way to find out here if the original table is a
partitioned table so we copy the file and ignore any errors.
*/
*/
if
(
src_table
->
table
->
file
->
ht
==
partition_hton
)
{
fn_format
(
tmp_path
,
dst_path
,
reg_ext
,
".par"
,
MYF
(
MY_REPLACE_EXT
));
fn_format
(
tmp_path
,
dst_path
,
reg_ext
,
".par"
,
MYF
(
MY_REPLACE_EXT
));
strmov
(
dst_path
,
tmp_path
);
strmov
(
dst_path
,
tmp_path
);
fn_format
(
tmp_path
,
src_path
,
reg_ext
,
".par"
,
MYF
(
MY_REPLACE_EXT
));
fn_format
(
tmp_path
,
src_path
,
reg_ext
,
".par"
,
MYF
(
MY_REPLACE_EXT
));
strmov
(
src_path
,
tmp_path
);
strmov
(
src_path
,
tmp_path
);
my_copy
(
src_path
,
dst_path
,
MYF
(
MY_DONT_OVERWRITE_FILE
));
my_copy
(
src_path
,
dst_path
,
MYF
(
MY_DONT_OVERWRITE_FILE
));
}
#endif
#endif
DBUG_EXECUTE_IF
(
"sleep_create_like_before_ha_create"
,
my_sleep
(
6000000
););
DBUG_EXECUTE_IF
(
"sleep_create_like_before_ha_create"
,
my_sleep
(
6000000
););
...
...
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