Commit 244d2d67 authored by Michael Meskes's avatar Michael Meskes

Added Informix "database" command.

parent 72933a92
...@@ -49,9 +49,10 @@ bool ECPGdisconnect(int, const char *); ...@@ -49,9 +49,10 @@ bool ECPGdisconnect(int, const char *);
bool ECPGprepare(int, char *, char *); bool ECPGprepare(int, char *, char *);
bool ECPGdeallocate(int, char *); bool ECPGdeallocate(int, char *);
bool ECPGdeallocate_all(int); bool ECPGdeallocate_all(int);
char *ECPGprepared_statement(char *); char *ECPGprepared_statement(char *);
void ECPGlog(const char *format,...); void ECPGlog(const char *format,...);
char *ECPGerrmsg(void);
/* print an error message */ /* print an error message */
void sqlprint(void); void sqlprint(void);
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.105 2003/02/14 16:40:01 meskes Exp $ * $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/pgc.l,v 1.106 2003/02/17 14:06:39 meskes Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -969,7 +969,8 @@ cppline {space}*#(.*\\{space})*.* ...@@ -969,7 +969,8 @@ cppline {space}*#(.*\\{space})*.*
yyin = NULL; yyin = NULL;
/* If file name is enclosed in '"' remove these and look only in '.' */ /* If file name is enclosed in '"' remove these and look only in '.' */
if (yytext[0] == '"' && yytext[i] == '"') /* Informix does look into all include paths though, except filename starts with '/' */
if ((yytext[0] == '"' && yytext[i] == '"') && (compat != ECPG_COMPAT_INFORMIX || yytext[0] == '/'))
{ {
yytext[i] = '\0'; yytext[i] = '\0';
memmove(yytext, yytext+1, strlen(yytext)); memmove(yytext, yytext+1, strlen(yytext));
...@@ -988,6 +989,12 @@ cppline {space}*#(.*\\{space})*.* ...@@ -988,6 +989,12 @@ cppline {space}*#(.*\\{space})*.*
} }
else else
{ {
if (yytext[0] == '"' && yytext[i] == '"')
{
yytext[i] = '\0';
memmove(yytext, yytext+1, strlen(yytext));
}
for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next) for (ip = include_paths; yyin == NULL && ip != NULL; ip = ip->next)
{ {
if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH) if (strlen(ip->path) + strlen(yytext) + 3 > MAXPGPATH)
......
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.208 2003/02/14 13:17:13 meskes Exp $ */ /* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.209 2003/02/17 14:06:40 meskes Exp $ */
/* Copyright comment */ /* Copyright comment */
%{ %{
...@@ -153,7 +153,7 @@ make_name(void) ...@@ -153,7 +153,7 @@ make_name(void)
/* special embedded SQL token */ /* special embedded SQL token */
%token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK %token SQL_ALLOCATE SQL_AUTOCOMMIT SQL_BOOL SQL_BREAK
SQL_CALL SQL_CARDINALITY SQL_CONNECT SQL_CONNECTION SQL_CALL SQL_CARDINALITY SQL_CONNECT SQL_CONNECTION
SQL_CONTINUE SQL_COUNT SQL_CURRENT SQL_DATA SQL_CONTINUE SQL_COUNT SQL_CURRENT SQL_DATA
SQL_DATETIME_INTERVAL_CODE SQL_DATETIME_INTERVAL_CODE
SQL_DATETIME_INTERVAL_PRECISION SQL_DATETIME_INTERVAL_PRECISION
SQL_DESCRIPTOR SQL_DISCONNECT SQL_ENUM SQL_FOUND SQL_DESCRIPTOR SQL_DISCONNECT SQL_ENUM SQL_FOUND
...@@ -3889,6 +3889,8 @@ ECPGConnect: SQL_CONNECT TO connection_target opt_connection_name opt_user ...@@ -3889,6 +3889,8 @@ ECPGConnect: SQL_CONNECT TO connection_target opt_connection_name opt_user
/* also allow ORACLE syntax */ /* also allow ORACLE syntax */
| SQL_CONNECT ora_user | SQL_CONNECT ora_user
{ $$ = cat_str(3, make_str("NULL,"), $2, make_str(",NULL")); } { $$ = cat_str(3, make_str("NULL,"), $2, make_str(",NULL")); }
| DATABASE connection_target
{ $$ = cat2_str($2, make_str(",NULL,NULL,NULL")); }
; ;
connection_target: database_name opt_server opt_port connection_target: database_name opt_server opt_port
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment