September 11, 2008

AUTO_INCREMENT and MERGE TABLES

Posted by peter |

How would you expect AUTO_INCREMENT to work with MERGE tables ? Assuming INSERT_METHOD=LAST is used I would expect it to work same as in case insertion happens to the last table… which does not seems to be the case. Alternatively I would expect AUTO_INCREMENT to be based off the maximum value across all tables, respecting AUTO_INCREMENT set for the Merge Table itself. Neither of these expectations really true:
[read more...]

Can you Trust CHECK TABLE ?

Posted by peter |

Take a look at this:

SQL:
  1. mysql> repair TABLE a3;
  2. +---------+--------+----------+----------+
  3. | TABLE   | Op     | Msg_type | Msg_text |
  4. +---------+--------+----------+----------+
  5. | test.a3 | repair | STATUS   | OK       |
  6. +---------+--------+----------+----------+
  7. 1 row IN SET (0.10 sec)
  8.  
  9. mysql> SELECT * FROM a3 ORDER BY i;
  10. +------------+
  11. | i          |
  12. +------------+
  13. | 2147483648 |
  14. |         11 |
  15. |         13 |
  16. |         14 |
  17. | 2147483647 |
  18. +------------+
  19. 5 rows IN SET (0.00 sec)

The sort order is obviously wrong while CHECK TABLE is not reporting any error
[read more...]