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
e39a1186
Commit
e39a1186
authored
May 17, 2000
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
76da5b80
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
18 deletions
+44
-18
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/lib/Makefile.in
src/interfaces/ecpg/lib/Makefile.in
+2
-2
src/interfaces/ecpg/lib/data.c
src/interfaces/ecpg/lib/data.c
+21
-3
src/interfaces/ecpg/test/Makefile
src/interfaces/ecpg/test/Makefile
+3
-2
src/interfaces/ecpg/test/test1.pgc
src/interfaces/ecpg/test/test1.pgc
+10
-8
src/interfaces/ecpg/test/test4.pgc
src/interfaces/ecpg/test/test4.pgc
+3
-3
No files found.
src/interfaces/ecpg/ChangeLog
View file @
e39a1186
...
...
@@ -919,4 +919,9 @@ Mon May 15 10:51:31 CEST 2000
- Added patch by SAKAIDA Masaaki <sakaida@psn.co.jp> to fix segfault.
- Set ecpg version to 2.7.1.
Wed May 17 07:52:59 CEST 2000
- Added patch by SAKAIDA Masaaki <sakaida@psn.co.jp> to fix array
handling.
- Set library version to 3.1.1.
src/interfaces/ecpg/lib/Makefile.in
View file @
e39a1186
...
...
@@ -6,13 +6,13 @@
# Copyright (c) 1994, Regents of the University of California
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.6
5 2000/03/30 11:41:34
meskes Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/Makefile.in,v 1.6
6 2000/05/17 06:03:13
meskes Exp $
#
#-------------------------------------------------------------------------
NAME
=
ecpg
SO_MAJOR_VERSION
=
3
SO_MINOR_VERSION
=
1.
0
SO_MINOR_VERSION
=
1.
1
SRCDIR
=
@top_srcdir@
include
$(SRCDIR)/Makefile.global
...
...
src/interfaces/ecpg/lib/data.c
View file @
e39a1186
#include <stdlib.h>
#include <string.h>
#include <ecpgtype.h>
#include <ecpglib.h>
...
...
@@ -26,8 +27,18 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno,
ECPGraise
(
lineno
,
ECPG_DATA_NOT_ARRAY
,
NULL
);
return
(
false
);
}
else
++
pval
;
switch
(
type
)
{
case
ECPGt_char
:
case
ECPGt_unsigned_char
:
case
ECPGt_varchar
:
break
;
default:
pval
++
;
break
;
}
}
/* We will have to decode the value */
...
...
@@ -144,7 +155,14 @@ get_data(PGresult *results, int act_tuple, int act_field, int lineno,
case
ECPGt_double
:
if
(
pval
)
{
dres
=
strtod
(
pval
,
&
scan_length
);
if
(
isarray
&&
*
pval
==
'"'
)
dres
=
strtod
(
pval
+
1
,
&
scan_length
);
else
dres
=
strtod
(
pval
,
&
scan_length
);
if
(
isarray
&&
*
scan_length
==
'"'
)
scan_length
++
;
if
((
isarray
&&
*
scan_length
!=
','
&&
*
scan_length
!=
'}'
)
||
(
!
isarray
&&
*
scan_length
!=
'\0'
))
/* Garbage left */
{
...
...
src/interfaces/ecpg/test/Makefile
View file @
e39a1186
...
...
@@ -2,7 +2,8 @@ all: test1 test2 test3 test4 perftest dyntest dyntest2
LDFLAGS
=
-g
-I
/usr/local/pgsql/include
-L
/usr/local/pgsql/lib
-lecpg
-lpq
ECPG
=
../preproc/ecpg
-I
../include
ECPG
=
/usr/local/pgsql/bin/ecpg
-I
../include
#ECPG=../preproc/ecpg -I../include
.SUFFIXES
:
.pgc .c
...
...
@@ -18,4 +19,4 @@ dyntest2: dyntest2.c
$(ECPG)
$?
clean
:
rm
-f
test1 test2 test3 test4 perftest
*
.c
*
.o
log dyntest dyntest2
rm
-f
test1 test2 test3 test4 perftest
*
.c log dyntest dyntest2
src/interfaces/ecpg/test/test1.pgc
View file @
e39a1186
exec sql include sqlca;
exec sql whenever sqlerror do PrintAndStop(msg);
...
...
@@ -88,8 +86,9 @@ exec sql end declare section;
strcpy(msg, "commit");
exec sql commit;
/* Stop automatic transactioning for connection pm. */
exec sql at pm set autocommit to off;
/* Start automatic transactioning for connection pm. */
exec sql at pm set autocommit to on;
exec sql at pm begin transaction;
strcpy(msg, "select");
exec sql select name, amount, letter into :name, :amount, :letter from "Test";
...
...
@@ -117,14 +116,17 @@ exec sql end declare section;
for (i=0, j=sqlca.sqlerrd[2]; i<j; i++)
printf("name[%d]=%8.8s\tamount[%d]=%d\tletter[%d]=%c\n", i, name[i], i, amount[i],i, letter[i][0]);
strcpy(msg, "drop");
exec sql drop table "Test";
exec sql at pm drop table "Test";
strcpy(msg, "commit");
exec sql commit;
exec sql at pm commit;
/* Start automatic transactioning for connection main. */
exec sql set autocommit to on;
strcpy(msg, "drop");
exec sql drop table "Test";
exec sql at pm drop table "Test";
strcpy(msg, "disconnect");
exec sql disconnect main;
exec sql disconnect pm;
...
...
src/interfaces/ecpg/test/test4.pgc
View file @
e39a1186
...
...
@@ -8,7 +8,7 @@ int
main ()
{
EXEC SQL BEGIN DECLARE SECTION;
int i =
3
;
int i =
1
;
int *did = &i;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
char text[10] = "klmnopqrst";
...
...
@@ -31,7 +31,7 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL CREATE TABLE test (f float, i int, a int[10], text char(10), b bool);
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,
1
,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(404.90,
3
,'{0,1,2,3,4,5,6,7,8,9}','abcdefghij', 'f');
EXEC SQL INSERT INTO test(f,i,a,text,b) VALUES(140787.0,2,:a,:text,'t');
...
...
@@ -48,7 +48,7 @@ EXEC SQL END DECLARE SECTION;
printf("Found f=%f text=%10.10s b=%d\n", f, text, b);
f=14
.0
7;
f=14
078
7;
EXEC SQL SELECT a,text
INTO :a,:t
FROM test
...
...
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