php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67122 PDO::ATTR_EMULATE_PREPARES = false drops microseconds from timestamp
Submitted: 2014-04-23 22:16 UTC Modified: -
Votes:7
Avg. Score:4.3 ± 0.9
Reproduced:7 of 7 (100.0%)
Same Version:2 (28.6%)
Same OS:1 (14.3%)
From: russellbarnhart at gmail dot com Assigned:
Status: Open Package: PDO MySQL
PHP Version: 5.5.11 OS: Ubuntu 12.04 & 14.04
Private report: No CVE-ID:
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: russellbarnhart at gmail dot com
New email:
PHP Version: OS:

 

 [2014-04-23 22:16 UTC] russellbarnhart at gmail dot com
Description:
------------
This is only relevant on the newer versions of mysql/mariaDB that support microsecond precision on timestamp columns.

minimum Mysql version: 5.6.4
minimum MariaDB version: 5.3

When the PDO attribute ATTR_EMULATE_PREPARES is false, any microseconds are dropped from timestamp columns.

I'm using:

MariaDB v10.0.10: mysql  Ver 15.1 Distrib 10.0.10-MariaDB, for debian-linux-gnu (x86_64) using readline 5.1

PHP 5.5.11-3+deb.sury.org~precise+1 (cli) (built: Apr 23 2014 12:23:08)
(also tested on PHP 5.5.9-1ubuntu4 (cli) (built: Apr  9 2014 17:11:57))

mysqlnd v5.0.11-dev

Test script:
---------------
https://gist.github.com/sndsgd/11234272

Expected result:
----------------
PDO::ATTR_EMULATE_PREPARES = true:
2014-04-23 08:45:36.022588
PDO::ATTR_EMULATE_PREPARES = false:
2014-04-23 08:45:36.022588

Actual result:
--------------
PDO::ATTR_EMULATE_PREPARES = true:
2014-04-23 08:45:36.022588
PDO::ATTR_EMULATE_PREPARES = false:
2014-04-23 08:45:36

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-16 06:42 UTC] webmaster at etherframegames dot com
Any updates on this? I can confirm that it still exists as of 7.1.5
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Tue Aug 29 15:01:52 2017 UTC