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
5454b379
Commit
5454b379
authored
Apr 03, 2000
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
c4ef93db
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
93 additions
and
39 deletions
+93
-39
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+6
-0
src/interfaces/ecpg/lib/execute.c
src/interfaces/ecpg/lib/execute.c
+83
-38
src/interfaces/ecpg/test/test4.pgc
src/interfaces/ecpg/test/test4.pgc
+4
-1
No files found.
src/interfaces/ecpg/ChangeLog
View file @
5454b379
...
...
@@ -888,5 +888,11 @@ Thu Mar 30 11:11:13 CEST 2000
Fri Mar 31 08:25:58 CEST 2000
- Synced preproc.y with gram.y.
Mon Apr 3 21:20:27 CEST 2000
- Made sure pointers are correctly inserted by libecpg. My thanks go
to Jan Urbanek <jan@urbanek.cz> for findin many bugs before the
release.
- Set library version to 3.1.0.
- Set ecpg version to 2.7.0.
src/interfaces/ecpg/lib/execute.c
View file @
5454b379
...
...
@@ -317,12 +317,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%
d,"
,
((
short
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%h
d,"
,
((
short
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%hd"
,
*
((
short
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -331,12 +336,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%d,"
,
((
int
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%d"
,
*
((
int
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -345,12 +355,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%d
,"
,
((
unsigned
short
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%hu
,"
,
((
unsigned
short
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%hu"
,
*
((
unsigned
short
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -359,12 +374,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%d
,"
,
((
unsigned
int
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%u
,"
,
((
unsigned
int
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%u"
,
*
((
unsigned
int
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -373,12 +393,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%ld,"
,
((
long
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%ld"
,
*
((
long
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -387,12 +412,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%ld
,"
,
((
unsigned
long
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%lu
,"
,
((
unsigned
long
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%lu"
,
*
((
unsigned
long
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -401,12 +431,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%.14g,"
,
((
float
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%.14g"
,
*
((
float
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -415,12 +450,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%.14g,"
,
((
double
*
)
var
->
value
)[
element
]);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%.14g"
,
*
((
double
*
)
var
->
value
));
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -429,12 +469,17 @@ ECPGexecute(struct statement * stmt)
if
(
!
(
mallocedval
=
ecpg_alloc
(
var
->
arrsize
*
20
,
stmt
->
lineno
)))
return
false
;
sprintf
(
mallocedval
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"'{"
:
""
);
if
(
var
->
arrsize
>
1
)
{
strncpy
(
mallocedval
,
"'{"
,
sizeof
(
"'{"
));
for
(
element
=
0
;
element
<
var
->
arrsize
;
element
++
)
sprintf
(
mallocedval
+
strlen
(
mallocedval
),
"%c,"
,
(((
char
*
)
var
->
value
)[
element
])
?
't'
:
'f'
);
sprintf
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"%s"
,
(
var
->
arrsize
>
1
)
?
"}'"
:
""
);
strncpy
(
mallocedval
+
strlen
(
mallocedval
)
-
1
,
"}'"
,
sizeof
(
"}'"
));
}
else
sprintf
(
mallocedval
,
"%c,"
,
(
*
((
char
*
)
var
->
value
))
?
't'
:
'f'
);
tobeinserted
=
mallocedval
;
break
;
...
...
@@ -814,7 +859,7 @@ ECPGdo(int lineno, const char *connection_name, char *query, ...)
*
* Copyright (c) 2000, Christof Petig <christof.petig@wtal.de>
*
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.
2 2000/03/17 23:26:31 tgl
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/lib/Attic/execute.c,v 1.
3 2000/04/03 19:34:25 meskes
Exp $
*/
PGconn
*
ECPG_internal_get_connection
(
char
*
name
);
...
...
src/interfaces/ecpg/test/test4.pgc
View file @
5454b379
...
...
@@ -8,7 +8,8 @@ int
main ()
{
EXEC SQL BEGIN DECLARE SECTION;
int i = 1;
int i = 3;
int *did = &i;
int a[10] = {9,8,7,6,5,4,3,2,1,0};
double f;
EXEC SQL END DECLARE SECTION;
...
...
@@ -32,6 +33,8 @@ EXEC SQL END DECLARE SECTION;
EXEC SQL INSERT INTO test(f,i,a) VALUES(140787.0,2,:a);
EXEC SQL INSERT INTO test(f,i,a) VALUES(14.07,:did,:a);
EXEC SQL COMMIT;
EXEC SQL BEGIN WORK;
...
...
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