|
4 | 4 | * procedural language
|
5 | 5 | *
|
6 | 6 | * IDENTIFICATION
|
7 |
| - * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.49 2003/11/29 19:52:12 pgsql Exp $ |
| 7 | + * $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.50 2003/12/23 00:01:57 tgl Exp $ |
8 | 8 | *
|
9 | 9 | * This software is copyrighted by Jan Wieck - Hamburg.
|
10 | 10 | *
|
@@ -628,52 +628,9 @@ decl_defval : ';'
|
628 | 628 | { $$ = NULL; }
|
629 | 629 | | decl_defkey
|
630 | 630 | {
|
631 |
| - int tok; |
632 |
| - int lno; |
633 |
| - PLpgSQL_dstring ds; |
634 |
| - PLpgSQL_expr *expr; |
635 |
| - |
636 |
| - lno = plpgsql_scanner_lineno(); |
637 |
| - expr = malloc(sizeof(PLpgSQL_expr)); |
638 |
| - plpgsql_dstring_init(&ds); |
639 |
| - plpgsql_dstring_append(&ds, "SELECT "); |
640 |
| - |
641 |
| - expr->dtype = PLPGSQL_DTYPE_EXPR; |
642 |
| - expr->plan = NULL; |
643 |
| - expr->nparams = 0; |
644 |
| - |
645 |
| - tok = yylex(); |
646 |
| - switch (tok) |
647 |
| - { |
648 |
| - case 0: |
649 |
| - yyerror("unexpected end of function"); |
650 |
| - case K_NULL: |
651 |
| - if (yylex() != ';') |
652 |
| - yyerror("expected \";\" after \"NULL\""); |
653 |
| - |
654 |
| - free(expr); |
655 |
| - plpgsql_dstring_free(&ds); |
656 |
| - |
657 |
| - $$ = NULL; |
658 |
| - break; |
659 |
| - |
660 |
| - default: |
661 |
| - plpgsql_dstring_append(&ds, yytext); |
662 |
| - while ((tok = yylex()) != ';') |
663 |
| - { |
664 |
| - if (tok == 0) |
665 |
| - yyerror("unterminated default value"); |
666 |
| - |
667 |
| - if (plpgsql_SpaceScanned) |
668 |
| - plpgsql_dstring_append(&ds, " "); |
669 |
| - plpgsql_dstring_append(&ds, yytext); |
670 |
| - } |
671 |
| - expr->query = strdup(plpgsql_dstring_get(&ds)); |
672 |
| - plpgsql_dstring_free(&ds); |
673 |
| - |
674 |
| - $$ = expr; |
675 |
| - break; |
676 |
| - } |
| 631 | + plpgsql_ns_setlocal(false); |
| 632 | + $$ = plpgsql_read_expression(';', ";"); |
| 633 | + plpgsql_ns_setlocal(true); |
677 | 634 | }
|
678 | 635 | ;
|
679 | 636 |
|
|
0 commit comments