mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Added missing check for mismatching number of tokens & bound params in
prepared statement emulation.
This commit is contained in:
parent
b6bdd44962
commit
44baca5aed
@ -1,4 +1,4 @@
|
|||||||
/* Generated by re2c 0.10.6 on Thu Nov 23 09:39:04 2006 */
|
/* Generated by re2c 0.10.6 on Sun Dec 3 18:24:46 2006 */
|
||||||
#line 1 "ext/pdo/pdo_sql_parser.re"
|
#line 1 "ext/pdo/pdo_sql_parser.re"
|
||||||
/*
|
/*
|
||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
@ -352,7 +352,6 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
|
|||||||
goto clean_up;
|
goto clean_up;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
|
if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
|
||||||
/* query matches native syntax */
|
/* query matches native syntax */
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -376,7 +375,13 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
goto clean_up;
|
goto clean_up;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params && bindno != zend_hash_num_elements(params) && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
||||||
|
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens" TSRMLS_CC);
|
||||||
|
ret = -1;
|
||||||
|
goto clean_up;
|
||||||
|
}
|
||||||
|
|
||||||
/* what are we going to do ? */
|
/* what are we going to do ? */
|
||||||
|
|
||||||
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
||||||
|
@ -132,7 +132,6 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
|
|||||||
goto clean_up;
|
goto clean_up;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
|
if (stmt->supports_placeholders == query_type && !stmt->named_rewrite_template) {
|
||||||
/* query matches native syntax */
|
/* query matches native syntax */
|
||||||
ret = 0;
|
ret = 0;
|
||||||
@ -156,7 +155,13 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
goto clean_up;
|
goto clean_up;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params && bindno != zend_hash_num_elements(params) && stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
||||||
|
pdo_raise_impl_error(stmt->dbh, stmt, "HY093", "number of bound variables does not match number of tokens" TSRMLS_CC);
|
||||||
|
ret = -1;
|
||||||
|
goto clean_up;
|
||||||
|
}
|
||||||
|
|
||||||
/* what are we going to do ? */
|
/* what are we going to do ? */
|
||||||
|
|
||||||
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {
|
||||||
|
Loading…
Reference in New Issue
Block a user