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
d258fb91
Commit
d258fb91
authored
May 23, 2003
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ecpg now accepts array elements as arguments.
parent
450d7e27
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
625 additions
and
436 deletions
+625
-436
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+5
-0
src/interfaces/ecpg/preproc/keywords.c
src/interfaces/ecpg/preproc/keywords.c
+6
-1
src/interfaces/ecpg/preproc/preproc.y
src/interfaces/ecpg/preproc/preproc.y
+550
-431
src/interfaces/ecpg/preproc/type.c
src/interfaces/ecpg/preproc/type.c
+64
-4
No files found.
src/interfaces/ecpg/ChangeLog
View file @
d258fb91
...
...
@@ -1436,6 +1436,11 @@ Tue May 20 11:47:00 CEST 2003
Thu May 22 09:33:54 CEST 2003
- ecpg now recognizes named struct/union usage.
Fri May 23 11:46:15 CEST 2003
- Synced parser and keyword table.
- ecpg now accepts array elements as input variables.
- Set ecpg version to 2.12.0.
- Set ecpg library to 3.4.2.
- Set pgtypes library to 1.0.0
...
...
src/interfaces/ecpg/preproc/keywords.c
View file @
d258fb91
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.5
7 2003/05/16 04:59:22 momjian
Exp $
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/keywords.c,v 1.5
8 2003/05/23 15:19:34 meskes
Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -41,6 +41,7 @@ static ScanKeyword ScanKeywords[] = {
{
"analyze"
,
ANALYZE
},
{
"and"
,
AND
},
{
"any"
,
ANY
},
{
"array"
,
ARRAY
},
{
"as"
,
AS
},
{
"asc"
,
ASC
},
{
"assertion"
,
ASSERTION
},
...
...
@@ -126,6 +127,7 @@ static ScanKeyword ScanKeywords[] = {
{
"extract"
,
EXTRACT
},
{
"false"
,
FALSE_P
},
{
"fetch"
,
FETCH
},
{
"first"
,
FIRST_P
},
{
"float"
,
FLOAT_P
},
{
"for"
,
FOR
},
{
"force"
,
FORCE
},
...
...
@@ -141,6 +143,7 @@ static ScanKeyword ScanKeywords[] = {
{
"group"
,
GROUP_P
},
{
"handler"
,
HANDLER
},
{
"having"
,
HAVING
},
{
"hold"
,
HOLD
},
{
"hour"
,
HOUR_P
},
{
"ilike"
,
ILIKE
},
{
"immediate"
,
IMMEDIATE
},
...
...
@@ -170,6 +173,7 @@ static ScanKeyword ScanKeywords[] = {
{
"key"
,
KEY
},
{
"lancompiler"
,
LANCOMPILER
},
{
"language"
,
LANGUAGE
},
{
"last"
,
LAST_P
},
{
"leading"
,
LEADING
},
{
"left"
,
LEFT
},
{
"level"
,
LEVEL
},
...
...
@@ -241,6 +245,7 @@ static ScanKeyword ScanKeywords[] = {
{
"rename"
,
RENAME
},
{
"replace"
,
REPLACE
},
{
"reset"
,
RESET
},
{
"restart"
,
RESTART
},
{
"restrict"
,
RESTRICT
},
{
"returns"
,
RETURNS
},
{
"revoke"
,
REVOKE
},
...
...
src/interfaces/ecpg/preproc/preproc.y
View file @
d258fb91
This diff is collapsed.
Click to expand it.
src/interfaces/ecpg/preproc/type.c
View file @
d258fb91
...
...
@@ -233,21 +233,81 @@ ECPGdump_a_type(FILE *o, const char *name, struct ECPGtype * type,
break
;
case
ECPGt_struct
:
case
ECPGt_union
:
ECPGdump_a_struct
(
o
,
name
,
ind_name
,
type
->
size
,
type
->
u
.
element
,
(
ind_type
->
type
==
ECPGt_NO_INDICATOR
)
?
ind_type
:
ind_type
->
u
.
element
,
NULL
,
prefix
,
ind_prefix
);
/* If var_array_element is not equal * NULL, we have to use the * <var_array_element>th entry and not * the whole array */
if
(
var_array_element
==
NULL
)
ECPGdump_a_struct
(
o
,
name
,
ind_name
,
type
->
size
,
type
->
u
.
element
,
(
ind_type
->
type
==
ECPGt_NO_INDICATOR
)
?
ind_type
:
ind_type
->
u
.
element
,
NULL
,
prefix
,
ind_prefix
);
else
{
char
*
array_element
=
(
char
*
)
mm_alloc
(
strlen
(
name
)
+
strlen
(
var_array_element
)
+
sizeof
(
"[]
\0
"
)),
*
ind_array_element
;
sprintf
(
array_element
,
"%s[%s]"
,
name
,
var_array_element
);
if
(
ind_type
->
type
!=
ECPGt_NO_INDICATOR
)
{
ind_array_element
=
(
char
*
)
mm_alloc
(
strlen
(
ind_name
)
+
strlen
(
ind_array_element
)
+
sizeof
(
"+
\0
"
));
sprintf
(
ind_array_element
,
"%s[%s]"
,
ind_name
,
ind_array_element
);
ECPGdump_a_struct
(
o
,
array_element
,
ind_array_element
,
make_str
(
"1"
),
type
->
u
.
element
,
ind_type
->
u
.
element
,
NULL
,
prefix
,
ind_prefix
);
free
(
ind_array_element
);
}
else
ECPGdump_a_struct
(
o
,
array_element
,
ind_name
,
make_str
(
"1"
),
type
->
u
.
element
,
ind_type
,
NULL
,
prefix
,
ind_prefix
);
free
(
array_element
);
}
break
;
default:
if
(
!
IS_SIMPLE_TYPE
(
type
->
u
.
element
->
type
))
yyerror
(
"Internal error: unknown datatype, please inform pgsql-bugs@postgresql.org"
);
ECPGdump_a_simple
(
o
,
name
,
type
->
u
.
element
->
type
,
/* If var_array_element is not equal
* NULL, we have to use the
* <var_array_element>th entry and not
* the whole array */
if
(
var_array_element
==
NULL
)
ECPGdump_a_simple
(
o
,
name
,
type
->
u
.
element
->
type
,
type
->
u
.
element
->
size
,
type
->
size
,
NULL
,
prefix
);
else
{
char
*
array_element
=
(
char
*
)
mm_alloc
(
strlen
(
name
)
+
strlen
(
var_array_element
)
+
sizeof
(
"+
\0
"
));
sprintf
(
array_element
,
"%s+%s"
,
name
,
var_array_element
);
ECPGdump_a_simple
(
o
,
array_element
,
type
->
u
.
element
->
type
,
type
->
u
.
element
->
size
,
make_str
(
"1"
),
NULL
,
prefix
);
free
(
array_element
);
}
if
(
ind_type
!=
NULL
)
{
if
(
ind_type
->
type
==
ECPGt_NO_INDICATOR
)
ECPGdump_a_simple
(
o
,
ind_name
,
ind_type
->
type
,
ind_type
->
size
,
make_str
(
"-1"
),
NULL
,
ind_prefix
);
else
ECPGdump_a_simple
(
o
,
ind_name
,
ind_type
->
u
.
element
->
type
,
ind_type
->
u
.
element
->
size
,
ind_type
->
size
,
NULL
,
prefix
);
{
if
(
ind_array_element
==
NULL
)
ECPGdump_a_simple
(
o
,
ind_name
,
ind_type
->
u
.
element
->
type
,
ind_type
->
u
.
element
->
size
,
ind_type
->
size
,
NULL
,
prefix
);
else
{
char
*
array_element
=
(
char
*
)
mm_alloc
(
strlen
(
ind_name
)
+
strlen
(
ind_array_element
)
+
sizeof
(
"+
\0
"
));
sprintf
(
array_element
,
"%s+%s"
,
ind_name
,
ind_array_element
);
ECPGdump_a_simple
(
o
,
array_element
,
ind_type
->
u
.
element
->
type
,
ind_type
->
u
.
element
->
size
,
make_str
(
"1"
),
NULL
,
prefix
);
free
(
array_element
);
}
}
}
}
break
;
...
...
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