INSERT: Почему ID=0 выдает ошибку, когда должен сам исправлять

sequencer

Новичок
INSERT: Почему ID=0 выдает ошибку, когда должен сам исправлять

INSERT into Table values (0,C1,C2,...)
Я читал что если Id=0 (первое значение), то sql сам исправляет на правильный номер (будь то первый свободный или еще как), т.к. нельзя чтобы строка имела нулевой ключ. Тогда почему я вижу "Column count doesn't match value count at row 1" ?
MySQL 4.1.8-max
 

magic

lancer
А необходимый режим включен?

http://dev.mysql.com/doc/refman/4.1/en/server-sql-mode.html

NO_AUTO_VALUE_ON_ZERO

NO_AUTO_VALUE_ON_ZERO affects handling of AUTO_INCREMENT columns. Normally, you generate the next sequence number for the column by inserting either NULL or 0 into it. NO_AUTO_VALUE_ON_ZERO suppresses this behavior for 0 so that only NULL generates the next sequence number. (Added in MySQL 4.1.1)

This mode can be useful if 0 has been stored in a table's AUTO_INCREMENT column. (Storing 0 is not a recommended practice, by the way.) For example, if you dump the table with mysqldump and then reload it, MySQL normally generates new sequence numbers when it encounters the 0 values, resulting in a table with contents different from the one that was dumped. Enabling NO_AUTO_VALUE_ON_ZERO before reloading the dump file solves this problem. As of MySQL 4.1.1, mysqldump automatically includes a statement in the dump output that enables NO_AUTO_VALUE_ON_ZERO to avoid this problem.
 

Апельсин

Оранжевое создание
sequencer, а сообщение об ошибке переводить пробовали?
У вас добавляемые даные не соответствует кол-ву столбцов в таблице.
 

sequencer

Новичок
Апельсин, лол.
Когда прогаешь, а на часах 03:25 (см.) - стоит ли удивляться :)
 
Сверху