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
c7b65930
Commit
c7b65930
authored
Aug 29, 2007
by
Michael Meskes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug in Informix define handling.
parent
f145de27
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
9 deletions
+41
-9
src/interfaces/ecpg/ChangeLog
src/interfaces/ecpg/ChangeLog
+4
-0
src/interfaces/ecpg/preproc/ecpg.c
src/interfaces/ecpg/preproc/ecpg.c
+1
-6
src/interfaces/ecpg/preproc/pgc.l
src/interfaces/ecpg/preproc/pgc.l
+36
-3
No files found.
src/interfaces/ecpg/ChangeLog
View file @
c7b65930
...
...
@@ -2229,5 +2229,9 @@ Tue, 14 Aug 2007 11:46:51 +0200
Wed, 22 Aug 2007 08:41:33 +0200
- More cleaning up and removed some duplicates.
Wed, 29 Aug 2007 15:41:58 +0200
- Fixed bug in Informix define handling.
- Set ecpg library version to 6.0.
- Set ecpg version to 4.4.
src/interfaces/ecpg/preproc/ecpg.c
View file @
c7b65930
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.10
0 2007/08/14 10:01:5
3 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/ecpg.c,v 1.10
1 2007/08/29 13:58:1
3 meskes Exp $ */
/* New main for ecpg, the PostgreSQL embedded SQL precompiler. */
/* (C) Michael Meskes <meskes@postgresql.org> Feb 5th, 1998 */
...
...
@@ -212,11 +212,6 @@ main(int argc, char *const argv[])
char
informix_path
[
MAXPGPATH
];
compat
=
(
strcmp
(
optarg
,
"INFORMIX"
)
==
0
)
?
ECPG_COMPAT_INFORMIX
:
ECPG_COMPAT_INFORMIX_SE
;
/* system_includes = true; */
add_preprocessor_define
(
"dec_t=decimal"
);
add_preprocessor_define
(
"intrvl_t=interval"
);
add_preprocessor_define
(
"dtime_t=timestamp"
);
get_pkginclude_path
(
my_exec_path
,
pkginclude_path
);
snprintf
(
informix_path
,
MAXPGPATH
,
"%s/informix/esql"
,
pkginclude_path
);
add_include_path
(
informix_path
);
...
...
src/interfaces/ecpg/preproc/pgc.l
View file @
c7b65930
...
...
@@ -12,7 +12,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.15
4 2007/08/22 08:20:58
meskes Exp $
* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.15
5 2007/08/29 13:58:13
meskes Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -50,6 +50,7 @@ static void parse_include (void);
static void check_escape_warning(void);
static bool ecpg_isspace(char ch);
static bool isdefine(void);
static bool isinformixdefine(void);
char *token_start;
int state_before;
...
...
@@ -751,8 +752,10 @@ cppline {space}*#(.*\\{space})*.*{newline}
}
<C>{identifier} {
const ScanKeyword *keyword;
if (INFORMIX_MODE || !isdefine())
/* Informix uses SQL defines only in SQL space */
/* however, some defines have to be taken care of for compatibility */
if ((!INFORMIX_MODE || !isinformixdefine()) && !isdefine())
{
keyword = ScanCKeywordLookup(yytext);
if (keyword != NULL)
...
...
@@ -1332,6 +1335,36 @@ static bool isdefine(void)
return false;
}
static bool isinformixdefine(void)
{
const char *new = NULL;
if (strcmp(yytext, "dec_t") == 0)
new = "decimal";
else if (strcmp(yytext, "intrvl_t") == 0)
new = "interval";
else if (strcmp(yytext, "dtime_t") == 0)
new = "timestamp";
if (new)
{
struct _yy_buffer *yb;
yb = mm_alloc(sizeof(struct _yy_buffer));
yb->buffer = YY_CURRENT_BUFFER;
yb->lineno = yylineno;
yb->filename = mm_strdup(input_filename);
yb->next = yy_buffer;
yy_buffer = yb;
yy_scan_string(new);
return true;
}
return false;
}
/*
* Called before any actual parsing is done
*/
...
...
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