| 1 |
# |
| 2 |
# BUG#27082268 FTS synchronization issues |
| 3 |
# |
| 4 |
|
| 5 |
--source include/have_innodb.inc |
| 6 |
--source include/have_debug.inc |
| 7 |
--source include/maybe_versioning.inc |
| 8 |
|
| 9 |
#-------------------------------------- |
| 10 |
# Check FTS_sync vs TRUNCATE (1) |
| 11 |
#-------------------------------------- |
| 12 |
|
| 13 |
CREATE TABLE t1 ( |
| 14 |
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, |
| 15 |
value VARCHAR(1024) |
| 16 |
) ENGINE=InnoDB; |
| 17 |
|
| 18 |
CREATE FULLTEXT INDEX idx1 ON t1(value); |
| 19 |
|
| 20 |
SET @save_debug = @@GLOBAL.debug_dbug; |
| 21 |
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_sync_before_syncing,ib_trunc_sleep_before_fts_cache_clear'; |
| 22 |
|
| 23 |
INSERT INTO t1 (value) VALUES |
| 24 |
('By default or with the IN NATURAL LANGUAGE MODE modifier') |
| 25 |
; |
| 26 |
|
| 27 |
let $vers=$MTR_COMBINATION_VERS+$MTR_COMBINATION_VERS_TRX; |
| 28 |
|
| 29 |
if ($vers) |
| 30 |
{ |
| 31 |
--echo TRUNCATE TABLE t1; |
| 32 |
} |
| 33 |
if (!$vers) |
| 34 |
{ |
| 35 |
TRUNCATE TABLE t1; |
| 36 |
} |
| 37 |
|
| 38 |
DROP TABLE t1; |
| 39 |
|
| 40 |
SET GLOBAL debug_dbug = @save_debug; |
| 41 |
|
| 42 |
#-------------------------------------- |
| 43 |
# Check FTS sync vs DROP INDEX (2) |
| 44 |
#-------------------------------------- |
| 45 |
|
| 46 |
CREATE TABLE t1 ( |
| 47 |
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY, |
| 48 |
value VARCHAR(1024) |
| 49 |
) ENGINE=InnoDB; |
| 50 |
|
| 51 |
CREATE FULLTEXT INDEX idx1 ON t1(value); |
| 52 |
|
| 53 |
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_write_words_before_select_index,ib_trunc_sleep_before_fts_cache_clear'; |
| 54 |
|
| 55 |
INSERT INTO t1 (value) VALUES |
| 56 |
('By default or with the IN NATURAL LANGUAGE MODE modifier'), |
| 57 |
('performs a natural language search for a string'), |
| 58 |
('collection is a set of one or more columns included'), |
| 59 |
('returns a relevance value; that is, a similarity measure'), |
| 60 |
('and the text in that row in the columns named in'), |
| 61 |
('By default, the search is performed in case-insensitive'), |
| 62 |
('sensitive full-text search, use a binary collation '), |
| 63 |
('example, a column that uses the latin1 character'), |
| 64 |
('collation of latin1_bin to make it case sensitive') |
| 65 |
; |
| 66 |
|
| 67 |
if ($vers) |
| 68 |
{ |
| 69 |
--echo TRUNCATE TABLE t1; |
| 70 |
} |
| 71 |
if (!$vers) |
| 72 |
{ |
| 73 |
TRUNCATE TABLE t1; |
| 74 |
} |
| 75 |
|
| 76 |
DROP TABLE t1; |
| 77 |
|
| 78 |
SET GLOBAL debug_dbug = @save_debug; |
| 79 |
|
| 80 |
#-------------------------------------- |
| 81 |
# Check FTS sync vs DROP INDEX |
| 82 |
#-------------------------------------- |
| 83 |
|
| 84 |
CREATE TABLE t1 ( |
| 85 |
value VARCHAR(1024) |
| 86 |
) ENGINE=InnoDB; |
| 87 |
|
| 88 |
CREATE FULLTEXT INDEX idx1 ON t1(value); |
| 89 |
|
| 90 |
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep'; |
| 91 |
|
| 92 |
INSERT INTO t1 (value) VALUES |
| 93 |
('By default or with the IN NATURAL LANGUAGE MODE modifier'), |
| 94 |
('performs a natural language search for a string'), |
| 95 |
('collection is a set of one or more columns included'), |
| 96 |
('returns a relevance value; that is, a similarity measure'), |
| 97 |
('and the text in that row in the columns named in'), |
| 98 |
('By default, the search is performed in case-insensitive'), |
| 99 |
('sensitive full-text search, use a binary collation '), |
| 100 |
('example, a column that uses the latin1 character'), |
| 101 |
('collation of latin1_bin to make it case sensitive') |
| 102 |
; |
| 103 |
|
| 104 |
DROP INDEX idx1 ON t1; |
| 105 |
|
| 106 |
DROP TABLE t1; |
| 107 |
|
| 108 |
SET GLOBAL debug_dbug = @save_debug; |
| 109 |
|
| 110 |
#-------------------------------------- |
| 111 |
# Check FTS sync vs ALTER TABLE DROP INDEX (INPLACE) |
| 112 |
#-------------------------------------- |
| 113 |
|
| 114 |
CREATE TABLE t1 ( |
| 115 |
value VARCHAR(1024) |
| 116 |
) ENGINE=InnoDB; |
| 117 |
|
| 118 |
CREATE FULLTEXT INDEX idx1 ON t1(value); |
| 119 |
|
| 120 |
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep'; |
| 121 |
|
| 122 |
INSERT INTO t1 (value) VALUES |
| 123 |
('By default or with the IN NATURAL LANGUAGE MODE modifier'), |
| 124 |
('performs a natural language search for a string'), |
| 125 |
('collection is a set of one or more columns included'), |
| 126 |
('returns a relevance value; that is, a similarity measure'), |
| 127 |
('and the text in that row in the columns named in'), |
| 128 |
('By default, the search is performed in case-insensitive'), |
| 129 |
('sensitive full-text search, use a binary collation '), |
| 130 |
('example, a column that uses the latin1 character'), |
| 131 |
('collation of latin1_bin to make it case sensitive') |
| 132 |
; |
| 133 |
|
| 134 |
ALTER TABLE t1 |
| 135 |
DROP INDEX idx1, |
| 136 |
ALGORITHM=INPLACE; |
| 137 |
|
| 138 |
DROP TABLE t1; |
| 139 |
|
| 140 |
SET GLOBAL debug_dbug = @save_debug; |
| 141 |
|
| 142 |
#-------------------------------------- |
| 143 |
# Check FTS sync vs ALTER TABLE DROP INDEX (COPY) |
| 144 |
#-------------------------------------- |
| 145 |
|
| 146 |
CREATE TABLE t1 ( |
| 147 |
value VARCHAR(1024) |
| 148 |
) ENGINE=InnoDB; |
| 149 |
|
| 150 |
CREATE FULLTEXT INDEX idx1 ON t1(value); |
| 151 |
|
| 152 |
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep'; |
| 153 |
|
| 154 |
INSERT INTO t1 (value) VALUES |
| 155 |
('example, a column that uses the latin1 character'), |
| 156 |
('collation of latin1_bin to make it case sensitive') |
| 157 |
; |
| 158 |
|
| 159 |
ALTER TABLE t1 |
| 160 |
DROP INDEX idx1, |
| 161 |
ALGORITHM=COPY; |
| 162 |
|
| 163 |
DROP TABLE t1; |
| 164 |
|
| 165 |
SET GLOBAL debug_dbug = @save_debug; |
| 166 |
|
| 167 |
#-------------------------------------- |
| 168 |
# Check FTS sync vs ALTER TABLE (INPLACE, new cluster) |
| 169 |
#-------------------------------------- |
| 170 |
|
| 171 |
CREATE TABLE t1 ( |
| 172 |
id1 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| 173 |
value VARCHAR(1024) |
| 174 |
) ENGINE=InnoDB; |
| 175 |
|
| 176 |
CREATE FULLTEXT INDEX idx1 ON t1(value); |
| 177 |
|
| 178 |
SET GLOBAL debug_dbug = '+d,fts_instrument_sync_request,fts_instrument_msg_sync_sleep'; |
| 179 |
|
| 180 |
INSERT INTO t1 (value) VALUES |
| 181 |
('example, a column that uses the latin1 character'), |
| 182 |
('collation of latin1_bin to make it case sensitive') |
| 183 |
; |
| 184 |
|
| 185 |
--enable_info |
| 186 |
ALTER TABLE t1 |
| 187 |
DROP COLUMN id1, |
| 188 |
ADD COLUMN id2 INT NOT NULL AUTO_INCREMENT PRIMARY KEY, |
| 189 |
DROP INDEX idx1, |
| 190 |
ADD FULLTEXT INDEX idx2(value); |
| 191 |
--disable_info |
| 192 |
|
| 193 |
DROP TABLE t1; |
| 194 |
|
| 195 |
SET GLOBAL debug_dbug = @save_debug; |