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
b78efb6d
Commit
b78efb6d
authored
Oct 05, 2001
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure each call to ECPGraise is logged.
parent
8a52b893
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
17 additions
and
21 deletions
+17
-21
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/lib/data.c
src/interfaces/ecpg/lib/data.c
+1
-2
src/interfaces/ecpg/lib/error.c
src/interfaces/ecpg/lib/error.c
+4
-3
src/interfaces/ecpg/lib/execute.c
src/interfaces/ecpg/lib/execute.c
+4
-8
src/interfaces/ecpg/lib/memory.c
src/interfaces/ecpg/lib/memory.c
+1
-3
src/interfaces/ecpg/lib/misc.c
src/interfaces/ecpg/lib/misc.c
+2
-3
src/interfaces/ecpg/lib/prepare.c
src/interfaces/ecpg/lib/prepare.c
+1
-2
No files found.
src/interfaces/ecpg/ChangeLog
View file @
b78efb6d
...
@@ -1116,5 +1116,9 @@ TUe Okt 2 16:09:26 CEST 2001
...
@@ -1116,5 +1116,9 @@ TUe Okt 2 16:09:26 CEST 2001
Fri Okt 5 08:37:01 CEST 2001
Fri Okt 5 08:37:01 CEST 2001
- Fixed yet another typo in preproc.y.
- Fixed yet another typo in preproc.y.
Fri Okt 5 19:33:46 CEST 2001
- Make sure every call to ECPGraise is logged.
- Set ecpg version to 2.9.0.
- Set ecpg version to 2.9.0.
- Set library version to 3.3.0.
- Set library version to 3.3.0.
src/interfaces/ecpg/lib/data.c
View file @
b78efb6d
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/data.c,v 1.1
6 2001/10/01 12:02:28
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/data.c,v 1.1
7 2001/10/05 17:37:07
meskes Exp $ */
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -27,7 +27,6 @@ get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
...
@@ -27,7 +27,6 @@ get_data(const PGresult *results, int act_tuple, int act_field, int lineno,
{
{
if
(
*
pval
!=
'{'
)
if
(
*
pval
!=
'{'
)
{
{
ECPGlog
(
"get_data: data entry does not look like an array in line %d
\n
"
,
lineno
);
ECPGraise
(
lineno
,
ECPG_DATA_NOT_ARRAY
,
NULL
);
ECPGraise
(
lineno
,
ECPG_DATA_NOT_ARRAY
,
NULL
);
return
(
false
);
return
(
false
);
}
}
...
...
src/interfaces/ecpg/lib/error.c
View file @
b78efb6d
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/error.c,v 1.1
0 2001/09/19 14:09:32
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/error.c,v 1.1
1 2001/10/05 17:37:07
meskes Exp $ */
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -89,12 +89,12 @@ ECPGraise(int line, int code, const char *str)
...
@@ -89,12 +89,12 @@ ECPGraise(int line, int code, const char *str)
case
ECPG_NOT_CONN
:
case
ECPG_NOT_CONN
:
snprintf
(
sqlca
.
sqlerrm
.
sqlerrmc
,
sizeof
(
sqlca
.
sqlerrm
.
sqlerrmc
),
snprintf
(
sqlca
.
sqlerrm
.
sqlerrmc
,
sizeof
(
sqlca
.
sqlerrm
.
sqlerrmc
),
"Not connected
in line %d."
,
line
);
"Not connected
to '%s' in line %d."
,
str
,
line
);
break
;
break
;
case
ECPG_INVALID_STMT
:
case
ECPG_INVALID_STMT
:
snprintf
(
sqlca
.
sqlerrm
.
sqlerrmc
,
sizeof
(
sqlca
.
sqlerrm
.
sqlerrmc
),
snprintf
(
sqlca
.
sqlerrm
.
sqlerrmc
,
sizeof
(
sqlca
.
sqlerrm
.
sqlerrmc
),
"Invalid statement name
in line %d."
,
line
);
"Invalid statement name
%s in line %d."
,
str
,
line
);
break
;
break
;
case
ECPG_UNKNOWN_DESCRIPTOR
:
case
ECPG_UNKNOWN_DESCRIPTOR
:
...
@@ -151,6 +151,7 @@ ECPGraise(int line, int code, const char *str)
...
@@ -151,6 +151,7 @@ ECPGraise(int line, int code, const char *str)
}
}
sqlca
.
sqlerrm
.
sqlerrml
=
strlen
(
sqlca
.
sqlerrm
.
sqlerrmc
);
sqlca
.
sqlerrm
.
sqlerrml
=
strlen
(
sqlca
.
sqlerrm
.
sqlerrmc
);
ECPGlog
(
"raising sqlcode %d in line %d, '%s'.
\n
"
,
code
,
line
,
sqlca
.
sqlerrm
.
sqlerrmc
);
/* free all memory we have allocated for the user */
/* free all memory we have allocated for the user */
free_auto_mem
();
free_auto_mem
();
...
...
src/interfaces/ecpg/lib/execute.c
View file @
b78efb6d
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.2
7 2001/10/02 14:08:28
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.2
8 2001/10/05 17:37:07
meskes Exp $ */
/*
/*
* The aim is to get a simpler inteface to the database routines.
* The aim is to get a simpler inteface to the database routines.
...
@@ -182,7 +182,6 @@ create_statement(int lineno, struct connection * connection, struct statement **
...
@@ -182,7 +182,6 @@ create_statement(int lineno, struct connection * connection, struct statement **
/* if variable is NULL, the statement hasn't been prepared */
/* if variable is NULL, the statement hasn't been prepared */
if
(
var
->
pointer
==
NULL
)
if
(
var
->
pointer
==
NULL
)
{
{
ECPGlog
(
"create_statement: invalid statement name
\n
"
);
ECPGraise
(
lineno
,
ECPG_INVALID_STMT
,
NULL
);
ECPGraise
(
lineno
,
ECPG_INVALID_STMT
,
NULL
);
free
(
var
);
free
(
var
);
return
false
;
return
false
;
...
@@ -405,7 +404,6 @@ ECPGstore_result(const PGresult *results, int act_field,
...
@@ -405,7 +404,6 @@ ECPGstore_result(const PGresult *results, int act_field,
*/
*/
if
(
var
->
arrsize
==
0
)
if
(
var
->
arrsize
==
0
)
{
{
ECPGlog
(
"ECPGexecute line %d: variable is not an array
\n
"
);
ECPGraise
(
stmt
->
lineno
,
ECPG_NO_ARRAY
,
NULL
);
ECPGraise
(
stmt
->
lineno
,
ECPG_NO_ARRAY
,
NULL
);
return
false
;
return
false
;
}
}
...
@@ -942,7 +940,7 @@ ECPGexecute(struct statement * stmt)
...
@@ -942,7 +940,7 @@ ECPGexecute(struct statement * stmt)
if
(
ntuples
<
1
)
if
(
ntuples
<
1
)
{
{
ECPGlog
(
"ECPGexecute line %d: Incorrect number of matches: %d
\n
"
,
if
(
ntuples
)
ECPGlog
(
"ECPGexecute line %d: Incorrect number of matches: %d
\n
"
,
stmt
->
lineno
,
ntuples
);
stmt
->
lineno
,
ntuples
);
ECPGraise
(
stmt
->
lineno
,
ECPG_NOT_FOUND
,
NULL
);
ECPGraise
(
stmt
->
lineno
,
ECPG_NOT_FOUND
,
NULL
);
status
=
false
;
status
=
false
;
...
@@ -957,7 +955,7 @@ ECPGexecute(struct statement * stmt)
...
@@ -957,7 +955,7 @@ ECPGexecute(struct statement * stmt)
PQclear
(
*
resultpp
);
PQclear
(
*
resultpp
);
*
resultpp
=
results
;
*
resultpp
=
results
;
clear_result
=
FALSE
;
clear_result
=
FALSE
;
ECPGlog
(
"ECPGexecute putting result
into descriptor '%s'
\n
"
,
(
const
char
*
)
var
->
pointer
);
ECPGlog
(
"ECPGexecute putting result
(%d tuples) into descriptor '%s'
\n
"
,
PQntuples
(
results
)
,
(
const
char
*
)
var
->
pointer
);
}
}
var
=
var
->
next
;
var
=
var
->
next
;
}
}
...
@@ -965,7 +963,6 @@ ECPGexecute(struct statement * stmt)
...
@@ -965,7 +963,6 @@ ECPGexecute(struct statement * stmt)
{
{
if
(
var
==
NULL
)
if
(
var
==
NULL
)
{
{
ECPGlog
(
"ECPGexecute line %d: Too few arguments.
\n
"
,
stmt
->
lineno
);
ECPGraise
(
stmt
->
lineno
,
ECPG_TOO_FEW_ARGUMENTS
,
NULL
);
ECPGraise
(
stmt
->
lineno
,
ECPG_TOO_FEW_ARGUMENTS
,
NULL
);
return
(
false
);
return
(
false
);
}
}
...
@@ -1068,8 +1065,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
...
@@ -1068,8 +1065,7 @@ ECPGdo(int lineno, const char *connection_name, char *query,...)
if
(
con
==
NULL
||
con
->
connection
==
NULL
)
if
(
con
==
NULL
||
con
->
connection
==
NULL
)
{
{
free_statement
(
stmt
);
free_statement
(
stmt
);
ECPGlog
(
"ECPGdo: not connected to %s
\n
"
,
con
->
name
);
ECPGraise
(
lineno
,
ECPG_NOT_CONN
,
(
con
)
?
con
->
name
:
"<empty>"
);
ECPGraise
(
lineno
,
ECPG_NOT_CONN
,
NULL
);
setlocale
(
LC_NUMERIC
,
oldlocale
);
setlocale
(
LC_NUMERIC
,
oldlocale
);
free
(
oldlocale
);
free
(
oldlocale
);
return
false
;
return
false
;
...
...
src/interfaces/ecpg/lib/memory.c
View file @
b78efb6d
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/memory.c,v 1.
5 2001/09/19 14:09:32
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/memory.c,v 1.
6 2001/10/05 17:37:07
meskes Exp $ */
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -14,7 +14,6 @@ ecpg_alloc(long size, int lineno)
...
@@ -14,7 +14,6 @@ ecpg_alloc(long size, int lineno)
if
(
!
new
)
if
(
!
new
)
{
{
ECPGlog
(
"out of memory
\n
"
);
ECPGraise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
NULL
);
ECPGraise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
NULL
);
return
NULL
;
return
NULL
;
}
}
...
@@ -30,7 +29,6 @@ ecpg_strdup(const char *string, int lineno)
...
@@ -30,7 +29,6 @@ ecpg_strdup(const char *string, int lineno)
if
(
!
new
)
if
(
!
new
)
{
{
ECPGlog
(
"out of memory
\n
"
);
ECPGraise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
NULL
);
ECPGraise
(
lineno
,
ECPG_OUT_OF_MEMORY
,
NULL
);
return
NULL
;
return
NULL
;
}
}
...
...
src/interfaces/ecpg/lib/misc.c
View file @
b78efb6d
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/misc.c,v 1.
5 2001/09/19 14:09:32
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/misc.c,v 1.
6 2001/10/05 17:37:07
meskes Exp $ */
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -54,8 +54,7 @@ ECPGstatus(int lineno, const char *connection_name)
...
@@ -54,8 +54,7 @@ ECPGstatus(int lineno, const char *connection_name)
/* are we connected? */
/* are we connected? */
if
(
con
->
connection
==
NULL
)
if
(
con
->
connection
==
NULL
)
{
{
ECPGlog
(
"ECPGdo: not connected to %s
\n
"
,
con
->
name
);
ECPGraise
(
lineno
,
ECPG_NOT_CONN
,
con
->
name
);
ECPGraise
(
lineno
,
ECPG_NOT_CONN
,
NULL
);
return
false
;
return
false
;
}
}
...
...
src/interfaces/ecpg/lib/prepare.c
View file @
b78efb6d
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/prepare.c,v 1.
7 2001/09/19 14:09:32
meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/prepare.c,v 1.
8 2001/10/05 17:37:07
meskes Exp $ */
#include "postgres_fe.h"
#include "postgres_fe.h"
...
@@ -125,7 +125,6 @@ ECPGdeallocate(int lineno, char *name)
...
@@ -125,7 +125,6 @@ ECPGdeallocate(int lineno, char *name)
free
(
this
);
free
(
this
);
return
true
;
return
true
;
}
}
ECPGlog
(
"deallocate_prepare: invalid statement name %s
\n
"
,
name
);
ECPGraise
(
lineno
,
ECPG_INVALID_STMT
,
name
);
ECPGraise
(
lineno
,
ECPG_INVALID_STMT
,
name
);
return
false
;
return
false
;
}
}
...
...
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