| 1 |
# |
| 2 |
# Test executing row_update_statistics_if_needed() when the stats |
| 3 |
# for the given table are not initialized |
| 4 |
# |
| 5 |
|
| 6 |
-- source include/have_debug.inc |
| 7 |
|
| 8 |
CREATE TABLE parent ( |
| 9 |
a INT PRIMARY KEY |
| 10 |
) ENGINE=INNODB; |
| 11 |
|
| 12 |
CREATE TABLE child ( |
| 13 |
a INT PRIMARY KEY, |
| 14 |
FOREIGN KEY (a) REFERENCES parent(a) ON DELETE CASCADE |
| 15 |
) ENGINE=INNODB; |
| 16 |
|
| 17 |
INSERT INTO parent VALUES (1); |
| 18 |
INSERT INTO child VALUES (1); |
| 19 |
|
| 20 |
-- source include/restart_mysqld.inc |
| 21 |
|
| 22 |
SET SESSION DEBUG='+d,test_upd_stats_if_needed_not_inited'; |
| 23 |
|
| 24 |
# this will cause row_update_statistics_if_needed() to be called for a table |
| 25 |
# that is not opened (child) and thus has table->stat_initialized set to FALSE |
| 26 |
DELETE FROM parent; |
| 27 |
|
| 28 |
SET SESSION DEBUG='-d,test_upd_stats_if_needed_not_inited'; |
| 29 |
|
| 30 |
let SEARCH_PATTERN=test_upd_stats_if_needed_not_inited was executed; |
| 31 |
let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err; |
| 32 |
--source include/search_pattern.inc |
| 33 |
|
| 34 |
DROP TABLE child; |
| 35 |
DROP TABLE parent; |