]> granicus.if.org Git - postgresql/commitdiff
Minor cleanup for recent SQLSTATE / SQLERRM patch: spell "successful"
authorNeil Conway <neilc@samurai.com>
Thu, 26 May 2005 03:18:53 +0000 (03:18 +0000)
committerNeil Conway <neilc@samurai.com>
Thu, 26 May 2005 03:18:53 +0000 (03:18 +0000)
correctly, style fixes.

src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/pl_exec.c
src/test/regress/expected/plpgsql.out
src/test/regress/sql/plpgsql.sql

index d4a535d548be4de860822506f97023afdd61ed23..39a7a01bebe3fc37e808fcc167de98f6bad77d0d 100644 (file)
@@ -4,7 +4,7 @@
  *                                               procedural language
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.70 2005/05/26 00:16:31 momjian Exp $
+ *       $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.71 2005/05/26 03:18:53 neilc Exp $
  *
  *       This software is copyrighted by Jan Wieck - Hamburg.
  *
@@ -285,7 +285,8 @@ fict_vars_sect      :
                                                                                 plpgsql_build_datatype(TEXTOID, -1), true);  
                                                $$.sqlerrm_varno = var->dno;
                                                plpgsql_add_initdatums(NULL);
-                                       };
+                                       }
+                               ;
 
 decl_sect              : opt_label
                                        {
index 333ca21c0ba988e1d0769b808c5d1a0a095590fe..c602da21601f7b196b89aa541c27324dbe3b20c3 100644 (file)
@@ -3,7 +3,7 @@
  *                       procedural language
  *
  * IDENTIFICATION
- *       $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.139 2005/05/26 00:16:31 momjian Exp $
+ *       $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.140 2005/05/26 03:18:53 neilc Exp $
  *
  *       This software is copyrighted by Jan Wieck - Hamburg.
  *
@@ -760,7 +760,7 @@ exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block)
        var = (PLpgSQL_var *) (estate->datums[block->sqlerrm_varno]);
        var->isnull = false;
        var->freeval = true;
-       var->value = DirectFunctionCall1(textin, CStringGetDatum("Sucessful completion"));
+       var->value = DirectFunctionCall1(textin, CStringGetDatum("Successful completion"));
 
        /*
         * First initialize all variables declared in this block
@@ -777,7 +777,7 @@ exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block)
 
                                        if (var->freeval)
                                        {
-                                               pfree((void *) (var->value));
+                                               pfree(DatumGetPointer(var->value));
                                                var->freeval = false;
                                        }
 
@@ -872,13 +872,12 @@ exec_stmt_block(PLpgSQL_execstate *estate, PLpgSQL_stmt_block *block)
                        CurrentResourceOwner = oldowner;
  
                        /* set SQLSTATE and SQLERRM variables */
-                   
                        var = (PLpgSQL_var *) (estate->datums[block->sqlstate_varno]);
-                       pfree((void *) (var->value));
+                       pfree(DatumGetPointer(var->value));
                        var->value = DirectFunctionCall1(textin, CStringGetDatum(unpack_sql_state(edata->sqlerrcode)));
-  
+
                        var = (PLpgSQL_var *) (estate->datums[block->sqlerrm_varno]);
-                       pfree((void *) (var->value));
+                       pfree(DatumGetPointer(var->value));
                        var->value = DirectFunctionCall1(textin, CStringGetDatum(edata->message));
 
                        /*
index 5ee5c338e46b6042eb0dc361cd866a607977820c..aa50550f23f4e162c222fef83726a45f3505d8e9 100644 (file)
@@ -2381,7 +2381,7 @@ CONTEXT:  PL/pgSQL function "missing_return_expr"
 drop function void_return_expr();
 drop function missing_return_expr();
 -- test SQLSTATE and SQLERRM
-create or replace function trap_exceptions() returns void as $_$
+create function trap_exceptions() returns void as $_$
 begin
    begin
      raise exception 'first exception';
@@ -2398,7 +2398,7 @@ begin
 end; $_$ language plpgsql;
 select trap_exceptions();
 NOTICE:  P0001 first exception
-NOTICE:  00000 Sucessful completion
+NOTICE:  00000 Successful completion
 NOTICE:  P0001 last exception
  trap_exceptions 
 -----------------
index e2ef2ec5fe339af034737620278aa1e070a3dbab..3703587ad16c1cbccfc6d8a9ce9a3c0e923de580 100644 (file)
@@ -2018,8 +2018,9 @@ select missing_return_expr();
 
 drop function void_return_expr();
 drop function missing_return_expr();
+
 -- test SQLSTATE and SQLERRM
-create or replace function trap_exceptions() returns void as $_$
+create function trap_exceptions() returns void as $_$
 begin
    begin
      raise exception 'first exception';