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
386d5047
Commit
386d5047
authored
Sep 21, 2010
by
Ingo Struewing
Browse files
Options
Browse Files
Download
Plain Diff
Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
Merge from saved bundle.
parents
6baf9d5a
50b9d086
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
119 additions
and
3 deletions
+119
-3
mysql-test/r/merge.result
mysql-test/r/merge.result
+41
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+78
-0
sql/sql_table.cc
sql/sql_table.cc
+0
-3
No files found.
mysql-test/r/merge.result
View file @
386d5047
...
...
@@ -2298,4 +2298,45 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
DROP TABLE t2, t1;
#
# Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
#
DROP TABLE IF EXISTS m1, t1;
CREATE TABLE t1 (c1 INT) ENGINE=MYISAM;
CREATE TABLE m1 (c1 INT) ENGINE=MRG_MyISAM UNION=(t1) INSERT_METHOD=LAST;
LOCK TABLE m1 READ;
REPAIR TABLE m1 USE_FRM;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
UNLOCK TABLES;
REPAIR TABLE m1 USE_FRM;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
DROP TABLE m1,t1;
CREATE TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
REPAIR TABLE m1 USE_FRM;
Table Op Msg_type Msg_text
test.m1 repair Error Can't open table
test.m1 repair error Corrupt
CREATE TABLE t1 (f1 BIGINT) ENGINE = MyISAM;
REPAIR TABLE m1 USE_FRM;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
REPAIR TABLE m1;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
DROP TABLE m1, t1;
CREATE TEMPORARY TABLE m1 (f1 BIGINT) ENGINE=MRG_MyISAM UNION(t1);
REPAIR TABLE m1 USE_FRM;
Table Op Msg_type Msg_text
test.m1 repair Error Table 'test.m1' doesn't exist
test.m1 repair error Corrupt
CREATE TEMPORARY TABLE t1 (f1 BIGINT) ENGINE=MyISAM;
REPAIR TABLE m1 USE_FRM;
Table Op Msg_type Msg_text
m1 repair error Cannot repair temporary table from .frm file
REPAIR TABLE m1;
Table Op Msg_type Msg_text
test.m1 repair note The storage engine for the table doesn't support repair
DROP TABLE m1, t1;
End of 5.1 tests
mysql-test/t/merge.test
View file @
386d5047
...
...
@@ -1705,4 +1705,82 @@ t2 WHERE b SOUNDS LIKE e AND d = 1;
DROP
TABLE
t2
,
t1
;
--
echo
#
--
echo
# Bug#46339 - crash on REPAIR TABLE merge table USE_FRM
--
echo
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
m1
,
t1
;
--
enable_warnings
#
# Test derived from a proposal of Shane Bester.
#
CREATE
TABLE
t1
(
c1
INT
)
ENGINE
=
MYISAM
;
CREATE
TABLE
m1
(
c1
INT
)
ENGINE
=
MRG_MyISAM
UNION
=
(
t1
)
INSERT_METHOD
=
LAST
;
#
# REPAIR ... USE_FRM with LOCK TABLES.
#
LOCK
TABLE
m1
READ
;
REPAIR
TABLE
m1
USE_FRM
;
UNLOCK
TABLES
;
#
# REPAIR ... USE_FRM without LOCK TABLES.
#
# This statement crashed the server (Bug#46339).
#
REPAIR
TABLE
m1
USE_FRM
;
#
DROP
TABLE
m1
,
t1
;
#
# Test derived from a proposal of Matthias Leich.
#
# Base table is missing.
#
CREATE
TABLE
m1
(
f1
BIGINT
)
ENGINE
=
MRG_MyISAM
UNION
(
t1
);
#
# This statement crashed the server (Bug#46339).
#
REPAIR
TABLE
m1
USE_FRM
;
#
# Create base table.
#
CREATE
TABLE
t1
(
f1
BIGINT
)
ENGINE
=
MyISAM
;
#
# This statement crashed the server (Bug#46339).
#
REPAIR
TABLE
m1
USE_FRM
;
#
# Normal repair as reference.
#
REPAIR
TABLE
m1
;
#
# Cleanup.
#
DROP
TABLE
m1
,
t1
;
#
# Same with temporary tables.
#
# Base table is missing.
#
CREATE
TEMPORARY
TABLE
m1
(
f1
BIGINT
)
ENGINE
=
MRG_MyISAM
UNION
(
t1
);
#
# This statement crashed the server (Bug#46339).
#
REPAIR
TABLE
m1
USE_FRM
;
#
# Create base table.
#
CREATE
TEMPORARY
TABLE
t1
(
f1
BIGINT
)
ENGINE
=
MyISAM
;
#
# This statement crashed the server (Bug#46339).
#
REPAIR
TABLE
m1
USE_FRM
;
#
# Normal repair as reference.
#
REPAIR
TABLE
m1
;
#
# Cleanup.
#
DROP
TABLE
m1
,
t1
;
--
echo
End
of
5.1
tests
sql/sql_table.cc
View file @
386d5047
...
...
@@ -4416,9 +4416,6 @@ static int prepare_for_repair(THD *thd, TABLE_LIST *table_list,
pthread_mutex_unlock
(
&
LOCK_open
);
}
/* A MERGE table must not come here. */
DBUG_ASSERT
(
!
table
->
child_l
);
/*
REPAIR TABLE ... USE_FRM for temporary tables makes little sense.
*/
...
...
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