From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-143952-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id C44CD1381FB
	for <garchives@archives.gentoo.org>; Fri, 28 Dec 2012 06:44:57 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 9A89621C036;
	Fri, 28 Dec 2012 06:44:43 +0000 (UTC)
Received: from mail119c7.megamailservers.com (mail119c7-2520.megamailservers.com [69.49.98.26])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id ACB2921C036
	for <gentoo-user@lists.gentoo.org>; Fri, 28 Dec 2012 06:43:33 +0000 (UTC)
X-POP-User: admin.sys-concept.com
Received: from syscon7.localdomain (S01060050da7ae68c.ed.shawcable.net [68.149.90.13])
	by mail119c7.megamailservers.com (8.13.6/8.13.1) with ESMTP id qBS6hVWv005981
	for <gentoo-user@lists.gentoo.org>; Fri, 28 Dec 2012 01:43:32 -0500
Received: by syscon7.localdomain (Postfix, from userid 1000)
	id 79BA520323A; Thu, 27 Dec 2012 23:44:41 -0700 (MST)
Date: Thu, 27 Dec 2012 23:44:41 -0700
From: Joseph <syscon780@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] php CURRENT_TIMESTAMP vs NOW()
Message-ID: <20121228064441.GA25197@syscon7.inet>
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Disposition: inline
User-Agent: Mutt/1.5.21 (2010-09-15)
X-CSC: 0
X-CHA: v=1.1 cv=M/OfXiUT3yXeNaOuONSOHRsfWHstuXXEwp4jCZzxbHU= c=1 sm=1
		a=wom5GMh1gUkA:10 a=Y_ihYFwlQs0A:10 a=nDghuxUhq_wA:10 a=8nJEP1OIZ-IA:10
		a=C3ZDv51cNVt4vJz/79I2xQ==:17 a=Xhz9v9ceo-Jseae4OhsA:9 a=wPNLvfGTeEIA:10
		a=C3ZDv51cNVt4vJz/79I2xQ==:117
X-CTCH-Spam: Unknown
X-CTCH-RefID: str=0001.0A020203.50DD3F95.000D,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0
X-Archives-Salt: 3d1c8eb0-c02f-4a64-bbe4-14d9472f3d4a
X-Archives-Hash: 0f10def1bb58fa0e4fc5efdd2b4b4dab

I'm not a PHP programmer but I'll try to explain my problem.
I've create table in my php database:

DROP TABLE IF EXISTS visual_verify_code;
CREATE TABLE visual_verify_code (
   oscsid varchar(32) NOT NULL,
   code varchar(6) NOT NULL,
   dt TIMESTAMP(12) NOT NULL DEFAULT NOW(),
   PRIMARY KEY (oscsid)
);

It worked OK, after few days I backup my database and try to restore it, but it keeps complaining on the "dt":
ERROR 1067 (42000) at line 38009: Invalid default value for 'dt'

so the database is dropped but never restored. The backup data base contain:

create table visual_verify_code (
   oscsid varchar(32) not null ,
   code varchar(6) not null ,
   dt timestamp default 'CURRENT_TIMESTAMP' not null ,
   PRIMARY KEY (oscsid)
);

so the difference is:

  dt TIMESTAMP(12) NOT NULL DEFAULT NOW(),
vs
  dt timestamp default 'CURRENT_TIMESTAMP' not null ,

If I change in backup database the line to: "dt TIMESTAMP(12) NOT NULL DEFAULT NOW(),"
I can restore it without problems.  

Why is it doing it?  
In "dt" table structure the "default" has option:
- None
- As Defined:
- NULL
- CURRENT_TIMESTAMP

If I change setting from "CURRENT_TIMESTAMP" to any of the above will it help restore it correctly? 

-- 
Joseph