#47450 [Opn]: ODBC bug
| From: | stefan at konink dot de | Date: | Thu, 19 Feb 2009 22:03:13 +0000 |
| Subject: | #47450 [Opn]: ODBC bug | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-134014@lists.php.net to get a copy of this message | ||
ID: 47450
User updated by: stefan at konink dot de
Reported By: stefan at konink dot de
Status: Open
Bug Type: ODBC related
Operating System: Linux
PHP Version: 5.3.0beta1
New Comment:
Replace last PHP with ODBC driver.
Previous Comments:
------------------------------------------------------------------------
[2009-02-19 21:58:18] stefan at konink dot de
Check ODBC specs of Microsoft.
ParameterType Argument
This must be one of the values listed in the SQL Data Types section of
Appendix D: Data Types, or it must be a driver-specific value. This
argument sets the SQL_DESC_TYPE, SQL_DESC_CONCISE_TYPE, and
SQL_DESC_DATETIME_INTERVAL_CODE fields of the IPD.
If the ParameterType argument is one of the datetime identifiers, the
SQL_DESC_TYPE field of the IPD is set to SQL_DATETIME, the
SQL_DESC_CONCISE_TYPE field of the IPD is set to the concise datetime
SQL data type, and the SQL_DESC_DATETIME_INTERVAL_CODE field is set to
the appropriate datetime subcode value.
If ParameterType is one of the interval identifiers, the SQL_DESC_TYPE
field of the IPD is set to SQL_INTERVAL, the SQL_DESC_CONCISE_TYPE field
of the IPD is set to the concise SQL interval data type, and the
SQL_DESC_DATETIME_INTERVAL_CODE field of the IPD is set to the
appropriate interval subcode. The SQL_DESC_DATETIME_INTERVAL_PRECISION
field of the IPD is set to the interval leading precision, and the
SQL_DESC_PRECISION field is set to the interval seconds precision, if
applicable. If the default value of SQL_DESC_DATETIME_INTERVAL_PRECISION
or SQL_DESC_PRECISION is not appropriate, the application should
explicitly set it by calling SQLSetDescField. For more information about
any of these fields, see SQLSetDescField.
If the ValueType argument is a SQL_NUMERIC data type, the default
precision (which is driver-defined) and the default scale (0), as set in
the SQL_DESC_PRECISION and SQL_DESC_SCALE fields of the IPD, are used
for the data. If the default precision or scale is not appropriate, the
application should explicitly set the descriptor field by a call to
SQLSetDescField or SQLSetDescRec.
For information about how data is converted, see Converting Data from C
to SQL Data Types and Converting Data from SQL to C Data Types in
Appendix D: Data Types.
PHP always passes '0'... thus a 'strict' implementation of PHP results
in the error mentioned earlier.
------------------------------------------------------------------------
[2009-02-19 21:42:37] jani@php.net
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php
If you can provide more information, feel free to add it
to this bug and change the status back to "Open".
Thank you for your interest in PHP.
------------------------------------------------------------------------
[2009-02-19 15:35:33] stefan at konink dot de
Description:
------------
http://bugs.php.net/6275
Basically that bug still exists. What goes wrong is the following:
The ODBC specifications are very explicit about the ParameterType, if
it is not present aka 0, it will bug.
Reproduce code:
---------------
<?php
$a = 1;
$b = 2;
$c = 3;
$stmt = odbc_prepare($conn, 'CALL myproc(?,?,?)');
$success = odbc_execute($stmt, array($a, $b, $c));
?>
Expected result:
----------------
The expected is an integer/numeric assignment at binding.
Actual result:
--------------
0 is assigned, thus fails on any database that is explicit about this.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47450&edit=1