|
11 | 11 | * |
12 | 12 | * |
13 | 13 | * IDENTIFICATION |
14 | | - * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.201 2000/10/29 16:11:33 petere Exp $ |
| 14 | + * $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.202 2000/10/31 10:22:10 petere Exp $ |
15 | 15 | * |
16 | 16 | * HISTORY |
17 | 17 | * AUTHOR DATE MAJOR EVENT |
@@ -353,7 +353,7 @@ static void doNegateFloat(Value *v); |
353 | 353 | %token UNIONJOIN |
354 | 354 |
|
355 | 355 | /* Special keywords, not in the query language - see the "lex" file */ |
356 | | -%token <str> IDENT, FCONST, SCONST, Op |
| 356 | +%token <str> IDENT, FCONST, SCONST, BITCONST, Op |
357 | 357 | %token <ival> ICONST, PARAM |
358 | 358 |
|
359 | 359 | /* these are not real. they are here so that they get generated as #define's*/ |
@@ -1798,6 +1798,10 @@ TriggerFuncArg: ICONST |
1798 | 1798 | { |
1799 | 1799 | $$ = makeString($1); |
1800 | 1800 | } |
| 1801 | + | BITCONST |
| 1802 | + { |
| 1803 | + $$ = makeString($1); |
| 1804 | + } |
1801 | 1805 | | ColId |
1802 | 1806 | { |
1803 | 1807 | $$ = makeString($1); |
@@ -4786,17 +4790,20 @@ c_expr: attr |
4786 | 4790 | } |
4787 | 4791 | | POSITION '(' position_list ')' |
4788 | 4792 | { |
| 4793 | + /* position(A in B) is converted to position(B, A) */ |
4789 | 4794 | FuncCall *n = makeNode(FuncCall); |
4790 | | - n->funcname = "strpos"; |
| 4795 | + n->funcname = "position"; |
4791 | 4796 | n->args = $3; |
4792 | 4797 | n->agg_star = FALSE; |
4793 | 4798 | n->agg_distinct = FALSE; |
4794 | 4799 | $$ = (Node *)n; |
4795 | 4800 | } |
4796 | 4801 | | SUBSTRING '(' substr_list ')' |
4797 | 4802 | { |
| 4803 | + /* substring(A from B for C) is converted to |
| 4804 | + * substring(A, B, C) */ |
4798 | 4805 | FuncCall *n = makeNode(FuncCall); |
4799 | | - n->funcname = "substr"; |
| 4806 | + n->funcname = "substring"; |
4800 | 4807 | n->args = $3; |
4801 | 4808 | n->agg_star = FALSE; |
4802 | 4809 | n->agg_distinct = FALSE; |
@@ -5201,6 +5208,13 @@ AexprConst: Iconst |
5201 | 5208 | n->val.val.str = $1; |
5202 | 5209 | $$ = (Node *)n; |
5203 | 5210 | } |
| 5211 | + | BITCONST |
| 5212 | + { |
| 5213 | + A_Const *n = makeNode(A_Const); |
| 5214 | + n->val.type = T_BitString; |
| 5215 | + n->val.val.str = $1; |
| 5216 | + $$ = (Node *)n; |
| 5217 | + } |
5204 | 5218 | /* This rule formerly used Typename, |
5205 | 5219 | * but that causes reduce conflicts with subscripted column names. |
5206 | 5220 | * Now, separate into ConstTypename and ConstInterval, |
|
0 commit comments