Quoting cars...@bitbybit.dk:

Of course you can have ID=0.

Definately agree

mysql> DESCRIBE test;
+---------+-------------+------+-----+---------+----------------+
| Field   | Type        | Null | Key | Default | Extra          |
+---------+-------------+------+-----+---------+----------------+
| autoinc | int(11)     | NO   | PRI | NULL    | auto_increment |
| value   | varchar(10) | NO   |     | NULL    |                |
+---------+-------------+------+-----+---------+----------------+
2 rows in set (0.00 sec)

mysql> SELECT * FROM test;
+---------+------------+
| autoinc | value      |
+---------+------------+
|       0 | 1234567890 |
+---------+------------+
1 row in set (0.00 sec)

mysql> UPDATE test SET value='a' WHERE autoinc='0';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM test;
+---------+-------+
| autoinc | value |
+---------+-------+
|       0 | a     |
+---------+-------+
1 row in set (0.00 sec)

However, what I believe the problem is:
mysql> UPDATE test set value='12345678901' WHERE autoinc='0';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1

mysql> SELECT * FROM test;
+---------+------------+
| autoinc | value      |
+---------+------------+
|       0 | 1234567890 |
+---------+------------+
1 row in set (0.00 sec)

the value of value is too long for the varchar(10) in the table. It thus generates the warning, and truncate the field.

The poster's table needs to be updated therefor to accept longer variables in the sizes column.


--

Regards,
Chris.



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to