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
772bd60a
Commit
772bd60a
authored
Jan 26, 2013
by
Michael Widenius
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge
parents
672b2938
ea1d5943
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
0 deletions
+29
-0
mysql-test/suite/maria/truncate.result
mysql-test/suite/maria/truncate.result
+12
-0
mysql-test/suite/maria/truncate.test
mysql-test/suite/maria/truncate.test
+13
-0
sql/sql_truncate.cc
sql/sql_truncate.cc
+1
-0
storage/maria/ha_maria.cc
storage/maria/ha_maria.cc
+3
-0
No files found.
mysql-test/suite/maria/truncate.result
View file @
772bd60a
...
@@ -35,3 +35,15 @@ select count(*) from t1;
...
@@ -35,3 +35,15 @@ select count(*) from t1;
count(*)
count(*)
0
0
drop table t1,t2;
drop table t1,t2;
CREATE TEMPORARY TABLE t1 ( i int) ENGINE=aria;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TEMPORARY TABLE `t1` (
`i` int(11) DEFAULT NULL
) ENGINE=Aria DEFAULT CHARSET=latin1 PAGE_CHECKSUM=0
TRUNCATE TABLE t1;
INSERT INTO t1 (i) VALUES (1);
lock table t1 write;
truncate table t1;
unlock tables;
drop table t1;
mysql-test/suite/maria/truncate.test
View file @
772bd60a
...
@@ -45,3 +45,16 @@ select * from t1;
...
@@ -45,3 +45,16 @@ select * from t1;
truncate
t1
;
truncate
t1
;
select
count
(
*
)
from
t1
;
select
count
(
*
)
from
t1
;
drop
table
t1
,
t2
;
drop
table
t1
,
t2
;
#
# MDEV-3890
# Server crash inserting record on a temporary table after truncating it
#
CREATE
TEMPORARY
TABLE
t1
(
i
int
)
ENGINE
=
aria
;
SHOW
CREATE
TABLE
t1
;
TRUNCATE
TABLE
t1
;
INSERT
INTO
t1
(
i
)
VALUES
(
1
);
lock
table
t1
write
;
truncate
table
t1
;
unlock
tables
;
drop
table
t1
;
sql/sql_truncate.cc
View file @
772bd60a
...
@@ -263,6 +263,7 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
...
@@ -263,6 +263,7 @@ static bool recreate_temporary_table(THD *thd, TABLE *table)
DBUG_ENTER
(
"recreate_temporary_table"
);
DBUG_ENTER
(
"recreate_temporary_table"
);
memset
(
&
create_info
,
0
,
sizeof
(
create_info
));
memset
(
&
create_info
,
0
,
sizeof
(
create_info
));
create_info
.
options
|=
HA_LEX_CREATE_TMP_TABLE
;
table
->
file
->
info
(
HA_STATUS_AUTO
|
HA_STATUS_NO_LOCK
);
table
->
file
->
info
(
HA_STATUS_AUTO
|
HA_STATUS_NO_LOCK
);
...
...
storage/maria/ha_maria.cc
View file @
772bd60a
...
@@ -3042,7 +3042,10 @@ int ha_maria::create(const char *name, register TABLE *table_arg,
...
@@ -3042,7 +3042,10 @@ int ha_maria::create(const char *name, register TABLE *table_arg,
ha_create_info
->
transactional
!=
HA_CHOICE_NO
);
ha_create_info
->
transactional
!=
HA_CHOICE_NO
);
if
(
ha_create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
if
(
ha_create_info
->
options
&
HA_LEX_CREATE_TMP_TABLE
)
{
create_flags
|=
HA_CREATE_TMP_TABLE
;
create_flags
|=
HA_CREATE_TMP_TABLE
;
create_info
.
transactional
=
0
;
}
if
(
ha_create_info
->
options
&
HA_CREATE_KEEP_FILES
)
if
(
ha_create_info
->
options
&
HA_CREATE_KEEP_FILES
)
create_flags
|=
HA_CREATE_KEEP_FILES
;
create_flags
|=
HA_CREATE_KEEP_FILES
;
if
(
options
&
HA_OPTION_PACK_RECORD
)
if
(
options
&
HA_OPTION_PACK_RECORD
)
...
...
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