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
ba678eef
Commit
ba678eef
authored
Feb 05, 2010
by
Konstantin Osipov
Browse files
Options
Browse Files
Download
Plain Diff
Merge next-4284 -> next-4284-merge.
parents
dad4caa9
82f44941
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
3 deletions
+56
-3
mysql-test/include/handler.inc
mysql-test/include/handler.inc
+22
-0
mysql-test/r/handler_innodb.result
mysql-test/r/handler_innodb.result
+12
-0
mysql-test/r/handler_myisam.result
mysql-test/r/handler_myisam.result
+12
-0
sql/sql_handler.cc
sql/sql_handler.cc
+10
-3
No files found.
mysql-test/include/handler.inc
View file @
ba678eef
...
...
@@ -1500,3 +1500,25 @@ connection default;
handler
no_such_table
read
no_such_index
first
;
--
error
ER_UNKNOWN_TABLE
handler
no_such_table
close
;
--
echo
#
--
echo
# Bug#50907 Assertion `hash_tables->table->next == __null' on
--
echo
# HANDLER OPEN
--
echo
#
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
enable_warnings
CREATE
TEMPORARY
TABLE
t1
(
i
INT
);
CREATE
TEMPORARY
TABLE
t2
(
i
INT
);
# This used to trigger the assert
HANDLER
t2
OPEN
;
# This also used to trigger the assert
HANDLER
t2
READ
FIRST
;
HANDLER
t2
CLOSE
;
DROP
TABLE
t1
,
t2
;
mysql-test/r/handler_innodb.result
View file @
ba678eef
...
...
@@ -1464,3 +1464,15 @@ handler no_such_table read no_such_index first;
ERROR 42S02: Unknown table 'no_such_table' in HANDLER
handler no_such_table close;
ERROR 42S02: Unknown table 'no_such_table' in HANDLER
#
# Bug#50907 Assertion `hash_tables->table->next == __null' on
# HANDLER OPEN
#
DROP TABLE IF EXISTS t1, t2;
CREATE TEMPORARY TABLE t1 (i INT);
CREATE TEMPORARY TABLE t2 (i INT);
HANDLER t2 OPEN;
HANDLER t2 READ FIRST;
i
HANDLER t2 CLOSE;
DROP TABLE t1, t2;
mysql-test/r/handler_myisam.result
View file @
ba678eef
...
...
@@ -1462,6 +1462,18 @@ ERROR 42S02: Unknown table 'no_such_table' in HANDLER
handler no_such_table close;
ERROR 42S02: Unknown table 'no_such_table' in HANDLER
#
# Bug#50907 Assertion `hash_tables->table->next == __null' on
# HANDLER OPEN
#
DROP TABLE IF EXISTS t1, t2;
CREATE TEMPORARY TABLE t1 (i INT);
CREATE TEMPORARY TABLE t2 (i INT);
HANDLER t2 OPEN;
HANDLER t2 READ FIRST;
i
HANDLER t2 CLOSE;
DROP TABLE t1, t2;
#
# BUG #46456: HANDLER OPEN + TRUNCATE + DROP (temporary) TABLE, crash
#
CREATE TABLE t1 AS SELECT 1 AS f1;
...
...
sql/sql_handler.cc
View file @
ba678eef
...
...
@@ -322,8 +322,14 @@ bool mysql_ha_open(THD *thd, TABLE_LIST *tables, bool reopen)
thd
->
mdl_context
.
set_needs_thr_lock_abort
(
TRUE
);
}
/* Assert that the above check prevent opening of views and merge tables. */
DBUG_ASSERT
(
hash_tables
->
table
->
next
==
NULL
);
/*
Assert that the above check prevents opening of views and merge tables.
For temporary tables, TABLE::next can be set even if only one table
was opened for HANDLER as it is used to link them together
(see thd->temporary_tables).
*/
DBUG_ASSERT
(
hash_tables
->
table
->
next
==
NULL
||
hash_tables
->
table
->
s
->
tmp_table
);
/*
If it's a temp table, don't reset table->query_id as the table is
being used by this handler. Otherwise, no meaning at all.
...
...
@@ -485,7 +491,8 @@ retry:
/* save open_tables state */
backup_open_tables
=
thd
->
open_tables
;
/* Always a one-element list, see mysql_ha_open(). */
DBUG_ASSERT
(
hash_tables
->
table
->
next
==
NULL
);
DBUG_ASSERT
(
hash_tables
->
table
->
next
==
NULL
||
hash_tables
->
table
->
s
->
tmp_table
);
/*
mysql_lock_tables() needs thd->open_tables to be set correctly to
be able to handle aborts properly.
...
...
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