summaryrefslogtreecommitdiff
path: root/ext/pdo/pdo_sql_parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo/pdo_sql_parser.c')
-rw-r--r--ext/pdo/pdo_sql_parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 10484f059b..ece456c0a5 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -1,5 +1,5 @@
-/* Generated by re2c 0.9.3 on Thu Jan 20 22:49:12 2005 */
-#line 1 "pdo_sql_parser.re"
+/* Generated by re2c 0.9.3 on Sun Feb 6 01:46:44 2005 */
+#line 1 "pdo_sql_parser.re"
/*
+----------------------------------------------------------------------+
| PHP Version 5 |
@@ -275,6 +275,13 @@ PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
params = stmt->bound_params;
+ /* Do we have placeholders but no bound params */
+ if (bindno && !params) {
+ strcpy(stmt->error_code, "HY093"); /* invalid parameter number */
+ ret = -1;
+ goto clean_up;
+ }
+
/* what are we going to do ? */
if (stmt->supports_placeholders == PDO_PLACEHOLDER_NONE) {