Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
b3195dae
Commit
b3195dae
authored
May 26, 2005
by
Neil Conway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanup for recent SQLSTATE / SQLERRM patch: spell "successful"
correctly, style fixes.
parent
63e0d612
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
12 deletions
+13
-12
src/pl/plpgsql/src/gram.y
src/pl/plpgsql/src/gram.y
+3
-2
src/pl/plpgsql/src/pl_exec.c
src/pl/plpgsql/src/pl_exec.c
+6
-7
src/test/regress/expected/plpgsql.out
src/test/regress/expected/plpgsql.out
+2
-2
src/test/regress/sql/plpgsql.sql
src/test/regress/sql/plpgsql.sql
+2
-1
No files found.
src/pl/plpgsql/src/gram.y
View file @
b3195dae
...
...
@@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.7
0 2005/05/26 00:16:31 momjian
Exp $
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.7
1 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
{
...
...
src/pl/plpgsql/src/pl_exec.c
View file @
b3195dae
...
...
@@ -3,7 +3,7 @@
* procedural language
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.1
39 2005/05/26 00:16:31 momjian
Exp $
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.1
40 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
(
"Suc
c
essful 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
));
/*
...
...
src/test/regress/expected/plpgsql.out
View file @
b3195dae
...
...
@@ -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 Suc
c
essful completion
NOTICE: P0001 last exception
trap_exceptions
-----------------
...
...
src/test/regress/sql/plpgsql.sql
View file @
b3195dae
...
...
@@ -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'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment