Default Value Issue for "DATETIME" column type

I m trying to create a table using with this statement

CREATE TABLE s2(id INT, ts DATETIME(6) DEFAULT NOW(6) ON UPDATE NOW(6));

But I recevie a error, “Invalid default value for ts”. I can see this statement is used in the docs to create table Time and Date · SingleStore Documentation.
My version is “Server version: 5.5.58 MemSQL source distribution (compatible; MySQL Enterprise & MySQL Commercial)”

Hi,

I answered you over on stackoverflow, but you need to upgrade to a newer version of SingleStoreDB to use DEFAULT NOW() on a DATETIME column. Your older version only supports it on TIMESTAMP columns.

-Adam

1 Like