Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
d6fbb105
Commit
d6fbb105
authored
23 years ago
by
Michael Meskes
Browse files
Options
Downloads
Patches
Plain Diff
Fix ecpg to allow pointer to structs.
parent
03a321d2
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/interfaces/ecpg/ChangeLog
+4
-0
4 additions, 0 deletions
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/preproc/type.c
+11
-3
11 additions, 3 deletions
src/interfaces/ecpg/preproc/type.c
src/interfaces/ecpg/test/test2.pgc
+5
-4
5 additions, 4 deletions
src/interfaces/ecpg/test/test2.pgc
with
20 additions
and
7 deletions
src/interfaces/ecpg/ChangeLog
+
4
−
0
View file @
d6fbb105
...
@@ -1166,5 +1166,9 @@ Thu Dec 6 14:02:56 CET 2001
...
@@ -1166,5 +1166,9 @@ Thu Dec 6 14:02:56 CET 2001
- Removed debug message from preproc.y.
- Removed debug message from preproc.y.
- Fixed some bugs in exec sql var and exec sql type command.
- Fixed some bugs in exec sql var and exec sql type command.
Sat Dec 8 21:35:45 CET 2001
- Fix ecpg to allow pointer to structs.
- 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.
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/preproc/type.c
+
11
−
3
View file @
d6fbb105
...
@@ -361,7 +361,7 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
...
@@ -361,7 +361,7 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
struct
ECPGstruct_member
*
p
,
struct
ECPGstruct_member
*
p
,
*
ind_p
=
NULL
;
*
ind_p
=
NULL
;
char
obuf
[
BUFSIZ
];
char
obuf
[
BUFSIZ
];
char
pbuf
[
BUFSIZ
],
char
pbuf
[
BUFSIZ
*
2
],
ind_pbuf
[
BUFSIZ
];
ind_pbuf
[
BUFSIZ
];
const
char
*
offset
;
const
char
*
offset
;
...
@@ -373,7 +373,11 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
...
@@ -373,7 +373,11 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
else
else
offset
=
offsetarg
;
offset
=
offsetarg
;
if
(
arrsiz
!=
0
)
sprintf
(
pbuf
,
"%s%s."
,
prefix
?
prefix
:
""
,
name
);
sprintf
(
pbuf
,
"%s%s."
,
prefix
?
prefix
:
""
,
name
);
else
sprintf
(
pbuf
,
"%s%s->"
,
prefix
?
prefix
:
""
,
name
);
prefix
=
pbuf
;
prefix
=
pbuf
;
if
(
ind_typ
==
&
ecpg_no_indicator
)
if
(
ind_typ
==
&
ecpg_no_indicator
)
...
@@ -382,7 +386,11 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
...
@@ -382,7 +386,11 @@ ECPGdump_a_struct(FILE *o, const char *name, const char *ind_name, long arrsiz,
}
}
else
if
(
ind_typ
!=
NULL
)
else
if
(
ind_typ
!=
NULL
)
{
{
if
(
arrsiz
!=
0
)
sprintf
(
ind_pbuf
,
"%s%s."
,
ind_prefix
?
ind_prefix
:
""
,
ind_name
);
sprintf
(
ind_pbuf
,
"%s%s."
,
ind_prefix
?
ind_prefix
:
""
,
ind_name
);
else
sprintf
(
ind_pbuf
,
"%s%s->"
,
ind_prefix
?
ind_prefix
:
""
,
ind_name
);
ind_prefix
=
ind_pbuf
;
ind_prefix
=
ind_pbuf
;
ind_p
=
ind_typ
->
u
.
members
;
ind_p
=
ind_typ
->
u
.
members
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/test/test2.pgc
+
5
−
4
View file @
d6fbb105
...
@@ -19,10 +19,10 @@ main ()
...
@@ -19,10 +19,10 @@ main ()
exec sql begin declare section;
exec sql begin declare section;
struct personal_struct { str name;
struct personal_struct { str name;
birthinfo birth;
birthinfo birth;
} personal;
} personal
, *p
;
struct personal_indicator { int ind_name;
struct personal_indicator { int ind_name;
birthinfo ind_birth;
birthinfo ind_birth;
} ind_personal;
} ind_personal
, *i
;
float ind_married;
float ind_married;
ind children;
ind children;
ind ind_children;
ind ind_children;
...
@@ -63,9 +63,11 @@ exec sql end declare section;
...
@@ -63,9 +63,11 @@ exec sql end declare section;
exec sql whenever not found do break;
exec sql whenever not found do break;
p=&personal;
i=&ind_personal;
while (1) {
while (1) {
strcpy(msg, "fetch");
strcpy(msg, "fetch");
exec sql fetch cur into :p
ersonal:ind_personal
, :married:ind_married, :children.integer:ind_children.smallint;
exec sql fetch cur into :p
:i
, :married:ind_married, :children.integer:ind_children.smallint;
printf("%8.8s", personal.name.arr);
printf("%8.8s", personal.name.arr);
if (ind_personal.ind_birth.born >= 0)
if (ind_personal.ind_birth.born >= 0)
printf(", born %ld", personal.birth.born);
printf(", born %ld", personal.birth.born);
...
@@ -125,6 +127,5 @@ exec sql end declare section;
...
@@ -125,6 +127,5 @@ exec sql end declare section;
if (dbgs != NULL)
if (dbgs != NULL)
fclose(dbgs);
fclose(dbgs);
return (0);
return (0);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment