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
765cc53c
Commit
765cc53c
authored
Apr 30, 2009
by
Sergey Glukhov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
5d41d821
f74e3ee5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
93 additions
and
91 deletions
+93
-91
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+0
-39
mysql-test/r/myisam_debug.result
mysql-test/r/myisam_debug.result
+39
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+0
-52
mysql-test/t/myisam_debug.test
mysql-test/t/myisam_debug.test
+54
-0
No files found.
mysql-test/r/myisam.result
View file @
765cc53c
...
...
@@ -2252,43 +2252,4 @@ h+0 d + 0 e g + 0
1 1 3 0
1 1 4 0
DROP TABLE t1;
#
# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
#
CREATE TABLE `t1` (
`id`
BIGINT(20) ,
`id1`
BIGINT(20) AUTO_INCREMENT,
KEY(id1), KEY(id)
)
ENGINE=MyISAM;
CREATE TABLE `t2` (
`id`
BIGINT(20) ,
`id1`
BIGINT(20) AUTO_INCREMENT,
KEY (id1), KEY(id)
)
ENGINE=MyISAM;
INSERT INTO t2 (id) VALUES (123);
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
#
Switch to insert Connection
SET SESSION debug='+d,wait_in_enable_indexes';
#
Send insert data
INSERT INTO t1(id) SELECT id FROM t2;
#
Switch to default Connection
#
Wait for insert data to reach the debug point
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_in_enable_indexes' AND
INFO = "INSERT INTO t1(id) SELECT id FROM t2"
INTO @thread_id;
KILL QUERY @thread_id;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1,t2;
End of 5.1 tests
mysql-test/r/myisam_debug.result
0 → 100644
View file @
765cc53c
#
# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
#
CREATE TABLE `t1` (
`id` BIGINT(20) ,
`id1` BIGINT(20) AUTO_INCREMENT,
KEY(id1), KEY(id)
) ENGINE=MyISAM;
CREATE TABLE `t2` (
`id` BIGINT(20) ,
`id1` BIGINT(20) AUTO_INCREMENT,
KEY (id1), KEY(id)
) ENGINE=MyISAM;
INSERT INTO t2 (id) VALUES (123);
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
INSERT INTO t2 (id) SELECT id FROM t2;
# Switch to insert Connection
SET SESSION debug='+d,wait_in_enable_indexes';
# Send insert data
INSERT INTO t1(id) SELECT id FROM t2;
# Switch to default Connection
# Wait for insert data to reach the debug point
SELECT ID FROM INFORMATION_SCHEMA.PROCESSLIST
WHERE STATE = 'wait_in_enable_indexes' AND
INFO = "INSERT INTO t1(id) SELECT id FROM t2"
INTO @thread_id;
KILL QUERY @thread_id;
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
DROP TABLE t1,t2;
mysql-test/t/myisam.test
View file @
765cc53c
...
...
@@ -1503,57 +1503,5 @@ SELECT h+0, d + 0, e, g + 0 FROM t1;
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
--
echo
#
CONNECT
(
insertConn
,
localhost
,
root
,,);
CREATE
TABLE
`t1`
(
`id`
BIGINT
(
20
)
,
`id1`
BIGINT
(
20
)
AUTO_INCREMENT
,
KEY
(
id1
),
KEY
(
id
)
)
ENGINE
=
MyISAM
;
CREATE
TABLE
`t2`
(
`id`
BIGINT
(
20
)
,
`id1`
BIGINT
(
20
)
AUTO_INCREMENT
,
KEY
(
id1
),
KEY
(
id
)
)
ENGINE
=
MyISAM
;
INSERT
INTO
t2
(
id
)
VALUES
(
123
);
let
$i
=
10
;
while
(
$i
)
{
INSERT
INTO
t2
(
id
)
SELECT
id
FROM
t2
;
dec
$i
;
}
--
echo
# Switch to insert Connection
CONNECTION
insertConn
;
SET
SESSION
debug
=
'+d,wait_in_enable_indexes'
;
--
echo
# Send insert data
SEND
INSERT
INTO
t1
(
id
)
SELECT
id
FROM
t2
;
--
echo
# Switch to default Connection
CONNECTION
default
;
--
echo
# Wait for insert data to reach the debug point
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
STATE
=
"wait_in_enable_indexes"
AND
INFO
=
"INSERT INTO t1(id) SELECT id FROM t2"
;
--
source
include
/
wait_condition
.
inc
SELECT
ID
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
STATE
=
'wait_in_enable_indexes'
AND
INFO
=
"INSERT INTO t1(id) SELECT id FROM t2"
INTO
@
thread_id
;
KILL
QUERY
@
thread_id
;
CHECK
TABLE
t1
;
DROP
TABLE
t1
,
t2
;
DISCONNECT
insertConn
;
--
echo
End
of
5.1
tests
mysql-test/t/myisam_debug.test
0 → 100644
View file @
765cc53c
--
source
include
/
have_debug
.
inc
--
echo
#
--
echo
# BUG#40827 - Killing insert-select to MyISAM can cause table corruption
--
echo
#
CONNECT
(
insertConn
,
localhost
,
root
,,);
CREATE
TABLE
`t1`
(
`id`
BIGINT
(
20
)
,
`id1`
BIGINT
(
20
)
AUTO_INCREMENT
,
KEY
(
id1
),
KEY
(
id
)
)
ENGINE
=
MyISAM
;
CREATE
TABLE
`t2`
(
`id`
BIGINT
(
20
)
,
`id1`
BIGINT
(
20
)
AUTO_INCREMENT
,
KEY
(
id1
),
KEY
(
id
)
)
ENGINE
=
MyISAM
;
INSERT
INTO
t2
(
id
)
VALUES
(
123
);
let
$i
=
10
;
while
(
$i
)
{
INSERT
INTO
t2
(
id
)
SELECT
id
FROM
t2
;
dec
$i
;
}
--
echo
# Switch to insert Connection
CONNECTION
insertConn
;
SET
SESSION
debug
=
'+d,wait_in_enable_indexes'
;
--
echo
# Send insert data
SEND
INSERT
INTO
t1
(
id
)
SELECT
id
FROM
t2
;
--
echo
# Switch to default Connection
CONNECTION
default
;
--
echo
# Wait for insert data to reach the debug point
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
STATE
=
"wait_in_enable_indexes"
AND
INFO
=
"INSERT INTO t1(id) SELECT id FROM t2"
;
--
source
include
/
wait_condition
.
inc
SELECT
ID
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
STATE
=
'wait_in_enable_indexes'
AND
INFO
=
"INSERT INTO t1(id) SELECT id FROM t2"
INTO
@
thread_id
;
KILL
QUERY
@
thread_id
;
CHECK
TABLE
t1
;
DROP
TABLE
t1
,
t2
;
DISCONNECT
insertConn
;
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