php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #54167 PDO_DBLIB returns null on SQLUNIQUE field
Submitted: 2011-03-05 08:15 UTC Modified: 2011-03-17 13:01 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: mjh at hodginsmedia dot com Assigned: felipe (profile)
Status: Closed Package: PDO related
PHP Version: 5.3.5 OS: Linux
Private report: No CVE-ID: None
 [2011-03-05 08:15 UTC] mjh at hodginsmedia dot com
Description:
------------
SQLUNIQUE (type 36) is a uniqueidentifier field in Microsoft SQL server.  It is 
presently unhandled by PDO_DBLIB, so returns NULL rather than the actual column 
value for all queries.

Patch to ext/pdo_dblib/dblib_stmt.c is attached which fixes the issue so that 
PDO_DBLIB returns the uniqueidentifier as a string.


Patches

dblib_stmt.diff (last revision 2011-03-05 07:17 UTC by mjh at hodginsmedia dot com)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-03-05 14:19 UTC] felipe@php.net
-Status: Open +Status: Feedback
 [2011-03-05 14:19 UTC] felipe@php.net
Why php_strtoupper(val->data, val->len); is needed?
 [2011-03-05 21:17 UTC] mjh at hodginsmedia dot com
-Status: Feedback +Status: Open
 [2011-03-05 21:17 UTC] mjh at hodginsmedia dot com
Value is returned from dbconvert in lowercase.  The call to php_strtoupper() normalizes the value to make it consistent with other tools.  

For example the MS SQL client tools always show the value as a string in uppercase.  Also php_mssql.c PHP function mssql_guid_string() does the same thing.
 [2011-03-06 00:07 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=308948
Log: - Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field)
# initial patch by: mjh at hodginsmedia dot com (5.3)
# trunk version by me
 [2011-03-06 00:09 UTC] felipe@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: felipe
 [2011-03-06 00:09 UTC] felipe@php.net
I've committed your patch with a trunk version as well (based in your patch)
Can you test it, please?

Thanks for the patch! :)
 [2011-03-06 14:36 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=308972
Log: - Reverted fix for bug #54167 (to be committed in soon)
 [2011-03-17 12:59 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=309343
Log: - Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field)
  patch by: mjh at hodginsmedia dot com
 [2011-03-17 13:01 UTC] felipe@php.net
-Status: Feedback +Status: Closed
 [2011-03-17 13:01 UTC] felipe@php.net
This bug has been fixed in SVN.

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/.
 
Thank you for the report, and for helping us make PHP better.

The fix will be in the 5.3.7 version.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 09:01:30 2024 UTC