Doc #79579 [Opn->Csd]: odbc_exec does not prepare the SQL statement
| From: | phpdocbot@php.net | Date: | Mon, 11 May 2020 07:40:13 +0000 |
| Subject: | Doc #79579 [Opn->Csd]: odbc_exec does not prepare the SQL statement | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17561@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79579&edit=1
ID: 79579
Updated by: phpdocbot@php.net
Reported by: ondrej dot popelka at keboola dot com
Summary: odbc_exec does not prepare the SQL statement
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: ODBC related
Operating System: Irrelevant
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=1098a2f35d41a1bb3bbab63a02e671d9d7a8e4ee
Log: Fix #79579: odbc_exec does not prepare the SQL statement
Previous Comments:
------------------------------------------------------------------------
[2020-05-10 09:01:10] ondrej dot popelka at keboola dot com
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 this bug report at https://bugs.php.net/bug.php?id=79579&edit=1