1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

MDEV-29886 Assertion !index->table->is_temporary() failed in CHECK TABLE

ha_innobase::check(): Do not enable READ UNCOMMITTED isolation level
for temporary tables, because it would report index count mismatch
for secondary indexes.

row_check_index(): Ignore EXTENDED for temporary tables, because
the tables are private to the current connection and there will be
no purge of committed transaction history.
This commit is contained in:
Marko Mäkelä
2022-10-26 14:48:53 +03:00
parent 8b6a308e46
commit cf96db4f35
4 changed files with 29 additions and 0 deletions

View File

@ -775,3 +775,18 @@ INSERT INTO t VALUES (1);
START TRANSACTION READ ONLY;
UPDATE t SET a = NULL;
ROLLBACK;
DROP TABLE t;
#
# MDEV-29886 Assertion !index->table->is_temporary() failed
# in trx_undo_prev_version_build upon CHECK
#
CREATE TEMPORARY TABLE t (a INT, KEY(a)) ENGINE=InnoDB SELECT 1;
UPDATE t SET a=2;
CHECK TABLE t;
Table Op Msg_type Msg_text
test.t check status OK
CHECK TABLE t EXTENDED;
Table Op Msg_type Msg_text
test.t check status OK
DROP TEMPORARY TABLE t;
# End of 10.6 tests

View File

@ -613,3 +613,15 @@ INSERT INTO t VALUES (1);
START TRANSACTION READ ONLY;
UPDATE t SET a = NULL;
ROLLBACK;
DROP TABLE t;
--echo #
--echo # MDEV-29886 Assertion !index->table->is_temporary() failed
--echo # in trx_undo_prev_version_build upon CHECK
--echo #
CREATE TEMPORARY TABLE t (a INT, KEY(a)) ENGINE=InnoDB SELECT 1;
UPDATE t SET a=2;
CHECK TABLE t;
CHECK TABLE t EXTENDED;
DROP TEMPORARY TABLE t;
--echo # End of 10.6 tests

View File

@ -15220,6 +15220,7 @@ ha_innobase::check(
of records in some index; to play safe, we normally use
REPEATABLE READ here */
m_prebuilt->trx->isolation_level = high_level_read_only
&& !m_prebuilt->table->is_temporary()
? TRX_ISO_READ_UNCOMMITTED
: TRX_ISO_REPEATABLE_READ;

View File

@ -6228,6 +6228,7 @@ func_exit:
ReadView check_table_extended_view;
ReadView &view=
prebuilt->need_to_access_clustered &&
!prebuilt->table->is_temporary() &&
prebuilt->trx->isolation_level != TRX_ISO_READ_UNCOMMITTED
? check_table_extended_view : prebuilt->trx->read_view;
if (&view == &check_table_extended_view)