is when a keyword?

2001-07-02 Thread Chris Bare

I'm trying to upgrade from 3.22 to 3.23.39 and have discovered that I can't
create a table which has a column named when. This has worked in the past,
including on 3.23.36. Here is the output I got:

mysql CREATE TABLE wasp_project_hist (
-   id int(11) DEFAULT '0' NOT NULL auto_increment,
-   project_id int(11) DEFAULT '0' NOT NULL,
-   when datetime,
-   who varchar(16) DEFAULT '' NOT NULL,
-   status varchar(16) DEFAULT '' NOT NULL,
-   comment text,
-   sent int(11),
-   hours_worked_this_week text,
-   complete enum('true','false'),
-   projected_duration int(11),
-   PRIMARY KEY (id)
- );
ERROR 1064: You have an error in your SQL syntax near 'when datetime,
  who varchar(16) DEFAULT '' NOT NULL,
  status varchar(16) DEFAU' at line 4
mysql CREATE TABLE wasp_project_hist (
-   id int(11) DEFAULT '0' NOT NULL auto_increment,
-   project_id int(11) DEFAULT '0' NOT NULL,
-   whenx datetime,
-   who varchar(16) DEFAULT '' NOT NULL,
-   status varchar(16) DEFAULT '' NOT NULL,
-   comment text,
-   sent int(11),
-   hours_worked_this_week text,
-   complete enum('true','false'),
-   projected_duration int(11),
-   PRIMARY KEY (id)
- );
Query OK, 0 rows affected (0.03 sec)

The only difference is I changed when to whenx.
Is when now a reserved keyword, or is this a bug?

-- 
Chris BareMetro Link Incorporated
[EMAIL PROTECTED]   http://www.metrolink.com/

-
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




Re: is when a keyword?

2001-07-02 Thread btjones


When is a reserved word in ANSI SQL.  See the link below for the full
list.

http://www.mysql.com/doc/R/e/Reserved_words.html



Chris Bare [EMAIL PROTECTED] wrote:

 ERROR 1064: You have an error in your SQL syntax near
'when datetime,
   who varchar(16) DEFAULT '' NOT NULL,
   status varchar(16) DEFAU' at line 4

The only difference is I changed when to whenx.
Is when now a reserved keyword, or is this a bug?




-
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