Bug #68087 [Com]: ODBC not reading DATE columns correctly
| From: | keyur@php.net | Date: | Mon, 20 Oct 2014 16:37:53 +0000 |
| Subject: | Bug #68087 [Com]: ODBC not reading DATE columns correctly | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188201@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68087&edit=1
ID: 68087
Comment by: keyur@php.net
Reported by: keyur@php.net
Summary: ODBC not reading DATE columns correctly
Status: Closed
Type: Bug
Package: ODBC related
Operating System: Linux
PHP Version: 5.4.33
Assigned To: keyur
Block user comment: N
Private report: N
New Comment:
5.4 is closed for everything but security fixes, so I didn't push it there.
The patch is queued for the next 5.5 and 5.6 release: 5.5.19
(https://github.com/php/php-src/blob/PHP-5.5/NEWS) and 5.6.3
(https://github.com/php/php-src/blob/PHP-5.6/NEWS)
Previous Comments:
------------------------------------------------------------------------
[2014-10-20 16:13:58] j dot faitw at yahoo dot com
I notice that this fix did not make it into the recent 5.6.2 or 5.5.18 releases(and not committed to
5.4).
Is this intentional?
If so is it likely to make it into 5.6.3?
------------------------------------------------------------------------
[2014-10-07 21:24:31] keyur@php.net
The fix for this bug has been committed.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
For Windows:
http://windows.php.net/snapshots/
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2014-09-23 21:25:17] keyur@php.net
Proposed patch: https://gist.github.com/keyurdg/60e9fb2f97c45c725458
------------------------------------------------------------------------
[2014-09-23 19:37:58] keyur@php.net
Flipping the order in the SELECT is a temporary workaround:
SELECT month, country FROM table;
------------------------------------------------------------------------
[2014-09-23 19:36:33] keyur@php.net
Description:
------------
SQL_DATE column data is coming back corrupted when it follows a WVARCHAR column in the SELECT
statement.
Test script:
---------------
We have a test table with 2 columns: COUNTRY (WVARCHAR) and MONTH (DATE) and execute the statement:
SELECT country, month FROM table;
Expected result:
----------------
Month should be the full date: yyyy-mm-dd
Actual result:
--------------
Month is corrupted: yyyy-mm<4 bytes of junk>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68087&edit=1