summaryrefslogtreecommitdiff
path: root/mysql-test/suite/innodb_fts/t/innodb_fts_result_cache_limit.test
blob: 1ec37532a71d9ce88b6b5301e4051bcc530d77ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# This is a basic test for innodb fts result cache limit.

-- source include/have_innodb.inc

# Must have debug code to use SET SESSION debug
--source include/have_debug.inc
--source include/maybe_versioning.inc

# Create FTS table
CREATE TABLE t1 (
        id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
        a VARCHAR(200),
        b TEXT
        ) ENGINE= InnoDB;

# Create the FTS index again
CREATE FULLTEXT INDEX idx on t1 (a,b);

# Insert rows
INSERT INTO t1 (a,b) VALUES
        ('MySQL from Tutorial','DBMS stands for DataBase ...')  ,
        ('when To Use MySQL Well','After that you went through a ...'),
        ('where will Optimizing MySQL','what In this tutorial we will show ...'),
        ('MySQL from Tutorial','DBMS stands for DataBase ...')  ,
        ('when To Use MySQL Well','After that you went through a ...'),
        ('where will Optimizing MySQL','what In this tutorial we will show ...'),
        ('MySQL from Tutorial','DBMS stands for DataBase ...')  ,
        ('when To Use MySQL Well','After that you went through a ...'),
        ('where will Optimizing MySQL','what In this tutorial we will show ...');

SET @saved_debug_dbug = @@SESSION.debug_dbug;
SET SESSION debug_dbug="+d,fts_instrument_result_cache_limit";

# Simple term search
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('mysql' IN BOOLEAN MODE);

# Query expansion
--error 128
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('mysql' WITH QUERY EXPANSION);

# Simple phrase search
--error 128
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database"' IN BOOLEAN MODE);

# Simple proximity search
--error 128
SELECT COUNT(*) FROM t1 WHERE MATCH (a,b) AGAINST ('"mysql database" @ 5' IN BOOLEAN MODE);

SET SESSION debug_dbug=@saved_debug_dbug;

DROP TABLE t1;

SET GLOBAL innodb_ft_result_cache_limit=default;