1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-30 11:22:14 +03:00
Files
mariadb/mysql-test/suite/innodb_fts/r/innodb_ft_aux_table.result
Marko Mäkelä 2647fd101d MDEV-19445 heap-use-after-free related to innodb_ft_aux_table
Try to fix the race conditions between
SET GLOBAL innodb_ft_aux_table = ...;
and access to the INFORMATION_SCHEMA tables that depend on
this variable.

innodb_ft_aux_table: Replaces
fts_internal_tbl_name,fts_internal_tbl_name2. Just store the
user-specified parameter as is.

innodb_ft_aux_table_id: The table_id corresponding to
SET GLOBAL innodb_ft_aux_table, or 0 if the table does not exist
or does not contain FULLTEXT INDEX. If the table is renamed later,
the INFORMATION_SCHEMA tables will continue to refer to the table.
If the table is dropped or rebuilt, the INFORMATION_SCHEMA tables
will not find the table.
2019-05-13 17:16:42 +03:00

117 lines
2.8 KiB
Plaintext

CREATE TABLE t1 (v VARCHAR(100), FULLTEXT INDEX (v)) ENGINE=InnoDB;
insert into t1 VALUES('First record'),('Second record'),('Third record');
SET @save_ft_aux_table = @@GLOBAL.innodb_ft_aux_table;
SET GLOBAL innodb_ft_aux_table = 'test/t0';
ERROR 42000: Variable 'innodb_ft_aux_table' can't be set to the value of 'test/t0'
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DEFAULT_STOPWORD;
value
a
about
an
are
as
at
be
by
com
de
en
for
from
how
i
in
is
it
la
of
on
or
that
the
this
to
was
what
when
where
who
will
with
und
the
www
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
SET GLOBAL innodb_ft_aux_table = 'test/t1';
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
first 1 1 1 1 0
record 1 3 3 1 6
record 1 3 3 2 7
record 1 3 3 3 6
second 2 2 1 2 0
third 3 3 1 3 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
optimize_checkpoint_limit 180
synced_doc_id 0
stopword_table_name
use_stopword 1
SELECT @@GLOBAL.innodb_ft_aux_table;
@@GLOBAL.innodb_ft_aux_table
test/t1
RENAME TABLE t1 TO t2;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
first 1 1 1 1 0
record 1 3 3 1 6
record 1 3 3 2 7
record 1 3 3 3 6
second 2 2 1 2 0
third 3 3 1 3 0
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
optimize_checkpoint_limit 180
synced_doc_id 0
stopword_table_name
use_stopword 1
SELECT @@GLOBAL.innodb_ft_aux_table;
@@GLOBAL.innodb_ft_aux_table
test/t1
DROP TABLE t2;
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_BEING_DELETED;
DOC_ID
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_CONFIG;
KEY VALUE
SELECT @@GLOBAL.innodb_ft_aux_table;
@@GLOBAL.innodb_ft_aux_table
test/t1
SET GLOBAL innodb_ft_aux_table = @save_ft_aux_table;