1 --- pgsql/src/pl/plpgsql/src/gram.y 2005/01/21 00:31:21 1.48.2.1
2 +++ pgsql/src/pl/plpgsql/src/gram.y 2005/02/07 03:55:28 1.48.2.2
10 * This software is copyrighted by Jan Wieck - Hamburg.
12 @@ -1711,6 +1711,15 @@ read_sql_construct(int until,
13 plpgsql_dstring_append(&ds, yytext);
17 + /* Check for array overflow */
18 + if (nparams >= 1024)
20 + plpgsql_error_lineno = lno;
22 + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
23 + errmsg("too many variables specified in SQL statement")));
27 expr = malloc(sizeof(PLpgSQL_expr) + sizeof(int) * nparams - sizeof(int));
28 @@ -1856,6 +1865,15 @@ make_select_stmt(void)
30 while ((tok = yylex()) == ',')
32 + /* Check for array overflow */
33 + if (nfields >= 1024)
35 + plpgsql_error_lineno = plpgsql_scanner_lineno();
37 + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
38 + errmsg("too many INTO variables specified")));
44 @@ -1918,6 +1936,15 @@ make_select_stmt(void)
45 plpgsql_dstring_append(&ds, yytext);
49 + /* Check for array overflow */
50 + if (nparams >= 1024)
52 + plpgsql_error_lineno = plpgsql_scanner_lineno();
54 + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
55 + errmsg("too many variables specified in SQL statement")));
59 expr = malloc(sizeof(PLpgSQL_expr) + sizeof(int) * nparams - sizeof(int));
60 @@ -1989,6 +2016,15 @@ make_fetch_stmt(void)
62 while ((tok = yylex()) == ',')
64 + /* Check for array overflow */
65 + if (nfields >= 1024)
67 + plpgsql_error_lineno = plpgsql_scanner_lineno();
69 + (errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
70 + errmsg("too many INTO variables specified")));