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
30f16e72
Commit
30f16e72
authored
Feb 15, 2000
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
6124c674
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
16 deletions
+21
-16
src/interfaces/ecpg/include/sqlca.h
src/interfaces/ecpg/include/sqlca.h
+3
-1
src/interfaces/ecpg/lib/ecpglib.c
src/interfaces/ecpg/lib/ecpglib.c
+13
-10
src/interfaces/ecpg/test/Makefile
src/interfaces/ecpg/test/Makefile
+5
-5
No files found.
src/interfaces/ecpg/include/sqlca.h
View file @
30f16e72
#ifndef POSTGRES_SQLCA_H
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#define SQLERRMC_LEN 70
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
{
{
...
@@ -14,7 +16,7 @@ extern "C"
...
@@ -14,7 +16,7 @@ extern "C"
struct
struct
{
{
int
sqlerrml
;
int
sqlerrml
;
char
sqlerrmc
[
70
];
char
sqlerrmc
[
SQLERRMC_LEN
];
}
sqlerrm
;
}
sqlerrm
;
char
sqlerrp
[
8
];
char
sqlerrp
[
8
];
long
sqlerrd
[
6
];
long
sqlerrd
[
6
];
...
...
src/interfaces/ecpg/lib/ecpglib.c
View file @
30f16e72
...
@@ -109,7 +109,7 @@ register_error(long code, char *fmt,...)
...
@@ -109,7 +109,7 @@ register_error(long code, char *fmt,...)
sqlca
.
sqlcode
=
code
;
sqlca
.
sqlcode
=
code
;
va_start
(
args
,
fmt
);
va_start
(
args
,
fmt
);
vs
printf
(
sqlca
.
sqlerrm
.
sqlerrmc
,
fmt
,
args
);
vs
nprintf
(
sqlca
.
sqlerrm
.
sqlerrmc
,
SQLERRMC_LEN
,
fmt
,
args
);
va_end
(
args
);
va_end
(
args
);
sqlca
.
sqlerrm
.
sqlerrml
=
strlen
(
sqlca
.
sqlerrm
.
sqlerrmc
);
sqlca
.
sqlerrm
.
sqlerrml
=
strlen
(
sqlca
.
sqlerrm
.
sqlerrmc
);
...
@@ -649,7 +649,8 @@ ECPGexecute(struct statement * stmt)
...
@@ -649,7 +649,8 @@ ECPGexecute(struct statement * stmt)
int
nfields
,
int
nfields
,
ntuples
,
ntuples
,
act_tuple
,
act_tuple
,
act_field
;
act_field
,
isarray
;
case
PGRES_TUPLES_OK
:
case
PGRES_TUPLES_OK
:
nfields
=
PQnfields
(
results
);
nfields
=
PQnfields
(
results
);
...
@@ -678,6 +679,16 @@ ECPGexecute(struct statement * stmt)
...
@@ -678,6 +679,16 @@ ECPGexecute(struct statement * stmt)
return
(
false
);
return
(
false
);
}
}
array_query
=
(
char
*
)
ecpg_alloc
(
strlen
(
"select typelem from pg_type where oid="
)
+
11
,
stmt
->
lineno
);
sprintf
(
array_query
,
"select typelem from pg_type where oid=%d"
,
PQftype
(
results
,
act_field
));
query
=
PQexec
(
stmt
->
connection
->
connection
,
array_query
);
isarray
=
0
;
if
(
PQresultStatus
(
query
)
==
PGRES_TUPLES_OK
)
{
isarray
=
atol
((
char
*
)
PQgetvalue
(
query
,
0
,
0
));
ECPGlog
(
"ECPGexecute line %d: TYPE database: %d C: %d array: %s
\n
"
,
stmt
->
lineno
,
PQftype
(
results
,
act_field
),
var
->
type
,
isarray
?
"yes"
:
"no"
);
}
PQclear
(
query
);
/*
/*
* if we don't have enough space, we cannot read all
* if we don't have enough space, we cannot read all
* tuples
* tuples
...
@@ -726,14 +737,6 @@ ECPGexecute(struct statement * stmt)
...
@@ -726,14 +737,6 @@ ECPGexecute(struct statement * stmt)
add_mem
(
var
->
value
,
stmt
->
lineno
);
add_mem
(
var
->
value
,
stmt
->
lineno
);
}
}
#if 0
array_query = (char *)ecpg_alloc(strlen("select typelem from pg_type where oid=") + 11, stmt -> lineno);
sprintf(array_query, "select typelem from pg_type where oid=%d", PQftype(results, act_field));
query = PQexec(stmt->connection->connection, array_query);
if (PQresultStatus(query) == PGRES_TUPLES_OK)
ECPGlog("ECPGexecute line %d: TYPE database: %d C: %d array OID: %s\n", stmt->lineno, PQftype(results, act_field), var->type, (char *)PQgetvalue(query, 0, 0));
PQclear(query);
#endif
for
(
act_tuple
=
0
;
act_tuple
<
ntuples
&&
status
;
act_tuple
++
)
for
(
act_tuple
=
0
;
act_tuple
<
ntuples
&&
status
;
act_tuple
++
)
{
{
pval
=
(
char
*
)
PQgetvalue
(
results
,
act_tuple
,
act_field
);
pval
=
(
char
*
)
PQgetvalue
(
results
,
act_tuple
,
act_field
);
...
...
src/interfaces/ecpg/test/Makefile
View file @
30f16e72
all
:
stp.so test1 test2 test3 test4 test5 perftest
all
:
stp.so test1 test2 test3 test4 test5 perftest
#LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq -lcrypt
#LDFLAGS=-g -I /usr/local/pgsql/include -L/usr/local/pgsql/lib -lecpg -lpq -lcrypt
#
LDFLAGS=-g -I../include -I/usr/include/postgresql -L/usr/lib/postgresql -L../lib -lecpg -lpq -lcrypt
LDFLAGS
=
-g
-I
../include
-I
/usr/include/postgresql
-L
/usr/lib/postgresql
-L
../lib
-lecpg
-lpq
-lcrypt
LDFLAGS
=
-g
-I
/usr/include/postgresql
-lecpg
-lpq
-lcrypt
#
LDFLAGS=-g -I/usr/include/postgresql -lecpg -lpq -lcrypt
#ECPG=/usr/local/pgsql/bin/ecpg
#ECPG=/usr/local/pgsql/bin/ecpg
#
ECPG=../preproc/ecpg -I../include
ECPG
=
../preproc/ecpg
-I
../include
ECPG
=
/usr/bin/ecpg
-I
/usr/include/postgresql
#
ECPG=/usr/bin/ecpg -I/usr/include/postgresql
.SUFFIXES
:
.pgc .c
.SUFFIXES
:
.pgc .c
...
@@ -22,7 +22,7 @@ perftest: perftest.c
...
@@ -22,7 +22,7 @@ perftest: perftest.c
stp.so
:
stp.c
stp.so
:
stp.c
cc
-fPIC
-I
../include
-I
/usr/include/postgresql
-c
-o
stp.o stp.c
cc
-fPIC
-I
../include
-I
/usr/include/postgresql
-c
-o
stp.o stp.c
ld
-Bdynamic
-shared
-soname
stp.so
-o
stp.so stp.o
-lpq
-lecpg
ld
-Bdynamic
-shared
-soname
stp.so
-o
stp.so stp.o
-lpq
-lecpg
-lc
clean
:
clean
:
...
...
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