Doc #79579 [NEW]: odbc_exec does not prepare the SQL statement
| From: | ondrej dot popelka at keboola dot com | Date: | Sun, 10 May 2020 09:01:10 +0000 |
| Subject: | Doc #79579 [NEW]: odbc_exec does not prepare the SQL statement | ||
| Groups: | php.doc.bugs | ||
| Request: | Send a blank email to doc-bugs+get-17558@lists.php.net to get a copy of this message | ||
From: ondrej dot popelka at keboola dot com
Operating system: Irrelevant
PHP version: Irrelevant
Package: ODBC related
Bug Type: Documentation Problem
Bug description:odbc_exec does not prepare the SQL statement
Description:
------------
The documentation for odbc_exec states that it does "Prepare and execute
an SQL statement". From the behavior and source code
https://github.com/php/php-src/blob/a07e75aa65e6658e8180e261a4ee29bc5caa4f56/ext/odbc/php_odbc.c#L1357
it looks that it only executes the provided statement.
I understand that there may be some dispute in what "prepare" means.
From the ODBC Spec
http://www.simba.com/wp-content/uploads/2016/03/ODBC_specification.pdf
Page 81-82) abbreviated:
"When SQLExecDirect is called, the driver:
- Modifies the SQL statement to use the data source's SQL grammar.
- Retrieves the current parameter values.
- Sends the statement to the data source for execution.
- Returns any errors."
"When SQLPrepare is called, the driver:
- Modifies the SQL statement to use the data source's SQL grammar.
- Sends the statement to the data source for preparation.
- Stores the returned access plan identifier for later execution"
The odbc_exec function does not call SQLPrepare and it does not send the
statement to the data source for preparation. Neither it returns the
access plan. Therefore it does not fulfill the operations of SQLPrepare.
Expected result:
----------------
The documentation for odbc_exec states that it does:
Directly execute an SQL statement (using SQLExecDirect as specified in
ODBC 1.0 Standard)
--
Edit bug report at https://bugs.php.net/bug.php?id=79579&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79579&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79579&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79579&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79579&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79579&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79579&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79579&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79579&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79579&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79579&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79579&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79579&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79579&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79579&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79579&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79579&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79579&r=mysqlcfg