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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mjh at hodginsmedia dot com
New email:
PHP Version: OS:

 

 [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)

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Mon Feb 03 01:01:31 2025 UTC