summaryrefslogtreecommitdiff
path: root/ext/pdo
diff options
context:
space:
mode:
authorMichael Wallner <mike@php.net>2013-08-20 19:22:31 +0200
committerMichael Wallner <mike@php.net>2013-08-20 19:22:31 +0200
commit90218e8e7a19315f25850ee32b476b30848dccef (patch)
treef1de3a9bdab0e0125e33013454b353f0040d743a /ext/pdo
parent827100df823e5a36c97b808407e775f5d203164c (diff)
parent7f3e7eb95812649fd421b405990a96091010b8e9 (diff)
downloadphp-git-90218e8e7a19315f25850ee32b476b30848dccef.tar.gz
Merge branch 'PHP-5.5'
* PHP-5.5: Fix bug #64953 (Postgres prepared statement positional parameter casting)
Diffstat (limited to 'ext/pdo')
-rw-r--r--ext/pdo/pdo_sql_parser.c61
-rw-r--r--ext/pdo/pdo_sql_parser.re4
2 files changed, 35 insertions, 30 deletions
diff --git a/ext/pdo/pdo_sql_parser.c b/ext/pdo/pdo_sql_parser.c
index 37c71987a9..aea362fdb2 100644
--- a/ext/pdo/pdo_sql_parser.c
+++ b/ext/pdo/pdo_sql_parser.c
@@ -77,7 +77,7 @@ yy2:
yy3:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
- if (yych >= 0x01) goto yy41;
+ if (yych >= 0x01) goto yy43;
yy4:
#line 63 "ext/pdo/pdo_sql_parser.re"
{ SKIP_ONE(PDO_PARSER_TEXT); }
@@ -86,7 +86,7 @@ yy5:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych <= 0x00) goto yy4;
- goto yy36;
+ goto yy38;
yy6:
yych = *++YYCURSOR;
switch (yych) {
@@ -153,21 +153,19 @@ yy6:
case 'x':
case 'y':
case 'z': goto yy32;
- case ':':
- case '?': goto yy29;
+ case ':': goto yy35;
default: goto yy4;
}
yy7:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
- case ':':
case '?': goto yy29;
default: goto yy8;
}
yy8:
#line 62 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_BIND_POS); }
-#line 171 "ext/pdo/pdo_sql_parser.c"
+#line 169 "ext/pdo/pdo_sql_parser.c"
yy9:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
@@ -177,7 +175,7 @@ yy9:
yy10:
#line 65 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
-#line 181 "ext/pdo/pdo_sql_parser.c"
+#line 179 "ext/pdo/pdo_sql_parser.c"
yy11:
yych = *++YYCURSOR;
switch (yych) {
@@ -214,7 +212,7 @@ yy14:
yy16:
#line 64 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
-#line 218 "ext/pdo/pdo_sql_parser.c"
+#line 216 "ext/pdo/pdo_sql_parser.c"
yy17:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -288,14 +286,13 @@ yy29:
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
switch (yych) {
- case ':':
case '?': goto yy29;
default: goto yy31;
}
yy31:
#line 60 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
-#line 299 "ext/pdo/pdo_sql_parser.c"
+#line 296 "ext/pdo/pdo_sql_parser.c"
yy32:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@@ -369,51 +366,59 @@ yy32:
yy34:
#line 61 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_BIND); }
-#line 373 "ext/pdo/pdo_sql_parser.c"
+#line 370 "ext/pdo/pdo_sql_parser.c"
yy35:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-yy36:
switch (yych) {
- case 0x00: goto yy2;
- case '\'': goto yy38;
- case '\\': goto yy37;
- default: goto yy35;
+ case ':': goto yy35;
+ default: goto yy31;
}
yy37:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
- if (yych <= 0x00) goto yy2;
- goto yy35;
yy38:
+ switch (yych) {
+ case 0x00: goto yy2;
+ case '\'': goto yy40;
+ case '\\': goto yy39;
+ default: goto yy37;
+ }
+yy39:
+ ++YYCURSOR;
+ if (YYLIMIT <= YYCURSOR) YYFILL(1);
+ yych = *YYCURSOR;
+ if (yych <= 0x00) goto yy2;
+ goto yy37;
+yy40:
++YYCURSOR;
#line 59 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
-#line 395 "ext/pdo/pdo_sql_parser.c"
-yy40:
+#line 400 "ext/pdo/pdo_sql_parser.c"
+yy42:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
-yy41:
+yy43:
switch (yych) {
case 0x00: goto yy2;
- case '"': goto yy43;
- case '\\': goto yy42;
- default: goto yy40;
+ case '"': goto yy45;
+ case '\\': goto yy44;
+ default: goto yy42;
}
-yy42:
+yy44:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
yych = *YYCURSOR;
if (yych <= 0x00) goto yy2;
- goto yy40;
-yy43:
+ goto yy42;
+yy45:
++YYCURSOR;
#line 58 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
-#line 417 "ext/pdo/pdo_sql_parser.c"
+#line 422 "ext/pdo/pdo_sql_parser.c"
}
#line 66 "ext/pdo/pdo_sql_parser.re"
diff --git a/ext/pdo/pdo_sql_parser.re b/ext/pdo/pdo_sql_parser.re
index 80e3b4f95f..1936a37340 100644
--- a/ext/pdo/pdo_sql_parser.re
+++ b/ext/pdo/pdo_sql_parser.re
@@ -50,14 +50,14 @@ static int scan(Scanner *s)
QUESTION = [?];
COMMENTS = ("/*"([^*]+|[*]+[^/*])*[*]*"*/"|"--"[^\r\n]*);
SPECIALS = [:?"'];
- MULTICHAR = [:?];
+ MULTICHAR = ([:]{2,}|[?]{2,});
ANYNOEOF = [\001-\377];
*/
/*!re2c
(["](([\\]ANYNOEOF)|ANYNOEOF\["\\])*["]) { RET(PDO_PARSER_TEXT); }
(['](([\\]ANYNOEOF)|ANYNOEOF\['\\])*[']) { RET(PDO_PARSER_TEXT); }
- MULTICHAR{2,} { RET(PDO_PARSER_TEXT); }
+ MULTICHAR { RET(PDO_PARSER_TEXT); }
BINDCHR { RET(PDO_PARSER_BIND); }
QUESTION { RET(PDO_PARSER_BIND_POS); }
SPECIALS { SKIP_ONE(PDO_PARSER_TEXT); }