Bug #9248 CURRENT_USER() as DEFAULT clause argument in CREATE/ALTER TABLE statement

Submitted: 17 Mar 2005 12:49 Modified: 17 Mar 2005 15:30
Reporter: Ed Chesstwin Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.10 OS:Windows (Win2000)
Assigned to: CPU Architecture:Any

[17 Mar 2005 12:49] Ed Chesstwin
Description:
mysql> create table dummy (id int,user varchar(255) default CURRENT_USER());
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the rig
ht syntax to use near 'CURRENT_USER())' at line 1

How to repeat:
create table dummy (id int,user varchar(255) default CURRENT_USER());
[17 Mar 2005 15:30] Jorge del Conde
Hi!

This is not a bug in mysql.  It's by design that one can only use constants for defaults.

As a workaround, you might want to consider using triggers in 5.0

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.071 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.