Bug #67122 [NEW]: PDO::ATTR_EMULATE_PREPARES = false drops microseconds from timestamp
From: russellbarnhart at gmail dot com
Operating system: Ubuntu 12.04 & 14.04
PHP version: 5.5.11
Package: PDO MySQL
Bug Type: Bug
Bug description:PDO::ATTR_EMULATE_PREPARES = false drops microseconds from timestamp
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
--
Edit bug report at https://bugs.php.net/bug.php?id=67122&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67122&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67122&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67122&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67122&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67122&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67122&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67122&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67122&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67122&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67122&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67122&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67122&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67122&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67122&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67122&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67122&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67122&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67122&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67122&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67122&r=mysqlcfg
Thread (8 messages)
- russellbarnhart at gmail dot com