#40289 [Opn->Fbk]: pdo_odbc Extention throws HY090 with doing binary sqlbindcol

From: Date: Tue, 30 Jan 2007 17:23:36 +0000
Subject: #40289 [Opn->Fbk]: pdo_odbc Extention throws HY090 with doing binary sqlbindcol
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-108251@lists.php.net to get a copy of this message
 ID:               40289
 Updated by:       tony2001@php.net
 Reported By:      podunk dot vn at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         PDO related
 Operating System: windows xp sp2/IIS/ASAPI
 PHP Version:      5.2.0


Previous Comments:
------------------------------------------------------------------------

[2007-01-30 17:16:51] podunk dot vn at gmail dot com

I got around this by changing the field type from VARBINARY(MAX) to
VARCHAR(MAX) in MSSQL 2005.  It would still be nice to use the new
VARBINARY(MAX) field type.

I'm downloading the latest win32 snapshot now to see if this bug is
fixed in it.

------------------------------------------------------------------------

[2007-01-30 16:14:00] tony2001@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip



------------------------------------------------------------------------

[2007-01-30 16:03:24] podunk dot vn at gmail dot com

Description:
------------
When selecting a varbinary(MAX) field from a microsoft sql 2005
database, using the Microsoft ODBC Driver Manager for SQL, and binding
the result to a PHP variable, the Driver Manager fails with the
following error:

array (
  0 => 'HY090',
  1 => 0,
  2 => '[Microsoft][ODBC Driver Manager] Invalid string or buffer
length (SQLBindCol[0] at ext\\pdo_odbc\\odbc_stmt.c:430)',
  3 => 'HY090',
)

More information on HY090 can be found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcsqlbindcol.asp

Just a guess: the BufferLength isn't being set in odbc_stmt.c
somewhere.

Reproduce code:
---------------
$stmt = $db->prepare("select data from cms_files where fid=11");
$db->execute($stmt);
$db->bindColumn($stmt, 1, $lob, PDO::PARAM_LOB);
$db->fetch_bound($stmt);

Expected result:
----------------
$lob populated with binary data.

Actual result:
--------------
Driver Manager throws:

array (
  0 => 'HY090',
  1 => 0,
  2 => '[Microsoft][ODBC Driver Manager] Invalid string or buffer
length (SQLBindCol[0] at ext\\pdo_odbc\\odbc_stmt.c:430)',
  3 => 'HY090',
)


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40289&edit=1


Thread (12 messages)

« previous php.bugs (#108251) next »