update the .re file for PDO

This commit is contained in:
Stanislav Malyshev 2015-01-27 13:48:02 -08:00
parent 7d663aa90c
commit 598c935245
2 changed files with 33 additions and 12 deletions

View File

@ -1,4 +1,5 @@
/* Generated by re2c 0.13.5 */
/* Generated by re2c 0.13.7.5 */
#line 1 "ext/pdo/pdo_sql_parser.re"
/*
+----------------------------------------------------------------------+
| PHP Version 7 |
@ -46,9 +47,11 @@ static int scan(Scanner *s)
char *cursor = s->cur;
s->tok = cursor;
#line 55 "ext/pdo/pdo_sql_parser.re"
#line 55 "ext/pdo/pdo_sql_parser.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@ -67,16 +70,19 @@ static int scan(Scanner *s)
}
yy2:
YYCURSOR = YYMARKER;
switch (yyaccept) {
case 0: goto yy4;
case 1: goto yy10;
if (yyaccept == 0) {
goto yy4;
} else {
goto yy10;
}
yy3:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
if (yych >= 0x01) goto yy43;
yy4:
#line 63 "ext/pdo/pdo_sql_parser.re"
{ SKIP_ONE(PDO_PARSER_TEXT); }
#line 86 "ext/pdo/pdo_sql_parser.c"
yy5:
yyaccept = 0;
yych = *(YYMARKER = ++YYCURSOR);
@ -158,7 +164,9 @@ yy7:
default: goto yy8;
}
yy8:
#line 62 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_BIND_POS); }
#line 170 "ext/pdo/pdo_sql_parser.c"
yy9:
++YYCURSOR;
switch ((yych = *YYCURSOR)) {
@ -166,7 +174,9 @@ yy9:
default: goto yy13;
}
yy10:
#line 65 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
#line 180 "ext/pdo/pdo_sql_parser.c"
yy11:
yych = *++YYCURSOR;
switch (yych) {
@ -201,7 +211,9 @@ yy14:
default: goto yy14;
}
yy16:
#line 64 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
#line 217 "ext/pdo/pdo_sql_parser.c"
yy17:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -279,7 +291,9 @@ yy29:
default: goto yy31;
}
yy31:
#line 60 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
#line 297 "ext/pdo/pdo_sql_parser.c"
yy32:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -351,7 +365,9 @@ yy32:
default: goto yy34;
}
yy34:
#line 61 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_BIND); }
#line 371 "ext/pdo/pdo_sql_parser.c"
yy35:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -379,7 +395,9 @@ yy39:
goto yy37;
yy40:
++YYCURSOR;
#line 59 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
#line 401 "ext/pdo/pdo_sql_parser.c"
yy42:
++YYCURSOR;
if (YYLIMIT <= YYCURSOR) YYFILL(1);
@ -399,17 +417,20 @@ yy44:
goto yy42;
yy45:
++YYCURSOR;
#line 58 "ext/pdo/pdo_sql_parser.re"
{ RET(PDO_PARSER_TEXT); }
#line 423 "ext/pdo/pdo_sql_parser.c"
}
#line 66 "ext/pdo/pdo_sql_parser.re"
}
struct placeholder {
char *pos;
char *quoted; /* quoted value */
size_t len;
int bindno;
size_t qlen; /* quoted length of value */
char *quoted; /* quoted value */
int freeq;
struct placeholder *next;
};
@ -419,7 +440,7 @@ static void free_param_name(zval *el) {
}
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
char **outquery, size_t *outquery_len)
char **outquery, size_t *outquery_len)
{
Scanner s;
char *ptr, *newbuffer;

View File

@ -68,9 +68,9 @@ static int scan(Scanner *s)
struct placeholder {
char *pos;
int len;
size_t len;
int bindno;
int qlen; /* quoted length of value */
size_t qlen; /* quoted length of value */
char *quoted; /* quoted value */
int freeq;
struct placeholder *next;
@ -80,15 +80,15 @@ static void free_param_name(zval *el) {
efree(Z_PTR_P(el));
}
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, int inquery_len,
char **outquery, int *outquery_len)
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
char **outquery, size_t *outquery_len)
{
Scanner s;
char *ptr, *newbuffer;
int t;
int bindno = 0;
int ret = 0;
int newbuffer_len;
size_t newbuffer_len;
HashTable *params;
struct pdo_bound_param_data *param;
int query_type = PDO_PLACEHOLDER_NONE;