File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 9
9
*
10
10
*
11
11
* IDENTIFICATION
12
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.105 2007/07/25 04:19:08 neilc Exp $
12
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.106 2007/11/09 23:58:32 tgl Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -181,14 +181,12 @@ static void check_labels(const char *start_label,
181
181
%token K_LOG
182
182
%token K_LOOP
183
183
%token K_MOVE
184
- %token K_NEXT
185
184
%token K_NOSCROLL
186
185
%token K_NOT
187
186
%token K_NOTICE
188
187
%token K_NULL
189
188
%token K_OPEN
190
189
%token K_OR
191
- %token K_QUERY
192
190
%token K_PERFORM
193
191
%token K_ROW_COUNT
194
192
%token K_RAISE
@@ -1169,11 +1167,19 @@ stmt_return : K_RETURN lno
1169
1167
int tok;
1170
1168
1171
1169
tok = yylex ();
1172
- if (tok == K_NEXT)
1170
+ if (tok == 0 )
1171
+ yyerror (" unexpected end of function definition" );
1172
+
1173
+ /*
1174
+ * To avoid making NEXT and QUERY effectively be
1175
+ * reserved words within plpgsql, recognize them
1176
+ * via yytext.
1177
+ */
1178
+ if (pg_strcasecmp(yytext, " next" ) == 0 )
1173
1179
{
1174
1180
$$ = make_return_next_stmt($2 );
1175
1181
}
1176
- else if (tok == K_QUERY )
1182
+ else if (pg_strcasecmp(yytext, " query " ) == 0 )
1177
1183
{
1178
1184
$$ = make_return_query_stmt($2 );
1179
1185
}
Original file line number Diff line number Diff line change 9
9
*
10
10
*
11
11
* IDENTIFICATION
12
- * $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.58 2007/07/25 04:19:09 neilc Exp $
12
+ * $PostgreSQL: pgsql/src/pl/plpgsql/src/scan.l,v 1.59 2007/11/09 23:58:32 tgl Exp $
13
13
*
14
14
*-------------------------------------------------------------------------
15
15
*/
@@ -143,15 +143,13 @@ is { return K_IS; }
143
143
log { return K_LOG; }
144
144
loop { return K_LOOP; }
145
145
move { return K_MOVE; }
146
- next { return K_NEXT; }
147
146
no{space }+ scroll { return K_NOSCROLL; }
148
147
not { return K_NOT; }
149
148
notice { return K_NOTICE; }
150
149
null { return K_NULL; }
151
150
open { return K_OPEN; }
152
151
or { return K_OR; }
153
152
perform { return K_PERFORM; }
154
- query { return K_QUERY; }
155
153
raise { return K_RAISE; }
156
154
rename { return K_RENAME; }
157
155
result_oid { return K_RESULT_OID; }
You can’t perform that action at this time.
0 commit comments