Related to that last quiz. Here’s the SHOW CREATE TABLE output – I’ve only cleaned up the whitespace.
CREATE TABLE `t1` (
`id` int(11) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
/*!50100 PARTITION BY RANGE (id) (
PARTITION p0 VALUES LESS THAN (100)
ENGINE = MyISAM,
PARTITION p1 VALUES LESS THAN MAXVALUE
DATA DIRECTORY = '~/mysql/data/'
ENGINE = MyISAM
) */
Now, pay close attention to the rows inserted:
mysql> INSERT INTO t1 VALUES (100); Query OK, 1 row affected (0.00 sec) mysql> SELECT COUNT(*) FROM t1; +----------+ | COUNT(*) | +----------+ | 1 | +----------+ 1 row in set (0.00 sec)
Ok, here’s the tricky bit:
mysql> SELECT * FROM t1; Empty set (0.00 sec)
No triggers, no BLACKHOLE, no Proxy, no events or other scheduled tasks, no other connections deleting rows, no temporary tables, and I have all the necessary privileges (including to the data directory shown, which exists and isn’t full). It’s all MyISAM, so surely no transactions. No errors or warnings have been reported.
When you figure it out, don’t do it in your production environment. Bad things happen.

Leave a Reply