No, this is NOT a bug.

According to the manual (you read it, right?), TIMESTAMP is created so that
when a record is UPDATEd or INSERTed, the time of the change is entered into
the record.  If you want a date that does not changem use the DATE fiel

-----Original Message-----
From: Hihn Jason [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 10:33 AM
To: '[EMAIL PROTECTED]'
Subject: Problems with UPDATE in v3.23.49 (is this a bug)


I have a table whose schema contains:
id INTEGER AUTO_INCREMENT, 
gen_time TIMESTAMP, 
rec_time TIMESTAMP, 
repeats INTEGER DEFAULT 0, 
PRIMARY KEY (id), 
INDEX (rec_time))

When I do an:
UPDATE table SET repeats=repeats+1

gen_time gets updated as well:
mysql> select id, gen_time, rec_time, repeats from table;
+----+----------------+----------------+---------+
| id | gen_time       | rec_time       | repeats |
+----+----------------+----------------+---------+
|  1 | 20020404164500 | 20020405111308 |       0 |
+----+----------------+----------------+---------+
1 row in set (0.01 sec)

mysql> update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> update table set repeats=repeats+1 where id='1';
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select id, gen_time, rec_time, repeats from table;
+----+----------------+----------------+---------+
| id | gen_time       | rec_time       | repeats |
+----+----------------+----------------+---------+
|  1 | 20020405112158 | 20020405111308 |       3 |
+----+----------------+----------------+---------+
1 row in set (0.02 sec)

Is this a bug or am I forgetting something?



---------------------------------------------------------------------
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

---------------------------------------------------------------------
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