Bug #18852 DESCRIBE output shows TIMESTAMP columns always NULL
| Submitted: | 6 Apr 2006 15:27 | Modified: | 8 Aug 2006 13:42 |
|---|---|---|---|
| Reporter: | Andreas Krueger | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server | Severity: | S3 (Non-critical) |
| Version: | 5.0.21-BK, 5.0.17-nt | OS: | Linux (Linux, Windows XP Home SP2) |
| Assigned to: | CPU Architecture: | Any |
[6 Apr 2006 15:27]
Andreas Krueger
[10 Apr 2006 10:48]
Valeriy Kravchuk
Thank you for a bug report. Verified just as described with 5.0.21-BK (ChangeSet@1.2143, 2006-04-10 08:29:24+02:00) on Linux: mysql> CREATE TABLE nulltest ( ts TIMESTAMP ); Query OK, 0 rows affected (0.01 sec) mysql> INSERT INTO nulltest VALUES (NULL); Query OK, 1 row affected (0.00 sec) mysql> SELECT * FROM nulltest; +---------------------+ | ts | +---------------------+ | 2006-04-10 12:49:06 | +---------------------+ 1 row in set (0.00 sec) mysql> ALTER TABLE nulltest MODIFY ts TIMESTAMP NULL; Query OK, 1 row affected (0.01 sec) Records: 1 Duplicates: 0 Warnings: 0 mysql> INSERT INTO nulltest VALUES (NULL); Query OK, 1 row affected (0.01 sec) mysql> SELECT * FROM nulltest; +---------------------+ | ts | +---------------------+ | 2006-04-10 12:49:06 | | NULL | +---------------------+ 2 rows in set (0.00 sec) mysql> ALTER TABLE nulltest MODIFY ts TIMESTAMP; Query OK, 2 rows affected (0.02 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> DESCRIBE nulltest; +-------+-----------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+-------------------+-------+ | ts | timestamp | YES | | CURRENT_TIMESTAMP | | +-------+-----------+------+-----+-------------------+-------+ 1 row in set (0.01 sec) mysql> ALTER TABLE nulltest MODIFY ts TIMESTAMP NOT NULL; Query OK, 2 rows affected (0.01 sec) Records: 2 Duplicates: 0 Warnings: 0 mysql> DESCRIBE nulltest; +-------+-----------+------+-----+-------------------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+-------------------+-------+ | ts | timestamp | YES | | CURRENT_TIMESTAMP | | +-------+-----------+------+-----+-------------------+-------+ 1 row in set (0.01 sec) mysql> select version(); +-----------+ | version() | +-----------+ | 5.0.21 | +-----------+ 1 row in set (0.00 sec) Test case: -- bug #18852 CREATE TABLE nulltest ( ts TIMESTAMP ); INSERT INTO nulltest VALUES (NULL); ALTER TABLE nulltest MODIFY ts TIMESTAMP NULL; INSERT INTO nulltest VALUES (NULL); ALTER TABLE nulltest MODIFY ts TIMESTAMP; DESCRIBE nulltest; ALTER TABLE nulltest MODIFY ts TIMESTAMP NOT NULL; DESCRIBE nulltest; -- same result as previous one. NO expected!
[8 Aug 2006 13:42]
Sergei Golubchik
This is a duplicate of the bug#20910
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.