|
|
|
@ -116,7 +116,8 @@ static void check_raise_parameters(PLpgSQL_stmt_raise *stmt); |
|
|
|
|
%name-prefix="plpgsql_yy" |
|
|
|
|
%locations |
|
|
|
|
|
|
|
|
|
%union { |
|
|
|
|
%union |
|
|
|
|
{ |
|
|
|
|
core_YYSTYPE core_yystype; |
|
|
|
|
/* these fields must match core_YYSTYPE: */ |
|
|
|
|
int ival; |
|
|
|
@ -425,7 +426,7 @@ pl_block : decl_sect K_BEGIN proc_sect exception_sect K_END opt_label |
|
|
|
|
check_labels($1.label, $6, @6); |
|
|
|
|
plpgsql_ns_pop(); |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -932,7 +933,7 @@ stmt_perform : K_PERFORM |
|
|
|
|
check_sql_expr(new->expr->query, new->expr->parseMode, |
|
|
|
|
startloc + 1); |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -951,7 +952,7 @@ stmt_call : K_CALL |
|
|
|
|
/* Remember we may need a procedure resource owner */ |
|
|
|
|
plpgsql_curr_compile->requires_procedure_resowner = true; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
| K_DO |
|
|
|
@ -970,7 +971,7 @@ stmt_call : K_CALL |
|
|
|
|
/* Remember we may need a procedure resource owner */ |
|
|
|
|
plpgsql_curr_compile->requires_procedure_resowner = true; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
; |
|
|
|
@ -1010,7 +1011,7 @@ stmt_assign : T_DATUM |
|
|
|
|
false, true, true, |
|
|
|
|
NULL, NULL); |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -1072,7 +1073,7 @@ stmt_getdiag : K_GET getdiag_area_opt K_DIAGNOSTICS getdiag_list ';' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -1200,7 +1201,7 @@ stmt_if : K_IF expr_until_then proc_sect stmt_elsifs stmt_else K_END K_IF ';' |
|
|
|
|
new->elsif_list = $4; |
|
|
|
|
new->else_body = $5; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -1306,7 +1307,7 @@ stmt_loop : opt_loop_label K_LOOP loop_body |
|
|
|
|
check_labels($1, $3.end_label, $3.end_label_location); |
|
|
|
|
plpgsql_ns_pop(); |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -1325,7 +1326,7 @@ stmt_while : opt_loop_label K_WHILE expr_until_loop loop_body |
|
|
|
|
check_labels($1, $4.end_label, $4.end_label_location); |
|
|
|
|
plpgsql_ns_pop(); |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -1766,7 +1767,7 @@ stmt_exit : exit_type opt_label opt_exitcond |
|
|
|
|
parser_errposition(@1))); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -1947,7 +1948,7 @@ stmt_raise : K_RAISE |
|
|
|
|
|
|
|
|
|
check_raise_parameters(new); |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2088,7 +2089,7 @@ stmt_dynexecute : K_EXECUTE |
|
|
|
|
yyerror("syntax error"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2167,7 +2168,7 @@ stmt_open : K_OPEN cursor_variable |
|
|
|
|
new->argquery = read_cursor_args($2, ';'); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2197,7 +2198,7 @@ stmt_fetch : K_FETCH opt_fetch_direction cursor_variable K_INTO |
|
|
|
|
fetch->curvar = $3->dno; |
|
|
|
|
fetch->is_move = false; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)fetch; |
|
|
|
|
$$ = (PLpgSQL_stmt *) fetch; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2209,7 +2210,7 @@ stmt_move : K_MOVE opt_fetch_direction cursor_variable ';' |
|
|
|
|
fetch->curvar = $3->dno; |
|
|
|
|
fetch->is_move = true; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)fetch; |
|
|
|
|
$$ = (PLpgSQL_stmt *) fetch; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2229,7 +2230,7 @@ stmt_close : K_CLOSE cursor_variable ';' |
|
|
|
|
new->stmtid = ++plpgsql_curr_compile->nstatements; |
|
|
|
|
new->curvar = $2->dno; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2250,7 +2251,7 @@ stmt_commit : K_COMMIT opt_transaction_chain ';' |
|
|
|
|
new->stmtid = ++plpgsql_curr_compile->nstatements; |
|
|
|
|
new->chain = $2; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -2264,7 +2265,7 @@ stmt_rollback : K_ROLLBACK opt_transaction_chain ';' |
|
|
|
|
new->stmtid = ++plpgsql_curr_compile->nstatements; |
|
|
|
|
new->chain = $2; |
|
|
|
|
|
|
|
|
|
$$ = (PLpgSQL_stmt *)new; |
|
|
|
|
$$ = (PLpgSQL_stmt *) new; |
|
|
|
|
} |
|
|
|
|
; |
|
|
|
|
|
|
|
|
@ -3587,7 +3588,7 @@ read_into_scalar_list(char *initial_name, |
|
|
|
|
row->varnos[nfields] = varnos[nfields]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
plpgsql_adddatum((PLpgSQL_datum *)row); |
|
|
|
|
plpgsql_adddatum((PLpgSQL_datum *) row); |
|
|
|
|
|
|
|
|
|
return row; |
|
|
|
|
} |
|
|
|
@ -3619,7 +3620,7 @@ make_scalar_list1(char *initial_name, |
|
|
|
|
row->fieldnames[0] = initial_name; |
|
|
|
|
row->varnos[0] = initial_datum->dno; |
|
|
|
|
|
|
|
|
|
plpgsql_adddatum((PLpgSQL_datum *)row); |
|
|
|
|
plpgsql_adddatum((PLpgSQL_datum *) row); |
|
|
|
|
|
|
|
|
|
return row; |
|
|
|
|
} |
|
|
|
|