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
c959d370
Commit
c959d370
authored
Sep 12, 2005
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed transaction command handling to not ignore savepoints and to correctly check for errors.
parent
4fe45635
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
15 deletions
+24
-15
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+6
-1
src/interfaces/ecpg/ecpglib/misc.c
src/interfaces/ecpg/ecpglib/misc.c
+18
-14
No files found.
src/interfaces/ecpg/ChangeLog
View file @
c959d370
...
...
@@ -1933,8 +1933,13 @@ Thu Jun 2 14:22:32 CEST 2005
Wed Aug 24 12:17:48 CEST 2005
- Check for NULL before checking whether argument is an array.
- Remove
d
stray character from string quoting.
- Remove stray character from string quoting.
- Fixed check to report missing varchar pointer implementation.
Mon Sep 12 13:53:35 CEST 2005
- Fixed transaction command handling to not ignore savepoints
and to correctly check for errors.
- Set ecpg library version to 5.1.
- Set ecpg version to 4.1.1.
src/interfaces/ecpg/ecpglib/misc.c
View file @
c959d370
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.2
4 2004/10/14 20:23:46 momjian
Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/misc.c,v 1.2
5 2005/09/12 11:57:53 meskes
Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
...
...
@@ -186,31 +186,35 @@ ECPGtrans(int lineno, const char *connection_name, const char *transaction)
/* if we have no connection we just simulate the command */
if
(
con
&&
con
->
connection
)
{
/*
* if we are not in autocommit mode, already have committed the
* transaction and get another commit, just ignore it
/* If we got a transaction command but have no open transaction,
* we have to start one, unless we are in autocommit, where the
* developers have to take care themselves.
* However, if the command is a begin statement, we just execute it once.
*/
if
(
!
con
->
committed
||
con
->
autocommit
)
if
(
con
->
committed
&&
!
con
->
autocommit
&&
strncmp
(
transaction
,
"begin"
,
5
)
!=
0
&&
strncmp
(
transaction
,
"start"
,
5
)
!=
0
)
{
if
((
res
=
PQexec
(
con
->
connection
,
transaction
))
==
NULL
)
res
=
PQexec
(
con
->
connection
,
"begin transaction"
);
if
(
res
==
NULL
||
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
{
ECPGraise
(
lineno
,
ECPG_TRANS
,
ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN
,
NULL
);
return
FALSE
;
}
PQclear
(
res
);
}
res
=
PQexec
(
con
->
connection
,
transaction
);
if
(
res
==
NULL
||
PQresultStatus
(
res
)
!=
PGRES_COMMAND_OK
)
{
ECPGraise
(
lineno
,
ECPG_TRANS
,
ECPG_SQLSTATE_TRANSACTION_RESOLUTION_UNKNOWN
,
NULL
);
return
FALSE
;
}
PQclear
(
res
);
}
if
(
strcmp
(
transaction
,
"commit"
)
==
0
||
strcmp
(
transaction
,
"rollback"
)
==
0
)
{
con
->
committed
=
true
;
#if 0
/* deallocate all prepared statements */
if (!ECPGdeallocate_all(lineno))
return false;
#endif
}
else
con
->
committed
=
false
;
return
true
;
}
...
...
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