Bug #24873 TIMESTAMP(N) still allowed; should be removed
Submitted: 7 Dec 2006 3:42 Modified: 3 Jan 2008 7:30
Reporter: Jon Stephens Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.2-bk OS:Linux (Linux)
Assigned to: CPU Architecture:Any
Tags: 5.2, deprecated, timestamp

[7 Dec 2006 3:42] Jon Stephens
Description:
Use of TIMESTAMP(N) in 5.1 produces a warning:

mysql> select version();
+-------------------+
| version()         |
+-------------------+
| 5.1.14-beta-debug |
+-------------------+
1 row in set (0.00 sec)

mysql> create table ts(c timestamp(6));
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> show warnings;
+---------+------+----------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                  |
+---------+------+----------------------------------------------------------------------------------------------------------+
| Warning | 1541 | The syntax 'TIMESTAMP(6)' is deprecated and will be removed in MySQL 5.2. Please use 'TIMESTAMP' instead |
+---------+------+----------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

The same syntax in 5.2 also produces a warning:

mysql> select version();
+-------------------+
| version()         |
+-------------------+
| 5.2.0-alpha-debug |
+-------------------+
1 row in set (0.00 sec)
 
mysql> create table t (s1 timestamp(1));
Query OK, 0 rows affected, 1 warning (0.03 sec)

How to repeat:
See Description.

Suggested fix:
In 5.1, use of TIMESTAMP(N) produces a warning to the effect that the syntax is deprecated and will be removed in 5.2.

Therefore, any use of TIMESTAMP(N) should not succeed in 5.2. It should instead fail in 5.2 with a syntax error.
[7 Dec 2006 6:41] Valeriy Kravchuk
Thank you for a bug report. Verified just as described.
[3 Jan 2008 7:30] Valeriy Kravchuk
Looks like this is already fixed in 6.0.x:

C:\Program Files\MySQL\MySQL Server 5.0\bin>mysql -uroot  test -P3311
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.0.3-alpha-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table ts(c timestamp(6));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(6))'
 at line 1
[16 Feb 2012 4:11] Daniel Wu
I have encountered the same problems in MYSQL 6.0.3-alpha-community.
Do I need to install updating file?  

The problems like following:
Server version: 6.0.3-alpha-community MySQL Community Server (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> create table ts(c timestamp(6));
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '(6))'
 at line 1
[16 Feb 2012 5:55] Jon Stephens
Daniel,

We no longer maintain MySQL 6.0, which was discontinued in 2009. You should be using MySQL 5.5 in production or 5.6 for testing. Despite the numbering, these are the latest major versions. :)

Thanks!