Hello.
  
  I'm very new to MySQL (and SQL databases at large), so please apologize if
I'm just missing an obvious point, or if it has already been discussed before.

  As I understand, auto-incremental columns (quite useful for primary
indexes) are always incremented. Even if rows are deleted, those counters
always keep growing.

  But a frightening thing is this snippet of the documentation :
  
"The behavior of the auto-increment mechanism is not defined if a user gives
a negative value to the column or if the value becomes bigger than the
maximum integer that can be stored in the specified integer type." 
 
  The former part is obvious, but the later is not.
  
  Does it mean that MySQL databases will definitely stop working at a random
date (when an auto-incremental column will overflow) ?

  How to cope with this ? Or to detect when an overflow will occur (do we
need to always "BEGIN; SELECT MAX(id) ... ;" then only INSERT and COMMIT if
the result is lower than the max value the type can handle) ?

  Or is there a way to recompute all primary keys (and sync foreign keys) by
filling unused gaps ?

  Best regards,
  
        -Frank.
        
-- 
 __  /*-      Frank DENIS (Jedi/Sector One) <[EMAIL PROTECTED]>     -*\  __
 \ '/    <a href="http://www.PureFTPd.Org/";> Secure FTP Server </a>    \' /
  \/  <a href="http://www.Jedi.Claranet.Fr/";> Misc. free software </a>  \/

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to