Bug #68087 [Asn->Csd]: ODBC not reading DATE columns correctly

From: Date: Tue, 07 Oct 2014 21:24:31 +0000
Subject: Bug #68087 [Asn->Csd]: ODBC not reading DATE columns correctly
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187921@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 Updated by: keyur@php.net Reported by: keyur@php.net Summary: ODBC not reading DATE columns correctly -Status: Assigned +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: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#187921) next »