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
b4f104c9
Commit
b4f104c9
authored
Oct 26, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust the innodb_fts.sync and innodb_fts.sync_block tests for MariaDB
parent
41362887
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
80 additions
and
53 deletions
+80
-53
mysql-test/suite/innodb_fts/r/sync.result
mysql-test/suite/innodb_fts/r/sync.result
+31
-20
mysql-test/suite/innodb_fts/r/sync_block.result
mysql-test/suite/innodb_fts/r/sync_block.result
+23
-7
mysql-test/suite/innodb_fts/t/sync.opt
mysql-test/suite/innodb_fts/t/sync.opt
+2
-0
mysql-test/suite/innodb_fts/t/sync.test
mysql-test/suite/innodb_fts/t/sync.test
+18
-19
mysql-test/suite/innodb_fts/t/sync_block.test
mysql-test/suite/innodb_fts/t/sync_block.test
+6
-7
No files found.
mysql-test/suite/innodb_fts/r/sync.result
View file @
b4f104c9
connect con1,localhost,root,,;
connection default;
# Case 1: Test select and insert(row in both disk and cache)
CREATE TABLE t1 (
FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
...
...
@@ -6,9 +8,12 @@ FULLTEXT(title)
) ENGINE = InnoDB;
INSERT INTO t1(title) VALUES('mysql');
INSERT INTO t1(title) VALUES('database');
SET SESSION debug="+d,fts_instrument_sync_debug";
connection con1;
SET @old_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,fts_instrument_sync_debug';
SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR selected';
INSERT INTO t1(title) VALUES('mysql database');
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR written';
SET GLOBAL innodb_ft_aux_table="test/t1";
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
...
...
@@ -25,8 +30,8 @@ FTS_DOC_ID title
1 mysql
2 database
SET DEBUG_SYNC= 'now SIGNAL selected';
/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database')
;
SET
SESSION debug="-d,fts_instrument_sync_debug"
;
connection con1
;
SET
@old_dbug = @@SESSION.debug_dbug
;
SET GLOBAL innodb_ft_aux_table="test/t1";
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
...
...
@@ -42,6 +47,7 @@ FTS_DOC_ID title
3 mysql database
1 mysql
2 database
connection default;
DROP TABLE t1;
# Case 2: Test insert and insert(sync)
CREATE TABLE t1 (
...
...
@@ -51,14 +57,16 @@ FULLTEXT(title)
) ENGINE = InnoDB;
INSERT INTO t1(title) VALUES('mysql');
INSERT INTO t1(title) VALUES('database');
SET SESSION debug="+d,fts_instrument_sync_debug";
connection con1;
SET debug_dbug = '+d,fts_instrument_sync_debug';
SET DEBUG_SYNC= 'fts_write_node SIGNAL written WAIT_FOR inserted';
INSERT INTO t1(title) VALUES('mysql database');
connection default;
SET DEBUG_SYNC= 'now WAIT_FOR written';
INSERT INTO t1(title) VALUES('mysql database');
SET DEBUG_SYNC= 'now SIGNAL inserted';
/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database')
;
SET
SESSION debug="-d,fts_instrument_sync_debug"
;
connection con1
;
SET
debug_dbug = @old_dbug
;
SET GLOBAL innodb_ft_aux_table="test/t1";
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
...
...
@@ -77,6 +85,8 @@ FTS_DOC_ID title
4 mysql database
1 mysql
2 database
connection default;
disconnect con1;
DROP TABLE t1;
# Case 3: Test insert crash recovery
CREATE TABLE t1 (
...
...
@@ -85,17 +95,17 @@ title VARCHAR(200),
FULLTEXT(title)
) ENGINE = InnoDB;
INSERT INTO t1(title) VALUES('database');
SET
SESSION debug="+d,fts_instrument_sync_debug,fts_write_node_crash"
;
SET
debug_dbug = '+d,fts_instrument_sync_debug,fts_write_node_crash'
;
INSERT INTO t1(title) VALUES('mysql');
ERROR HY000: Lost connection to MySQL server during query
# restart
After restart
SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
FTS_DOC_ID title
1 database
SET SESSION debug="+d,fts_instrument_sync_debug";
SET @old_dbug = @@SESSION.debug_dbug;
SET debug_dbug = '+d,fts_instrument_sync_debug';
INSERT INTO t1(title) VALUES('mysql');
SET
SESSION debug="-d,fts_instrument_sync_debug"
;
SET
debug_dbug = @old_dbug
;
SELECT * FROM t1 WHERE MATCH(title) AGAINST ('mysql database');
FTS_DOC_ID title
1 database
...
...
@@ -107,22 +117,23 @@ id INT AUTO_INCREMENT,
title VARCHAR(100),
FULLTEXT(title),
PRIMARY KEY(id)) ENGINE=InnoDB;
SET
SESSION debug="+d,fts_instrument_sync"
;
SET
debug_dbug = '+d,fts_instrument_sync'
;
INSERT INTO t1(title) VALUES('mysql');
SET SESSION debug="-d,fts_instrument_sync";
# restart
SET GLOBAL debug="+d,fts_instrument_sync,fts_instrument_sync_interrupted";
SET debug_dbug = @old_dbug;
SET @old_global_dbug = @@GLOBAL.debug_dbug;
SET @old_dbug = @@SESSION.debug_dbug;
SET GLOBAL debug_dbug='+d,fts_instrument_sync,fts_instrument_sync_interrupted';
INSERT INTO t1(title) VALUES('database');
SET GLOBAL debug
="-d,fts_instrument_sync,fts_instrument_sync_interrupted"
;
SET
SESSION debug="+d,fts_instrument_sync_debug"
;
SET GLOBAL debug
_dbug = @old_global_dbug
;
SET
debug_dbug = '+d,fts_instrument_sync_debug'
;
INSERT INTO t1(title) VALUES('good');
SET
SESSION debug="-d,fts_instrument_sync_debug"
;
SET
debug_dbug = @old_dbug
;
SET GLOBAL innodb_ft_aux_table="test/t1";
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_TABLE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
database
4 4 1 4
0
good
5 5 1 5
0
mysql
2 2 1 2
0
database
2 2 1 2
0
good
3 3 1 3
0
mysql
1 1 1 1
0
SELECT * FROM INFORMATION_SCHEMA.INNODB_FT_INDEX_CACHE;
WORD FIRST_DOC_ID LAST_DOC_ID DOC_COUNT DOC_ID POSITION
SET GLOBAL innodb_ft_aux_table=default;
...
...
mysql-test/suite/innodb_fts/r/sync_block.result
View file @
b4f104c9
...
...
@@ -2,27 +2,35 @@ SET @old_log_output = @@global.log_output;
SET @old_slow_query_log = @@global.slow_query_log;
SET @old_general_log = @@global.general_log;
SET @old_long_query_time = @@global.long_query_time;
SET @old_
binlog_order_commits = @@global.binlog_order_commits
;
SET @old_
debug = @@global.debug_dbug
;
SET GLOBAL log_output = 'TABLE';
SET GLOBAL general_log = 1;
SET GLOBAL slow_query_log = 1;
SET GLOBAL long_query_time = 1;
SET GLOBAL binlog_order_commits = 1;
connect con1,localhost,root,,;
connect con2,localhost,root,,;
connection default;
# Case 1: Sync blocks DML(insert) on the same table.
CREATE TABLE t1 (
FTS_DOC_ID BIGINT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
FULLTEXT(title)
) ENGINE = InnoDB;
SET GLOBAL debug="+d,fts_instrument_sync_debug,fts_instrument_sync_sleep";
connection con1;
SET GLOBAL debug_dbug='+d,fts_instrument_sync_debug,fts_instrument_sync_sleep';
SET DEBUG_SYNC= 'fts_sync_begin SIGNAL begin WAIT_FOR continue';
INSERT INTO t1(title) VALUES('mysql database');
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR begin';
SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
connection default;
SET DEBUG_SYNC= 'now SIGNAL continue';
connection con1;
/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
connection con2;
/* conneciton con2 */ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
FTS_DOC_ID title
connection default;
# make con1 & con2 show up in mysql.slow_log
SELECT SLEEP(2);
SLEEP(2)
...
...
@@ -31,7 +39,7 @@ SLEEP(2)
SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
sql_text
INSERT INTO t1(title) VALUES('mysql database')
SET GLOBAL debug
="-d,fts_instrument_sync_debug,fts_instrument_sync_sleep"
;
SET GLOBAL debug
_dbug = @old_debug_dbug
;
TRUNCATE TABLE mysql.slow_log;
DROP TABLE t1;
# Case 2: Sync blocks DML(insert) on other tables.
...
...
@@ -41,14 +49,21 @@ title VARCHAR(200),
FULLTEXT(title)
) ENGINE = InnoDB;
CREATE TABLE t2(id INT);
SET GLOBAL debug="+d,fts_instrument_sync_request,fts_instrument_sync_sleep";
connection con1;
SET GLOBAL debug_dbug='+d,fts_instrument_sync_request,fts_instrument_sync_sleep';
SET DEBUG_SYNC= 'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue';
INSERT INTO t1(title) VALUES('mysql database');
connection con2;
SET DEBUG_SYNC= 'now WAIT_FOR begin';
INSERT INTO t2 VALUES(1);
connection default;
SET DEBUG_SYNC= 'now SIGNAL continue';
connection con1;
/* connection con1 */ INSERT INTO t1(title) VALUES('mysql database');
connection con2;
/* conneciton con2 */ INSERT INTO t2 VALUES(1);
connection default;
SET DEBUG_SYNC = 'RESET';
# make con1 & con2 show up in mysql.slow_log
SELECT SLEEP(2);
SLEEP(2)
...
...
@@ -56,12 +71,13 @@ SLEEP(2)
# slow log results should be empty here.
SELECT sql_text FROM mysql.slow_log WHERE query_time >= '00:00:02';
sql_text
SET GLOBAL debug
="-d,fts_instrument_sync_request,fts_instrument_sync_sleep"
;
SET GLOBAL debug
_dbug = @old_debug_dbug
;
TRUNCATE TABLE mysql.slow_log;
DROP TABLE t1,t2;
disconnect con1;
disconnect con2;
# Restore slow log settings.
SET GLOBAL log_output = @old_log_output;
SET GLOBAL general_log = @old_general_log;
SET GLOBAL slow_query_log = @old_slow_query_log;
SET GLOBAL long_query_time = @old_long_query_time;
SET GLOBAL binlog_order_commits = @old_binlog_order_commits;
mysql-test/suite/innodb_fts/t/sync.opt
0 → 100644
View file @
b4f104c9
--innodb-ft-index-cache
--innodb-ft-index-table
mysql-test/suite/innodb_fts/t/sync.test
View file @
b4f104c9
...
...
@@ -7,8 +7,6 @@
--
source
include
/
not_valgrind
.
inc
--
source
include
/
not_embedded
.
inc
--
source
include
/
not_crashrep
.
inc
--
source
include
/
not_log_bin
.
inc
--
source
include
/
count_sessions
.
inc
connect
(
con1
,
localhost
,
root
,,);
connection
default
;
...
...
@@ -25,7 +23,8 @@ INSERT INTO t1(title) VALUES('database');
connection
con1
;
SET
SESSION
debug
=
"+d,fts_instrument_sync_debug"
;
SET
@
old_dbug
=
@@
SESSION
.
debug_dbug
;
SET
debug_dbug
=
'+d,fts_instrument_sync_debug'
;
SET
DEBUG_SYNC
=
'fts_write_node SIGNAL written WAIT_FOR selected'
;
...
...
@@ -45,10 +44,9 @@ SELECT * FROM t1 WHERE MATCH(title) AGAINST('mysql database');
SET
DEBUG_SYNC
=
'now SIGNAL selected'
;
connection
con1
;
--
echo
/* connection con1 */
INSERT
INTO
t1
(
title
)
VALUES
(
'mysql database'
);
--
reap
SET
SESSION
debug
=
"-d,fts_instrument_sync_debug"
;
SET
@
old_dbug
=
@@
SESSION
.
debug_dbug
;
SET
GLOBAL
innodb_ft_aux_table
=
"test/t1"
;
SELECT
*
FROM
INFORMATION_SCHEMA
.
INNODB_FT_INDEX_CACHE
;
...
...
@@ -73,7 +71,7 @@ INSERT INTO t1(title) VALUES('database');
connection
con1
;
SET
SESSION
debug
=
"+d,fts_instrument_sync_debug"
;
SET
debug_dbug
=
'+d,fts_instrument_sync_debug'
;
SET
DEBUG_SYNC
=
'fts_write_node SIGNAL written WAIT_FOR inserted'
;
...
...
@@ -88,10 +86,9 @@ INSERT INTO t1(title) VALUES('mysql database');
SET
DEBUG_SYNC
=
'now SIGNAL inserted'
;
connection
con1
;
--
echo
/* connection con1 */
INSERT
INTO
t1
(
title
)
VALUES
(
'mysql database'
);
--
reap
SET
SESSION
debug
=
"-d,fts_instrument_sync_debug"
;
SET
debug_dbug
=
@
old_dbug
;
SET
GLOBAL
innodb_ft_aux_table
=
"test/t1"
;
SELECT
*
FROM
INFORMATION_SCHEMA
.
INNODB_FT_INDEX_CACHE
;
...
...
@@ -118,7 +115,7 @@ INSERT INTO t1(title) VALUES('database');
--
exec
echo
"restart"
>
$MYSQLTEST_VARDIR
/
tmp
/
mysqld
.
1.
expect
SET
SESSION
debug
=
"+d,fts_instrument_sync_debug,fts_write_node_crash"
;
SET
debug_dbug
=
'+d,fts_instrument_sync_debug,fts_write_node_crash'
;
--
error
2013
INSERT
INTO
t1
(
title
)
VALUES
(
'mysql'
);
...
...
@@ -128,11 +125,13 @@ INSERT INTO t1(title) VALUES('mysql');
--
echo
After
restart
SELECT
*
FROM
t1
WHERE
MATCH
(
title
)
AGAINST
(
'mysql database'
);
SET
SESSION
debug
=
"+d,fts_instrument_sync_debug"
;
SET
@
old_dbug
=
@@
SESSION
.
debug_dbug
;
SET
debug_dbug
=
'+d,fts_instrument_sync_debug'
;
INSERT
INTO
t1
(
title
)
VALUES
(
'mysql'
);
SET
SESSION
debug
=
"-d,fts_instrument_sync_debug"
;
SET
debug_dbug
=
@
old_dbug
;
SELECT
*
FROM
t1
WHERE
MATCH
(
title
)
AGAINST
(
'mysql database'
);
...
...
@@ -145,19 +144,21 @@ CREATE TABLE t1(
FULLTEXT
(
title
),
PRIMARY
KEY
(
id
))
ENGINE
=
InnoDB
;
SET
SESSION
debug
=
"+d,fts_instrument_sync"
;
SET
debug_dbug
=
'+d,fts_instrument_sync'
;
INSERT
INTO
t1
(
title
)
VALUES
(
'mysql'
);
SET
SESSION
debug
=
"-d,fts_instrument_sync"
;
SET
debug_dbug
=
@
old_dbug
;
--
source
include
/
restart_mysqld
.
inc
SET
GLOBAL
debug
=
"+d,fts_instrument_sync,fts_instrument_sync_interrupted"
;
SET
@
old_global_dbug
=
@@
GLOBAL
.
debug_dbug
;
SET
@
old_dbug
=
@@
SESSION
.
debug_dbug
;
SET
GLOBAL
debug_dbug
=
'+d,fts_instrument_sync,fts_instrument_sync_interrupted'
;
INSERT
INTO
t1
(
title
)
VALUES
(
'database'
);
SET
GLOBAL
debug
=
"-d,fts_instrument_sync,fts_instrument_sync_interrupted"
;
SET
GLOBAL
debug
_dbug
=
@
old_global_dbug
;
SET
SESSION
debug
=
"+d,fts_instrument_sync_debug"
;
SET
debug_dbug
=
'+d,fts_instrument_sync_debug'
;
INSERT
INTO
t1
(
title
)
VALUES
(
'good'
);
SET
SESSION
debug
=
"-d,fts_instrument_sync_debug"
;
SET
debug_dbug
=
@
old_dbug
;
SET
GLOBAL
innodb_ft_aux_table
=
"test/t1"
;
SELECT
*
FROM
INFORMATION_SCHEMA
.
INNODB_FT_INDEX_TABLE
;
...
...
@@ -167,5 +168,3 @@ SET GLOBAL innodb_ft_aux_table=default;
SELECT
*
FROM
t1
WHERE
MATCH
(
title
)
AGAINST
(
'mysql database good'
);
DROP
TABLE
t1
;
--
source
include
/
wait_until_count_sessions
.
inc
mysql-test/suite/innodb_fts/t/sync_block.test
View file @
b4f104c9
...
...
@@ -12,13 +12,12 @@ SET @old_log_output = @@global.log_output;
SET
@
old_slow_query_log
=
@@
global
.
slow_query_log
;
SET
@
old_general_log
=
@@
global
.
general_log
;
SET
@
old_long_query_time
=
@@
global
.
long_query_time
;
SET
@
old_
binlog_order_commits
=
@@
global
.
binlog_order_commits
;
SET
@
old_
debug
=
@@
global
.
debug_dbug
;
SET
GLOBAL
log_output
=
'TABLE'
;
SET
GLOBAL
general_log
=
1
;
SET
GLOBAL
slow_query_log
=
1
;
SET
GLOBAL
long_query_time
=
1
;
SET
GLOBAL
binlog_order_commits
=
1
;
connect
(
con1
,
localhost
,
root
,,);
connect
(
con2
,
localhost
,
root
,,);
...
...
@@ -33,7 +32,7 @@ CREATE TABLE t1 (
connection
con1
;
SET
GLOBAL
debug
=
"+d,fts_instrument_sync_debug,fts_instrument_sync_sleep"
;
SET
GLOBAL
debug
_dbug
=
'+d,fts_instrument_sync_debug,fts_instrument_sync_sleep'
;
SET
DEBUG_SYNC
=
'fts_sync_begin SIGNAL begin WAIT_FOR continue'
;
...
...
@@ -62,7 +61,7 @@ SELECT SLEEP(2);
--
echo
# slow log results should only contain INSERT INTO t1.
SELECT
sql_text
FROM
mysql
.
slow_log
WHERE
query_time
>=
'00:00:02'
;
SET
GLOBAL
debug
=
"-d,fts_instrument_sync_debug,fts_instrument_sync_sleep"
;
SET
GLOBAL
debug
_dbug
=
@
old_debug_dbug
;
TRUNCATE
TABLE
mysql
.
slow_log
;
DROP
TABLE
t1
;
...
...
@@ -78,7 +77,7 @@ CREATE TABLE t2(id INT);
connection
con1
;
SET
GLOBAL
debug
=
"+d,fts_instrument_sync_request,fts_instrument_sync_sleep"
;
SET
GLOBAL
debug
_dbug
=
'+d,fts_instrument_sync_request,fts_instrument_sync_sleep'
;
SET
DEBUG_SYNC
=
'fts_instrument_sync_request SIGNAL begin WAIT_FOR continue'
;
...
...
@@ -102,12 +101,13 @@ connection con2;
--
reap
connection
default
;
SET
DEBUG_SYNC
=
'RESET'
;
--
echo
# make con1 & con2 show up in mysql.slow_log
SELECT
SLEEP
(
2
);
--
echo
# slow log results should be empty here.
SELECT
sql_text
FROM
mysql
.
slow_log
WHERE
query_time
>=
'00:00:02'
;
SET
GLOBAL
debug
=
"-d,fts_instrument_sync_request,fts_instrument_sync_sleep"
;
SET
GLOBAL
debug
_dbug
=
@
old_debug_dbug
;
TRUNCATE
TABLE
mysql
.
slow_log
;
DROP
TABLE
t1
,
t2
;
...
...
@@ -122,4 +122,3 @@ SET GLOBAL log_output = @old_log_output;
SET
GLOBAL
general_log
=
@
old_general_log
;
SET
GLOBAL
slow_query_log
=
@
old_slow_query_log
;
SET
GLOBAL
long_query_time
=
@
old_long_query_time
;
SET
GLOBAL
binlog_order_commits
=
@
old_binlog_order_commits
;
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