| 1 |
SET foreign_key_checks=0, unique_checks=0; |
| 2 |
# |
| 3 |
# MDEV-24715 Assertion !node->table->skip_alter_undo |
| 4 |
# |
| 5 |
CREATE TABLE t (a INT UNIQUE) ENGINE=InnoDB |
| 6 |
REPLACE SELECT 1 AS a, 2 AS b UNION SELECT 1 AS a, 3 AS c; |
| 7 |
SELECT * FROM t; |
| 8 |
a b |
| 9 |
1 3 |
| 10 |
DROP TABLE t; |
| 11 |
CREATE TEMPORARY TABLE t (a INT UNIQUE) ENGINE=InnoDB |
| 12 |
REPLACE SELECT 1 AS a, 2 AS b UNION SELECT 1 AS a, 3 AS c; |
| 13 |
SELECT * FROM t; |
| 14 |
a b |
| 15 |
1 3 |
| 16 |
DROP TEMPORARY TABLE t; |
| 17 |
# |
| 18 |
# MDEV-24720 AHI removal during bulk index rollback |
| 19 |
# |
| 20 |
SET @save_ahi = @@global.innodb_adaptive_hash_index; |
| 21 |
SET GLOBAL innodb_adaptive_hash_index = 1; |
| 22 |
SET @save_ahi_cells = @@global.innodb_adaptive_hash_index_cells; |
| 23 |
SET GLOBAL innodb_adaptive_hash_index_cells=1048576; |
| 24 |
CREATE TABLE t1(f1 INT NOT NULL)ENGINE=InnoDB; |
| 25 |
SET @old_bulk_op= |
| 26 |
(SELECT variable_value FROM information_schema.global_status |
| 27 |
WHERE variable_name = 'innodb_bulk_operations'); |
| 28 |
BEGIN; |
| 29 |
INSERT INTO t1 SELECT * FROM seq_1_to_65536; |
| 30 |
ROLLBACK; |
| 31 |
SELECT variable_value-@old_bulk_op bulk_operations |
| 32 |
FROM information_schema.global_status |
| 33 |
WHERE variable_name = 'innodb_bulk_operations'; |
| 34 |
bulk_operations |
| 35 |
1 |
| 36 |
CHECK TABLE t1; |
| 37 |
Table Op Msg_type Msg_text |
| 38 |
test.t1 check status OK |
| 39 |
# |
| 40 |
# MDEV-24832 Root page AHI Removal fails fails during |
| 41 |
# bulk index rollback |
| 42 |
# |
| 43 |
BEGIN; |
| 44 |
INSERT INTO t1 SELECT * FROM seq_1_to_500; |
| 45 |
ROLLBACK; |
| 46 |
DROP TABLE t1; |
| 47 |
SET GLOBAL innodb_adaptive_hash_index = @save_ahi; |
| 48 |
SET GLOBAL innodb_adaptive_hash_index_cells = @save_ahi_cells; |
| 49 |
# |
| 50 |
# MDEV-24951 Assertion m.first->second.valid(trx->undo_no) failed |
| 51 |
# in trx_undo_report_row_operation |
| 52 |
# |
| 53 |
CREATE TEMPORARY TABLE t (c INT) ENGINE=InnoDB; |
| 54 |
CREATE TEMPORARY TABLE t2 (c INT) ENGINE=InnoDB; |
| 55 |
SET transaction_read_only=1; |
| 56 |
BEGIN; |
| 57 |
INSERT INTO t2 VALUES(0); |
| 58 |
INSERT INTO t VALUES(0); |
| 59 |
ROLLBACK; |
| 60 |
BEGIN; |
| 61 |
INSERT INTO t2 VALUES(0); |
| 62 |
INSERT INTO t VALUES(0); |
| 63 |
COMMIT; |
| 64 |
INSERT INTO t VALUES(0); |
| 65 |
DROP TEMPORARY TABLE t,t2; |
| 66 |
ERROR 25006: Cannot execute statement in a READ ONLY transaction |
| 67 |
SET transaction_read_only=0; |
| 68 |
DROP TEMPORARY TABLE t,t2; |
| 69 |
# |
| 70 |
# MDEV-24818 Optimize multiple INSERT into empty table |
| 71 |
# |
| 72 |
CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=InnoDB; |
| 73 |
BEGIN; |
| 74 |
INSERT INTO t1 VALUES (5),(6),(7); |
| 75 |
INSERT INTO t1 VALUES (4),(5),(6); |
| 76 |
ERROR 23000: Duplicate entry '5' for key 'PRIMARY' |
| 77 |
COMMIT; |
| 78 |
SELECT * FROM t1; |
| 79 |
f1 |
| 80 |
BEGIN; |
| 81 |
INSERT INTO t1 VALUES (5),(6),(7); |
| 82 |
SAVEPOINT a; |
| 83 |
INSERT INTO t1 VALUES (4),(5),(6); |
| 84 |
ERROR 23000: Duplicate entry '5' for key 'PRIMARY' |
| 85 |
ROLLBACK TO SAVEPOINT a; |
| 86 |
COMMIT; |
| 87 |
SELECT * FROM t1; |
| 88 |
f1 |
| 89 |
5 |
| 90 |
6 |
| 91 |
7 |
| 92 |
DROP TABLE t1; |
| 93 |
SET foreign_key_checks=1; |
| 94 |
CREATE TABLE t1(f1 INT PRIMARY KEY) ENGINE=InnoDB; |
| 95 |
BEGIN; |
| 96 |
INSERT INTO t1 VALUES (5),(6),(7); |
| 97 |
INSERT INTO t1 VALUES (4),(5),(6); |
| 98 |
ERROR 23000: Duplicate entry '5' for key 'PRIMARY' |
| 99 |
COMMIT; |
| 100 |
SELECT * FROM t1; |
| 101 |
f1 |
| 102 |
5 |
| 103 |
6 |
| 104 |
7 |
| 105 |
BEGIN; |
| 106 |
INSERT INTO t1 VALUES (5),(6),(7); |
| 107 |
ERROR 23000: Duplicate entry '5' for key 'PRIMARY' |
| 108 |
SAVEPOINT a; |
| 109 |
INSERT INTO t1 VALUES (4),(5),(6); |
| 110 |
ERROR 23000: Duplicate entry '5' for key 'PRIMARY' |
| 111 |
ROLLBACK TO SAVEPOINT a; |
| 112 |
COMMIT; |
| 113 |
SELECT * FROM t1; |
| 114 |
f1 |
| 115 |
5 |
| 116 |
6 |
| 117 |
7 |
| 118 |
DROP TABLE t1; |
| 119 |
SET foreign_key_checks=0; |
| 120 |
# |
| 121 |
# MDEV-25315 Crash in SHOW ENGINE INNODB STATUS |
| 122 |
# |
| 123 |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; |
| 124 |
CREATE TABLE t2 (a INT PRIMARY KEY) ENGINE=InnoDB; |
| 125 |
INSERT INTO t1 VALUES(1); |
| 126 |
BEGIN; |
| 127 |
INSERT INTO t1 VALUES(1); |
| 128 |
ERROR 23000: Duplicate entry '1' for key 'PRIMARY' |
| 129 |
INSERT INTO t2 VALUES(0); |
| 130 |
INSERT INTO t1 VALUES(2), (2); |
| 131 |
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' |
| 132 |
SHOW ENGINE InnoDB STATUS; |
| 133 |
COMMIT; |
| 134 |
DROP TABLE t1,t2; |
| 135 |
# |
| 136 |
# MDEV-25297 Assertion: trx->roll_limit <= trx->undo_no |
| 137 |
# in ROLLBACK TO SAVEPOINT |
| 138 |
# |
| 139 |
CREATE TABLE t1 (c INT PRIMARY KEY) ENGINE=InnoDB; |
| 140 |
CREATE TABLE t2 (c INT PRIMARY KEY) ENGINE=InnoDB; |
| 141 |
BEGIN; |
| 142 |
INSERT INTO t1 VALUES(0); |
| 143 |
SAVEPOINT x; |
| 144 |
INSERT INTO t2 VALUES(0); |
| 145 |
INSERT INTO t1 VALUES(0); |
| 146 |
ERROR 23000: Duplicate entry '0' for key 'PRIMARY' |
| 147 |
ROLLBACK TO SAVEPOINT x; |
| 148 |
ERROR HY000: Got error 153 "No savepoint with that name" during ROLLBACK |
| 149 |
COMMIT; |
| 150 |
SELECT * FROM t1; |
| 151 |
c |
| 152 |
SELECT * FROM t2; |
| 153 |
c |
| 154 |
DROP TABLE t1,t2; |
| 155 |
# |
| 156 |
# MDEV-25487 Assertion failed in lock_rec_move |
| 157 |
# |
| 158 |
CREATE TABLE t1 (a INT KEY) ENGINE=InnoDB; |
| 159 |
SET @save_limit = @@GLOBAL.innodb_limit_optimistic_insert_debug; |
| 160 |
SET GLOBAL innodb_limit_optimistic_insert_debug = 2; |
| 161 |
BEGIN; |
| 162 |
SELECT * FROM t1 LOCK IN SHARE MODE; |
| 163 |
a |
| 164 |
INSERT INTO t1 VALUES (0),(1),(2); |
| 165 |
INSERT INTO t1 VALUES (0,1); |
| 166 |
ERROR 21S01: Column count doesn't match value count at row 1 |
| 167 |
INSERT INTO t1 VALUES (2); |
| 168 |
ERROR 23000: Duplicate entry '2' for key 'PRIMARY' |
| 169 |
COMMIT; |
| 170 |
SET GLOBAL innodb_limit_optimistic_insert_debug = @save_limit; |
| 171 |
SELECT * FROM t1; |
| 172 |
a |
| 173 |
0 |
| 174 |
1 |
| 175 |
2 |
| 176 |
DROP TABLE t1; |
| 177 |
# |
| 178 |
# MDEV-25534 Assertion lock_table_has...LOCK_IX |
| 179 |
# |
| 180 |
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB; |
| 181 |
SET autocommit=0; |
| 182 |
LOCK TABLE t1 WRITE; |
| 183 |
INSERT INTO t1 VALUES (1); |
| 184 |
COMMIT; |
| 185 |
CREATE TEMPORARY TABLE t0 (a INT PRIMARY KEY) ENGINE=InnoDB; |
| 186 |
INSERT INTO t0 VALUES (1); |
| 187 |
INSERT INTO t1 VALUES (2); |
| 188 |
COMMIT; |
| 189 |
SET autocommit=1; |
| 190 |
DROP TABLE t1; |
| 191 |
DROP TEMPORARY TABLE t0; |
| 192 |
# |
| 193 |
# MDEV-25496 Assertion 'trx->bulk_insert' failed |
| 194 |
# in trx_undo_report_row_operation on INSERT |
| 195 |
# |
| 196 |
CREATE TABLE t (i INT) ENGINE=InnoDB PARTITION BY HASH (i) PARTITIONS 2; |
| 197 |
INSERT INTO t VALUES (0); |
| 198 |
INSERT INTO t VALUES (1),(0),(1); |
| 199 |
DROP TABLE t; |
| 200 |
# |
| 201 |
# MDEV-28327 InnoDB persistent statistics fail to update |
| 202 |
# after bulk insert |
| 203 |
# |
| 204 |
CREATE TABLE t1 (a INT PRIMARY KEY)ENGINE=InnoDB |
| 205 |
STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; |
| 206 |
INSERT INTO t1 SELECT * FROM seq_1_to_4096; |
| 207 |
# Wait till statistics update after bulk insert operation |
| 208 |
SELECT n_rows>=4000 FROM mysql.innodb_table_stats WHERE TABLE_NAME="t1"; |
| 209 |
n_rows>=4000 |
| 210 |
1 |
| 211 |
DROP TABLE t1; |
| 212 |
# |
| 213 |
# MDEV-27214 Import with disabled keys corrupts meta-data like rows, indexes, ... |
| 214 |
# |
| 215 |
CREATE TABLE `t1` ( |
| 216 |
`id` int(11) NOT NULL, |
| 217 |
`a` int(11) DEFAULT NULL, |
| 218 |
PRIMARY KEY (`id`) |
| 219 |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
| 220 |
STATS_PERSISTENT=1 STATS_AUTO_RECALC=1; |
| 221 |
INSERT INTO `t1` VALUES (1,2),(2,3),(3,4); |
| 222 |
# Wait till statistics update after bulk insert operation |
| 223 |
SELECT TABLE_ROWS, AVG_ROW_LENGTH>0 FROM INFORMATION_SCHEMA.TABLES |
| 224 |
WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test'; |
| 225 |
TABLE_ROWS AVG_ROW_LENGTH>0 |
| 226 |
3 1 |
| 227 |
DROP TABLE t1; |
| 228 |
# |
| 229 |
# MDEV-29975 InnoDB fails to release savepoint during bulk insert |
| 230 |
# |
| 231 |
CREATE TABLE t (c INT KEY) ENGINE=InnoDB; |
| 232 |
begin; |
| 233 |
INSERT INTO t VALUES (0,0); |
| 234 |
ERROR 21S01: Column count doesn't match value count at row 1 |
| 235 |
SAVEPOINT a; |
| 236 |
INSERT INTO t VALUES (0),(0); |
| 237 |
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT |
| 238 |
SAVEPOINT a; |
| 239 |
commit; |
| 240 |
SELECT * FROM t; |
| 241 |
c |
| 242 |
DROP TABLE t; |
| 243 |
# |
| 244 |
# MDEV-29545 InnoDB: Can't find record during replace stmt |
| 245 |
# |
| 246 |
CREATE TABLE t1(c1 INT PRIMARY KEY)ENGINE=InnoDB; |
| 247 |
BEGIN; |
| 248 |
INSERT INTO t1 VALUES(3331); |
| 249 |
connect con1,localhost,root,,,; |
| 250 |
BEGIN; |
| 251 |
SELECT c1 FROM t1; |
| 252 |
c1 |
| 253 |
connection default; |
| 254 |
COMMIT; |
| 255 |
connection con1; |
| 256 |
REPLACE INTO t1 VALUES(1984), (1984); |
| 257 |
COMMIT; |
| 258 |
connection default; |
| 259 |
disconnect con1; |
| 260 |
SELECT * FROM t1; |
| 261 |
c1 |
| 262 |
1984 |
| 263 |
3331 |
| 264 |
DROP TABLE t1; |
| 265 |
# |
| 266 |
# MDEV-33979 Disallow bulk insert operation during |
| 267 |
# partition update statement |
| 268 |
# |
| 269 |
CREATE TABLE t1(a INT KEY)ENGINE=InnoDB |
| 270 |
PARTITION BY KEY(a) PARTITIONS 16; |
| 271 |
INSERT INTO t1 VALUES(1); |
| 272 |
UPDATE t1 SET a = 2 WHERE a = 1; |
| 273 |
DROP TABLE t1; |
| 274 |
# |
| 275 |
# MDEV-34265 Possible hang during IO burst with innodb_flush_sync enabled |
| 276 |
# |
| 277 |
CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB; |
| 278 |
SET @save_dbug=@@GLOBAL.debug_dbug; |
| 279 |
SET @@GLOBAL.debug_dbug='+d,ib_page_cleaner_sleep'; |
| 280 |
SET STATEMENT debug_dbug='+d,ib_free_page_sleep' FOR |
| 281 |
INSERT INTO t1 VALUES(REPEAT(1, 8459264)); |
| 282 |
SET @@GLOBAL.debug_dbug=@save_dbug; |
| 283 |
SELECT length(f1) FROM t1; |
| 284 |
length(f1) |
| 285 |
8459264 |
| 286 |
DROP TABLE t1; |
| 287 |
# End of 10.6 tests |
| 288 |
# |
| 289 |
# MDEV-26947 UNIQUE column checks fail in InnoDB resulting |
| 290 |
# in table corruption |
| 291 |
# |
| 292 |
CREATE TABLE t (c1 INT KEY,c2 INT UNIQUE) ENGINE=InnoDB; |
| 293 |
BEGIN; |
| 294 |
INSERT INTO t VALUES (1,0),(2,0); |
| 295 |
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT |
| 296 |
CHECK TABLE t; |
| 297 |
Table Op Msg_type Msg_text |
| 298 |
test.t check status OK |
| 299 |
COMMIT; |
| 300 |
DROP TABLE t; |
| 301 |
CREATE TABLE t (i INT UNIQUE)ENGINE=InnoDB; |
| 302 |
INSERT INTO t VALUES (0),(0); |
| 303 |
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT |
| 304 |
CHECK TABLE t; |
| 305 |
Table Op Msg_type Msg_text |
| 306 |
test.t check status OK |
| 307 |
DROP TABLE t; |
| 308 |
CREATE TABLE t (c INT PRIMARY KEY,c2 CHAR(1) UNIQUE)ENGINE=InnoDB; |
| 309 |
BEGIN; |
| 310 |
INSERT INTO t VALUES(1, ''),(2, ''); |
| 311 |
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT |
| 312 |
SELECT * FROM t; |
| 313 |
c c2 |
| 314 |
DELETE FROM t; |
| 315 |
COMMIT; |
| 316 |
DROP TABLE t; |
| 317 |
# |
| 318 |
# MDEV-26956 LeakSanitizer/Valgrind errors in |
| 319 |
# trx_mod_table_time_t::start_bulk_insert |
| 320 |
# upon adding system versioning |
| 321 |
# |
| 322 |
CREATE TABLE t1(id INT, s DATE, e DATE, PERIOD FOR p(s,e), |
| 323 |
PRIMARY KEY(id, p WITHOUT OVERLAPS)) ENGINE=InnoDB; |
| 324 |
ALTER TABLE t1 ADD COLUMN row_start BIGINT UNSIGNED AS ROW START, |
| 325 |
ADD COLUMN row_end BIGINT UNSIGNED AS ROW END, |
| 326 |
ADD PERIOD FOR SYSTEM_TIME(row_start,row_end), WITH SYSTEM VERSIONING; |
| 327 |
DROP TABLE t1; |
| 328 |
# |
| 329 |
# MDEV-27316 Assertion `!(index)->is_spatial()' failed. |
| 330 |
# |
| 331 |
CREATE TABLE t (c POINT NOT NULL, SPATIAL INDEX(c)) ENGINE=InnoDB; |
| 332 |
INSERT INTO t VALUES (POINT(1, 1)); |
| 333 |
SELECT COUNT(*) FROM t WHERE MBRWithin(t.c, POINT(1,1)); |
| 334 |
COUNT(*) |
| 335 |
1 |
| 336 |
DROP TABLE t; |
| 337 |
# |
| 338 |
# MDEV-27318 Assertion data_size < srv_sort_buf_size failed in row_merge_bulk_buf_add |
| 339 |
# |
| 340 |
CREATE TABLE t1(f1 MEDIUMTEXT)ENGINE=InnoDB; |
| 341 |
INSERT INTO t1 VALUES(REPEAT(1, 8459264)); |
| 342 |
SELECT length(f1) FROM t1; |
| 343 |
length(f1) |
| 344 |
8459264 |
| 345 |
DROP TABLE t1; |
| 346 |
# |
| 347 |
# MDEV-27858 Assertion `page_dir_get_n_heap(new_page) == 2U' failed in PageBulk::init |
| 348 |
# |
| 349 |
CREATE TABLE t1 (c INT) ENGINE=InnoDB; |
| 350 |
CREATE TABLE t2 (c INT) ENGINE=InnoDB; |
| 351 |
INSERT INTO t2 VALUES (1); |
| 352 |
LOCK TABLES t1 WRITE,t2 WRITE; |
| 353 |
INSERT INTO t1 VALUES (1); |
| 354 |
INSERT INTO t2 VALUES (1); |
| 355 |
DROP TABLE t2, t1; |
| 356 |
# |
| 357 |
# MDEV-28138 MariaDB Assertion Failed in mtr_buf_t::has_space |
| 358 |
# |
| 359 |
CREATE TABLE t1( |
| 360 |
f1 SERIAL, |
| 361 |
f2 LINESTRING NOT NULL DEFAULT LineFromText('LINESTRING(1 1,2 2,3 3)'), |
| 362 |
SPATIAL INDEX(f2))ENGINE=InnoDB; |
| 363 |
INSERT INTO t1(f1) VALUES(0), (1), (2); |
| 364 |
ERROR 23000: Duplicate entry '1' for key 'f1' |
| 365 |
DROP TABLE t1; |
| 366 |
# |
| 367 |
# MDEV-28237 Assertion `0' failed in row_upd_sec_index_entry on DELETE |
| 368 |
# |
| 369 |
CREATE TABLE t1 (c0 YEAR UNIQUE) ENGINE=InnoDB; |
| 370 |
INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(0),(0); |
| 371 |
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT |
| 372 |
DELETE FROM t1; |
| 373 |
DROP TABLE t1; |
| 374 |
# |
| 375 |
# MDEV-28037 Assertion `trx->bulk_insert' failed in innodb_prepare_commit_versioned |
| 376 |
# |
| 377 |
CREATE TABLE t1 (c INT) ENGINE=InnoDB; |
| 378 |
CREATE TABLE t2 (c INT) ENGINE=InnoDB; |
| 379 |
CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW UPDATE t2 SET c=1; |
| 380 |
INSERT INTO t1 VALUES (0); |
| 381 |
SELECT * FROM t1; |
| 382 |
c |
| 383 |
0 |
| 384 |
SELECT * FROM t2; |
| 385 |
c |
| 386 |
DROP TABLE t2, t1; |
| 387 |
# |
| 388 |
# MDEV-28242 Assertion `!check_foreigns' failed in |
| 389 |
# trx_t::check_bulk_buffer |
| 390 |
# |
| 391 |
CREATE TABLE t1 (c INT)ENGINE=InnoDB; |
| 392 |
BEGIN; |
| 393 |
INSERT INTO t1 VALUES(1), (1); |
| 394 |
SET SESSION foreign_key_checks=TRUE; |
| 395 |
SHOW CREATE TABLE t1; |
| 396 |
Table Create Table |
| 397 |
t1 CREATE TABLE `t1` ( |
| 398 |
`c` int(11) DEFAULT NULL |
| 399 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_uca1400_ai_ci |
| 400 |
CREATE TABLE t2(d INT)ENGINE=InnoDB; |
| 401 |
DROP TABLE t2, t1; |
| 402 |
# |
| 403 |
# MDEV-28400 Leak in trx_mod_time_t::start_bulk_insert |
| 404 |
# |
| 405 |
SET SESSION foreign_key_checks=0; |
| 406 |
CREATE TABLE t1 (a INT) ENGINE=InnoDB PARTITION BY HASH(a) PARTITIONS 2; |
| 407 |
INSERT INTO t1 VALUES (1),(2); |
| 408 |
ALTER TABLE t1 REBUILD PARTITION p0; |
| 409 |
DROP TABLE t1; |
| 410 |
# |
| 411 |
# MDEV-29570 InnoDB fails to clean bulk buffer when server |
| 412 |
# does rollback operation |
| 413 |
# |
| 414 |
CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=InnoDB |
| 415 |
PARTITION BY RANGE (pk) ( |
| 416 |
PARTITION pn VALUES LESS THAN (20)); |
| 417 |
INSERT INTO t1 VALUES (1),(21); |
| 418 |
ERROR HY000: Table has no partition for value 21 |
| 419 |
DROP TABLE t1; |
| 420 |
# |
| 421 |
# MDEV-29761 Bulk insert fails to rollback |
| 422 |
# during insert..select |
| 423 |
# |
| 424 |
CREATE TABLE t1 (f1 INT)ENGINE=InnoDB; |
| 425 |
CREATE TABLE t2 (f1 INT, UNIQUE INDEX(f1)) ENGINE=InnoDB; |
| 426 |
CREATE TRIGGER tr AFTER INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(1); |
| 427 |
BEGIN; |
| 428 |
INSERT t1 SELECT 1 FROM seq_1_to_2; |
| 429 |
COMMIT; |
| 430 |
SELECT * FROM t1; |
| 431 |
f1 |
| 432 |
SELECT * FROM t2; |
| 433 |
f1 |
| 434 |
CHECK TABLE t1; |
| 435 |
Table Op Msg_type Msg_text |
| 436 |
test.t1 check status OK |
| 437 |
CHECK TABLE t2; |
| 438 |
Table Op Msg_type Msg_text |
| 439 |
test.t2 check status OK |
| 440 |
DROP TABLE t1, t2; |
| 441 |
# |
| 442 |
# MDEV-29801 Inconsistent ER_TOO_BIG_ROWSIZE during bulk |
| 443 |
# insert operation |
| 444 |
# |
| 445 |
call mtr.add_suppression("InnoDB: Cannot add field `(c0[36]|c11)` in table"); |
| 446 |
SET @format= @@innodb_default_row_format; |
| 447 |
CREATE TABLE t1 (pk int primary key, c01 text, c02 text, c03 text, |
| 448 |
c04 text, c05 text, c06 text, c07 text, c08 text, |
| 449 |
c09 text, c10 text, c11 text, c12 text) ENGINE=InnoDB; |
| 450 |
SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= COMPACT; |
| 451 |
ALTER TABLE t1 FORCE; |
| 452 |
Warnings: |
| 453 |
Warning 139 Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. |
| 454 |
INSERT IGNORE INTO t1 VALUES |
| 455 |
(1, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)), |
| 456 |
(2, REPEAT('x',4805), REPEAT('t',2211), REPEAT('u',974), REPEAT('e',871), REPEAT('z',224), REPEAT('j',978), REPEAT('n',190), REPEAT('t',888), REPEAT('x',32768), REPEAT('e',968), REPEAT('b',913), REPEAT('x',12107)); |
| 457 |
ERROR 42000: Row size too large (> 8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help. In current row format, BLOB prefix of 768 bytes is stored inline. |
| 458 |
CHECK TABLE t1; |
| 459 |
Table Op Msg_type Msg_text |
| 460 |
test.t1 check status OK |
| 461 |
DROP TABLE t1; |
| 462 |
SET GLOBAL INNODB_DEFAULT_ROW_FORMAT= @format; |
| 463 |
# |
| 464 |
# MDEV-30321 blob data corrupted by row_merge_write_blob_to_tmp_file() |
| 465 |
# |
| 466 |
CREATE TABLE t1 ( |
| 467 |
`id` int(11) NOT NULL, |
| 468 |
`data` LONGBLOB NOT NULL, |
| 469 |
PRIMARY KEY (`id`) |
| 470 |
) ENGINE=InnoDB; |
| 471 |
INSERT INTO t1 VALUES |
| 472 |
(1, REPEAT('X', @@innodb_sort_buffer_size)), |
| 473 |
(2, REPEAT('X', @@innodb_sort_buffer_size)); |
| 474 |
SELECT COUNT(*) AS nb_corrupted_rows FROM t1 WHERE data != REPEAT('X', @@innodb_sort_buffer_size); |
| 475 |
nb_corrupted_rows |
| 476 |
0 |
| 477 |
DROP TABLE t1; |
| 478 |
# End of 10.7 tests |
| 479 |
# |
| 480 |
# MDEV-30426 Assertion !rec_offs_nth_extern(offsets2, n) |
| 481 |
# during bulk insert |
| 482 |
# |
| 483 |
CREATE TABLE t1(f1 TEXT NOT NULL, f2 TEXT NOT NULL, |
| 484 |
f3 TEXT NOT NULL, f4 TEXT NOT NULL, |
| 485 |
f5 TEXT NOT NULL, f6 TEXT NOT NULL, |
| 486 |
PRIMARY KEY(f6(10)))ENGINE=InnoDB; |
| 487 |
BEGIN; |
| 488 |
INSERT INTO t1 VALUES |
| 489 |
(repeat('a', 200), repeat('b', 200), repeat('c', 200), |
| 490 |
repeat('d', 200), repeat('e', 200), repeat('f', 200)), |
| 491 |
(repeat('b', 20000), repeat('c', 16000), repeat('d', 12000), |
| 492 |
repeat('e', 12000), repeat('f', 12000), repeat('f', 12000)); |
| 493 |
ERROR HY000: Got error 1 "Operation not permitted" during COMMIT |
| 494 |
COMMIT; |
| 495 |
DROP TABLE t1; |
| 496 |
# End of 10.8 tests |
| 497 |
# |
| 498 |
# MDEV-31537 Bulk insert operation aborts the server |
| 499 |
# for redundant table |
| 500 |
# |
| 501 |
CREATE TABLE t (a CHAR CHARACTER SET utf8) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; |
| 502 |
INSERT t SELECT left(seq,1) FROM seq_1_to_43691; |
| 503 |
DROP TABLE t; |
| 504 |
# |
| 505 |
# MDEV-32453 Bulk insert fails to apply when trigger |
| 506 |
# does insert operation |
| 507 |
# |
| 508 |
CREATE TABLE t(c INT)ENGINE=InnoDB; |
| 509 |
CREATE TRIGGER t2_ai AFTER INSERT ON t FOR EACH ROW SET @a:=(SELECT * FROM t); |
| 510 |
BEGIN; |
| 511 |
INSERT INTO t VALUES (1),(1); |
| 512 |
ERROR 21000: Subquery returns more than 1 row |
| 513 |
COMMIT; |
| 514 |
DROP TABLE t; |
| 515 |
# |
| 516 |
# MDEV-33868 Assertion `trx->bulk_insert' failed in |
| 517 |
# innodb_prepare_commit_versioned |
| 518 |
# |
| 519 |
CREATE TABLE t (id INT) ENGINE=InnoDB; |
| 520 |
select 1 into outfile "VARDIR/tmp/t.outfile"; |
| 521 |
BEGIN; |
| 522 |
LOAD DATA INFILE 'VARDIR/tmp/t.outfile' INTO TABLE t; |
| 523 |
COMMIT; |
| 524 |
DROP TABLE t; |
| 525 |
# |
| 526 |
# MDEV-33934 Assertion `!check_foreigns' failed in |
| 527 |
# trx_t::bulk_insert_apply_for_table(dict_table_t*) |
| 528 |
# |
| 529 |
CREATE TABLE t1(f1 INT,f2 INT,KEY(f1))engine=innodb; |
| 530 |
BEGIN; |
| 531 |
INSERT INTO t1 VALUES(); |
| 532 |
SET STATEMENT FOREIGN_KEY_CHECKS=1 FOR SELECT * FROM t1; |
| 533 |
f1 f2 |
| 534 |
NULL NULL |
| 535 |
COMMIT; |
| 536 |
DROP TABLE t1; |
| 537 |
# |
| 538 |
# MDEV-33970 Assertion `!m.first->second.is_bulk_insert()' |
| 539 |
# failed in trx_undo_report_row_operation() |
| 540 |
# |
| 541 |
CREATE TABLE t1(c1 INT,c2 CHAR) ENGINE=INNODB PARTITION BY KEY(c1) PARTITIONS 2; |
| 542 |
begin; |
| 543 |
INSERT INTO t1 VALUES(2,0); |
| 544 |
DELETE FROM t1; |
| 545 |
commit; |
| 546 |
DROP TABLE t1; |
| 547 |
# |
| 548 |
# MDEV-35475 Assertion `!rec_offs_nth_extern(offsets1, n)' |
| 549 |
# failed in cmp_rec_rec_simple_field |
| 550 |
# |
| 551 |
CREATE TABLE t1(a BLOB, b VARCHAR(2048), PRIMARY KEY (b)) ENGINE=InnoDB |
| 552 |
CHARACTER SET latin1 COLLATE latin1_swedish_ci; |
| 553 |
INSERT INTO t1 VALUES (REPEAT('x',4805),'a'), (REPEAT('x',16111),'b'), |
| 554 |
(REPEAT('x',65535),'c'), (REPEAT('x',11312),'d'), |
| 555 |
(REPEAT('x',35177),'e'), (REPEAT('x',65535),'f'), |
| 556 |
(REPEAT('x',1988),'g'), (NULL,REPEAT('x',2048)), |
| 557 |
(REPEAT('x',2503),'h'), (REPEAT('x',33152),'i'), |
| 558 |
(REPEAT('x',65535),'j'), (REPEAT('x',1988),'k'), |
| 559 |
(REPEAT('x',65535),'l'), (REPEAT('x',65535),'m'), |
| 560 |
(REPEAT('x',65535),'n'), (REPEAT('x',65535),'o'), |
| 561 |
(REPEAT('x',1988),'p'), (REPEAT('x',2503),'q'), |
| 562 |
(REPEAT('x',65535),'r'), (REPEAT('x',65535),'s'), |
| 563 |
(REPEAT('x',65535),'t'), (REPEAT('x',3169),'u'), |
| 564 |
(REPEAT('x',7071),'v'), (REPEAT('x',16111),'w'), |
| 565 |
(REPEAT('x',2325),'x'), (REPEAT('x',33152),'y'), |
| 566 |
(REPEAT('x',65535),'z'), (REPEAT('x',65535),'aa'), |
| 567 |
(REPEAT('x',16111),'bb'), (REPEAT('x',4805),'cc'), |
| 568 |
(REPEAT('x',65535),'dd'); |
| 569 |
DROP TABLE t1; |
| 570 |
# |
| 571 |
# Assertion `page_dir_get_n_heap(new_page) == 2U' failed |
| 572 |
# in dberr_t PageBulk::init() |
| 573 |
# |
| 574 |
CREATE TABLE t1(f1 INT)ENGINE=InnoDB PARTITION BY RANGE (f1) (PARTITION p0 VALUES LESS THAN (100)); |
| 575 |
SET @old_bulk_op= |
| 576 |
(SELECT variable_value FROM information_schema.global_status |
| 577 |
WHERE variable_name = 'innodb_bulk_operations'); |
| 578 |
BEGIN; |
| 579 |
INSERT INTO t1 SELECT seq FROM seq_1_to_1; |
| 580 |
COMMIT; |
| 581 |
SELECT variable_value-@old_bulk_op bulk_operations |
| 582 |
FROM information_schema.global_status |
| 583 |
WHERE variable_name = 'innodb_bulk_operations'; |
| 584 |
bulk_operations |
| 585 |
1 |
| 586 |
DROP TABLE t1; |
| 587 |
call mtr.add_suppression("Found 1 prepared XA transactions"); |
| 588 |
# |
| 589 |
# MDEV-36771 Assertion `bulk_insert == TRX_NO_BULK' failed |
| 590 |
# in trx_t::assert_freed from innodb_shutdown |
| 591 |
# |
| 592 |
CREATE TABLE t1(f1 INT)ENGINE=InnoDB; |
| 593 |
XA START 'a'; |
| 594 |
INSERT INTO t1 VALUES(1); |
| 595 |
XA END 'a'; |
| 596 |
XA PREPARE 'a'; |
| 597 |
# restart |
| 598 |
XA COMMIT 'a'; |
| 599 |
SELECT * FROM t1; |
| 600 |
f1 |
| 601 |
1 |
| 602 |
DROP TABLE t1; |
| 603 |
# End of 10.11 tests |