Skip to content

Commit 244d2d6

Browse files
author
Michael Meskes
committed
Added Informix "database" command.
1 parent 72933a9 commit 244d2d6

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

src/interfaces/ecpg/include/ecpglib.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,10 @@ bool ECPGdisconnect(int, const char *);
4949
bool ECPGprepare(int, char *, char *);
5050
bool ECPGdeallocate(int, char *);
5151
bool ECPGdeallocate_all(int);
52-
char *ECPGprepared_statement(char *);
52+
char *ECPGprepared_statement(char *);
5353

5454
void ECPGlog(const char *format,...);
55+
char *ECPGerrmsg(void);
5556

5657
/* print an error message */
5758
void sqlprint(void);

src/interfaces/ecpg/preproc/pgc.l

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
*
1414
* IDENTIFICATION
15-
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.105 2003/02/14 16:40:01 meskes Exp $
15+
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.106 2003/02/17 14:06:39 meskes Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -969,7 +969,8 @@ cppline {space}*#(.*\\{space})*.*
969969
yyin = NULL;
970970

971971
/* If file name is enclosed in '"' remove these and look only in '.' */
972-
if (yytext[0] == '"' && yytext[i] == '"')
972+
/* Informix does look into all include paths though, except filename starts with '/' */
973+
if ((yytext[0] == '"' && yytext[i] == '"') && (compat != ECPG_COMPAT_INFORMIX || yytext[0] == '/'))
973974
{
974975
yytext[i] = '\0';
975976
memmove(yytext, yytext+1, strlen(yytext));
@@ -988,6 +989,12 @@ cppline {space}*#(.*\\{space})*.*
988989
}
989990
else
990991
{
992+
if (yytext[0] == '"' && yytext[i] == '"')
993+
{
994+
yytext[i] = '\0';
995+
memmove(yytext, yytext+1, strlen(yytext));
996+
}
997+
991998
for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next)
992999
{
9931000
if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH)

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.208 2003/02/14 13:17:13 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.209 2003/02/17 14:06:40 meskes Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -153,7 +153,7 @@ make_name(void)
153153
/* special embedded SQL token */
154154
%token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK
155155
SQL_CALL SQL_CARDINALITY SQL_CONNECT SQL_CONNECTION
156-
SQL_CONTINUE SQL_COUNT SQL_CURRENT SQL_DATA
156+
SQL_CONTINUE SQL_COUNT SQL_CURRENT SQL_DATA
157157
SQL_DATETIME_INTERVAL_CODE
158158
SQL_DATETIME_INTERVAL_PRECISION
159159
SQL_DESCRIPTOR SQL_DISCONNECT SQL_ENUM SQL_FOUND
@@ -3889,6 +3889,8 @@ ECPGConnect: SQL_CONNECT TO connection_target opt_connection_name opt_user
38893889
/* also allow ORACLE syntax */
38903890
| SQL_CONNECT ora_user
38913891
{ $$ = cat_str(3, make_str("NULL,"), $2, make_str(",NULL")); }
3892+
| DATABASE connection_target
3893+
{ $$ = cat2_str($2, make_str(",NULL,NULL,NULL")); }
38923894
;
38933895

38943896
connection_target: database_name opt_server opt_port

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy