Improve nested query support and add recognition of 'IN' keyword

This commit is contained in:
Sara Golemon
2007-10-30 18:20:04 +00:00
parent 117ebd0e3f
commit 5a10059d8d
5 changed files with 1352 additions and 1236 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -88,10 +88,11 @@
#define PU_OUTER 88
#define PU_LEFT 89
#define PU_RIGHT 90
#define PU_NOT_EQUAL 91
#define PU_UNEQUAL 92
#define PU_LESSER_EQUAL 93
#define PU_COLON 94
#define PU_DNUM 95
#define PU_ASC 96
#define PU_DESC 97
#define PU_IN 91
#define PU_NOT_EQUAL 92
#define PU_UNEQUAL 93
#define PU_LESSER_EQUAL 94
#define PU_COLON 95
#define PU_DNUM 96
#define PU_ASC 97
#define PU_DESC 98

View File

@@ -554,6 +554,7 @@ cond(R) ::= cond(A) AND cond(B). { DO_COND(R, "and", A, B); }
cond(R) ::= cond(A) OR cond(B). { DO_COND(R, "or", A, B); }
cond(R) ::= cond(A) XOR cond(B). { DO_COND(R, "xor", A, B); }
cond(R) ::= expr(A) IN inexpr(B). { DO_COND(R, "IN", A, B); }
cond(R) ::= expr(A) EQUALS expr(B). { DO_COND(R, "=", A, B); }
cond(R) ::= expr(A) NOT_EQUAL expr(B). { DO_COND(R, "!=", A, B); }
cond(R) ::= expr(A) UNEQUAL expr(B). { DO_COND(R, "<>", A, B); }
@@ -589,6 +590,10 @@ expr(R) ::= expr(A) DIV expr(B). { DO_MATHOP(R,A,"/",B); }
expr(R) ::= expr(A) MOD expr(B). { DO_MATHOP(R,A,"%",B); }
expr(R) ::= DISTINCT expr(E). { MAKE_STD_ZVAL(R); array_init(R); add_assoc_stringl(R, "type", "distinct", sizeof("distinct") - 1, 1); add_assoc_zval(R, "distinct", E); }
%destructor inexpr { zval_ptr_dtor(&$$); }
inexpr(R) ::= LPAREN grouplist(L) RPAREN. { R = L; }
inexpr(R) ::= LPAREN selectstatement(L) RPAREN. { R = L; }
%destructor intnum { zval_ptr_dtor(&$$); }
intnum(R) ::= LNUM(L). { R = pusp_zvalize_lnum(&L); }
intnum(R) ::= HNUM(H). { R = pusp_zvalize_hnum(&H); }

File diff suppressed because it is too large Load Diff

View File

@@ -207,6 +207,7 @@ int php_pdo_user_sql_get_token(php_pdo_user_sql_tokenizer *t, php_pdo_user_sql_t
'desc' { RET(PU_DESC); }
'unsigned' { RET(PU_UNSIGNED); }
'zerofill' { RET(PU_ZEROFILL); }
'in' { RET(PU_IN); }
/* SQL Types */
'bit' { RET(PU_BIT); }