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
a68742f4
Commit
a68742f4
authored
Mar 20, 2006
by
holyfoot@vva.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug #17290 (sp with delete, create and rollback causes MySQLD core)
additional fixes
parent
87a4e300
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
73 additions
and
7 deletions
+73
-7
mysql-test/r/partition.result
mysql-test/r/partition.result
+25
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+30
-0
sql/sql_parse.cc
sql/sql_parse.cc
+10
-0
sql/sql_partition.cc
sql/sql_partition.cc
+4
-2
sql/sql_table.cc
sql/sql_table.cc
+4
-5
No files found.
mysql-test/r/partition.result
View file @
a68742f4
...
...
@@ -557,4 +557,29 @@ t2 CREATE TABLE `t2` (
PRIMARY KEY (`a`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' PARTITION BY KEY (a)
drop table t2;
prepare stmt1 from 'create table t1 (s1 int) partition by hash (s1)';
execute stmt1;
execute stmt1;
ERROR 42S01: Table 't1' already exists
drop table t1;
CREATE PROCEDURE test.p1(IN i INT)
BEGIN
DECLARE CONTINUE HANDLER FOR sqlexception BEGIN END;
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (num INT,PRIMARY KEY(num));
START TRANSACTION;
INSERT INTO t1 VALUES(i);
savepoint t1_save;
INSERT INTO t1 VALUES (14);
ROLLBACK to savepoint t1_save;
COMMIT;
END|
CALL test.p1(12);
Warnings:
Note 1051 Unknown table 't1'
Warning 1196 Some non-transactional changed tables couldn't be rolled back
CALL test.p1(13);
Warnings:
Warning 1196 Some non-transactional changed tables couldn't be rolled back
drop table t1;
End of 5.1 tests
mysql-test/t/partition.test
View file @
a68742f4
...
...
@@ -714,4 +714,34 @@ show create table t2;
drop
table
t2
;
#
# bug #14350 Partitions: crash if prepared statement
#
prepare
stmt1
from
'create table t1 (s1 int) partition by hash (s1)'
;
execute
stmt1
;
--
error
1050
execute
stmt1
;
drop
table
t1
;
#
# bug 17290 SP with delete, create and rollback to save point causes MySQLD core
#
delimiter
|
;
eval
CREATE
PROCEDURE
test
.
p1
(
IN
i
INT
)
BEGIN
DECLARE
CONTINUE
HANDLER
FOR
sqlexception
BEGIN
END
;
DROP
TABLE
IF
EXISTS
t1
;
CREATE
TABLE
t1
(
num
INT
,
PRIMARY
KEY
(
num
));
START
TRANSACTION
;
INSERT
INTO
t1
VALUES
(
i
);
savepoint
t1_save
;
INSERT
INTO
t1
VALUES
(
14
);
ROLLBACK
to
savepoint
t1_save
;
COMMIT
;
END
|
delimiter
;
|
CALL
test
.
p1
(
12
);
CALL
test
.
p1
(
13
);
drop
table
t1
;
--
echo
End
of
5.1
tests
sql/sql_parse.cc
View file @
a68742f4
...
...
@@ -2357,6 +2357,7 @@ mysql_execute_command(THD *thd)
/* Saved variable value */
DBUG_ENTER
(
"mysql_execute_command"
);
thd
->
net
.
no_send_error
=
0
;
thd
->
work_part_info
=
0
;
/*
In many cases first table of main SELECT_LEX have special meaning =>
...
...
@@ -2902,6 +2903,15 @@ mysql_execute_command(THD *thd)
lex
->
like_name
);
else
{
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info
*
part_info
=
thd
->
lex
->
part_info
;
if
(
part_info
&&
!
(
part_info
=
thd
->
lex
->
part_info
->
get_clone
()))
{
res
=
-
1
;
goto
end_with_restore_list
;
}
thd
->
work_part_info
=
part_info
;
#endif
res
=
mysql_create_table
(
thd
,
create_table
->
db
,
create_table
->
table_name
,
&
lex
->
create_info
,
lex
->
create_list
,
...
...
sql/sql_partition.cc
View file @
a68742f4
...
...
@@ -3760,7 +3760,7 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf,
}
}
else
part_info
=
old_lex
->
part_info
;
part_info
=
thd
->
work_
part_info
;
}
table
->
part_info
=
part_info
;
table
->
file
->
set_part_info
(
part_info
);
...
...
@@ -4077,7 +4077,9 @@ uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
if
(
table
->
part_info
)
table
->
s
->
version
=
0L
;
if
(
!
(
thd
->
work_part_info
=
thd
->
lex
->
part_info
->
get_clone
()))
thd
->
work_part_info
=
thd
->
lex
->
part_info
;
if
(
thd
->
work_part_info
&&
!
(
thd
->
work_part_info
=
thd
->
lex
->
part_info
->
get_clone
()))
DBUG_RETURN
(
TRUE
);
if
(
alter_info
->
flags
&
...
...
sql/sql_table.cc
View file @
a68742f4
...
...
@@ -2037,10 +2037,8 @@ bool mysql_create_table_internal(THD *thd,
DBUG_RETURN
(
TRUE
);
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info
*
part_info
;
if
(
!
(
part_info
=
thd
->
lex
->
part_info
->
get_clone
()))
DBUG_RETURN
(
TRUE
);
thd
->
work_part_info
=
part_info
;
partition_info
*
part_info
=
thd
->
work_part_info
;
if
(
!
part_info
&&
create_info
->
db_type
->
partition_flags
&&
(
create_info
->
db_type
->
partition_flags
()
&
HA_USE_AUTO_PARTITION
))
{
...
...
@@ -2089,7 +2087,8 @@ bool mysql_create_table_internal(THD *thd,
goto
err
;
}
}
if
(
part_engine_type
==
&
partition_hton
)
if
((
part_engine_type
==
&
partition_hton
)
&&
part_info
->
default_engine_type
)
{
/*
This only happens at ALTER TABLE.
...
...
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