Bug #68087 [Com]: ODBC not reading DATE columns correctly
| From: | keyur@php.net | Date: | Tue, 23 Sep 2014 21:25:17 +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-187685@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: Assigned
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:
Proposed patch: https://gist.github.com/keyurdg/60e9fb2f97c45c725458
Previous Comments:
------------------------------------------------------------------------
[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