Thursday, December 8, 2011

Re: incompatibility between Google Cloud SQL and MySQL 5.5

I found my bug in the above code. I had fixed the function on MySQL to
take a string as input and the same fix (to add precision) wasn't
applied to Cloud SQL.
Here is the UDF that works correctly in both:
CREATE FUNCTION epoch_microseconds (a NVARCHAR(100)) RETURNS BIGINT
DETERMINISTIC
BEGIN
RETURN TIMESTAMPDIFF(MICROSECOND,'1970-01-01',a);
END

No comments:

Post a Comment