Status/Resolution/Reason: Closed/Withdrawn/NotABug
Reporter/Name(from Bugbase): Rafael Salomon / Rafael Salomon (Rafael Salomon)
Created: 09/09/2014
Components: Database
Versions: 10.0
Failure Type:
Found In Build/Fixed In Build: Final /
Priority/Frequency: Major / All users will encounter
Locale/System: English / Win 2008 Server R2 64 bit
Vote Count: 0
Problem Description: using datetime(0) fields in MySQL 5.6 will produce rounding errors
Steps to Reproduce:
Create test table in MySQL 5.6.4 or higher:
CREATE TABLE `test` (
`id` int(11) NOT NULL,
`ts` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
Create timestamp:
<cfset ts = ParseDateTime("2014-09-09 08:47:34.997")>
Insert timestamp into test table:
<cfquery>
INSERT INTO test
(
id,
ts
)
VALUES
(
1,
<cfqueryparam value="#ts#" cfsqltype="cf_sql_timestamp">
)
</cfquery>
retrieve timestamp:
<cfquery name="test" datasource="#application.logdatasource#">
SELECT ts
FROM test
WHERE id = 1
</cfquery>
compare cf timestamp to database ts:
<cfoutput>#(ts EQ test.ts)#</cfoutput>
Actual Result:
NO
Expected Result:
YES
Any Workarounds:
You can change the database field to datetime(3) or you can use DateFormat() and TimeFormat() to generate a timestamp string without milliseconds and insert that into the database.
----------------------------- Additional Watson Details -----------------------------
Watson Bug ID: 3821118
External Customer Info:
External Company:
External Customer Name: Rafael Salomon
External Customer Email:
External Test Config: My Hardware and Environment details:
Windows 2008 Server R2 64 bit
Attachments:
Comments: