|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Newbie questions here...
Reading the MySQL manual regarding InnoDB databases, can someone confirm that: 1. if the server is rebooted, AUTO_INCREMENT reverts back to 1? 2. what happens if the field is specified as or PRIMARY KEY or UNIQUE? Cheers Phil |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
Phil Latio wrote:
> Newbie questions here... > > Reading the MySQL manual regarding InnoDB databases, can someone confirm > that: > 1. if the server is rebooted, AUTO_INCREMENT reverts back to 1? False. The next row inserted into a table with an AUTO_INCREMENT column generates a new value, the next in the sequence higher than the last value that was generated for that column. Note that this could leave gaps, if you have deleted rows in the meantime. The database remembers which value was last generated per table, even after a reboot. > 2. what happens if the field is specified as or PRIMARY KEY or UNIQUE? No difference. Note that AUTO_INCREMENT can be declared only for an indexed integer column, of which columns with PRIMARY KEY or UNIQUE constraints are examples. Regards, Bill K. |
|
![]() |
| Outils de la discussion | |
|
|