Subject: | MySQL CURRENT_TIMESTAMP emitted as SCALAR(0x...) |
Sorry, not entirely sure how to describe this, so here's some examples:
This fails:
$ cat x.sql
CREATE TABLE foo (
bar TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
$ sqlt -f MySQL -t MySQL x.sql
--
-- Created by SQL::Translator::Producer::MySQL
-- Created on Mon Nov 18 13:24:12 2013
--
SET foreign_key_checks=0;
--
-- Table: `foo`
--
CREATE TABLE `foo` (
`bar` TIMESTAMP on update SCALAR(0x315a940) NULL
);
SET foreign_key_checks=1;
This appears to succeed:
$ cat x.sql
CREATE TABLE foo (
bar TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
$ sqlt -f MySQL -t MySQL x.sql
--
-- Created by SQL::Translator::Producer::MySQL
-- Created on Mon Nov 18 13:24:50 2013
--
SET foreign_key_checks=0;
--
-- Table: `foo`
--
CREATE TABLE `foo` (
`bar` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP
);
SET foreign_key_checks=1;
But not always:
$ sqlt -f MySQL -t POD x.sql
...
=item * TIMESTAMP
=item * Default 'SCALAR(0x250e480)'
=item * Nullable 'Yes'
...
Its not clear to me if this is a parser or producer bug.