Commit a4534197 authored by Marc G. Fournier's avatar Marc G. Fournier

From: Michael Meskes <meskes@topsystem.de>

+ Tue May 19 11:49:34 CEST 1998
+
+       - Tested (and fixed) 'set connection'
+       - Fixed string notation in C
+       - Set version to 2.3.2
parent 07140ee0
...@@ -228,3 +228,8 @@ Mon May 18 10:33:58 CEST 1998 ...@@ -228,3 +228,8 @@ Mon May 18 10:33:58 CEST 1998
- Set version to 2.3.1 - Set version to 2.3.1
- Set library version to 2.2 - Set library version to 2.2
Tue May 19 11:49:34 CEST 1998
- Tested (and fixed) 'set connection'
- Fixed string notation in C
- Set version to 2.3.2
...@@ -5,10 +5,10 @@ section of the structure variable for ecpg to be able to understand it. ...@@ -5,10 +5,10 @@ section of the structure variable for ecpg to be able to understand it.
Variable type bool has to be checked. I never used it so far. Variable type bool has to be checked. I never used it so far.
ecpg cannot use pointer variables except [unsigned] char * Missing statements:
- exec sql type
There is no exec sql type statement which is the SQL version of a typedef. - exec sql define
- exec sql prepare
There is no exec sql prepare statement. - exec sql allocate
- exqc sql free
There is no SQLSTATE - SQLSTATE
...@@ -805,7 +805,9 @@ ECPGsetconn(int lineno, const char *connection_name) ...@@ -805,7 +805,9 @@ ECPGsetconn(int lineno, const char *connection_name)
{ {
struct connection *con = all_connections; struct connection *con = all_connections;
for (; con && strcmp(connection_name, con->name) == 0; con=con->next); ECPGlog("ECPGsetconn: setting actual connection to %s\n", connection_name);
for (; con && strcmp(connection_name, con->name) != 0; con=con->next);
if (con) if (con)
{ {
actual_connection = con; actual_connection = con;
...@@ -883,7 +885,7 @@ ECPGdisconnect(int lineno, const char *connection_name) ...@@ -883,7 +885,7 @@ ECPGdisconnect(int lineno, const char *connection_name)
} }
else else
{ {
for (con = all_connections; con && strcmp(con->name, connection_name);con = con->next); for (con = all_connections; con && strcmp(con->name, connection_name) != 0;con = con->next);
if (con == NULL) if (con == NULL)
{ {
ECPGlog("disconnect: not connected to connection %s\n", connection_name); ECPGlog("disconnect: not connected to connection %s\n", connection_name);
......
...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global ...@@ -3,7 +3,7 @@ include $(SRCDIR)/Makefile.global
MAJOR_VERSION=2 MAJOR_VERSION=2
MINOR_VERSION=3 MINOR_VERSION=3
PATCHLEVEL=1 PATCHLEVEL=2
CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \ CFLAGS+=-I../include -DMAJOR_VERSION=$(MAJOR_VERSION) \
-DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \
......
...@@ -180,14 +180,11 @@ sql [sS][qQ][lL] ...@@ -180,14 +180,11 @@ sql [sS][qQ][lL]
<xc>{xcstar} { /* ignore */ } <xc>{xcstar} { /* ignore */ }
{xcstart} { {xcstart} {
fprintf(stderr,"ys = %d %d\n", YYSTATE, before_comment);
before_comment = YYSTATE; before_comment = YYSTATE;
BEGIN(xc); BEGIN(xc);
fprintf(stderr,"ys = %d %d\n", YYSTATE,
before_comment);
} }
<xc>{xcstop} { fprintf(stderr,"ys = %d %d\n", YYSTATE, before_comment);BEGIN(before_comment); } <xc>{xcstop} { BEGIN(before_comment); }
<xc>{xcinside} { /* ignore */ } <xc>{xcinside} { /* ignore */ }
......
...@@ -673,8 +673,8 @@ output_statement(char * stmt, int mode) ...@@ -673,8 +673,8 @@ output_statement(char * stmt, int mode)
%type <str> ECPGWhenever ECPGConnect connection_target ECPGOpen open_opts %type <str> ECPGWhenever ECPGConnect connection_target ECPGOpen open_opts
%type <str> indicator ECPGExecute c_expr variable_list dotext %type <str> indicator ECPGExecute c_expr variable_list dotext
%type <str> storage_clause opt_initializer vartext c_anything blockstart %type <str> storage_clause opt_initializer vartext c_anything blockstart
%type <str> blockend variable_list variable var_anything sql_anything %type <str> blockend variable_list variable var_anything do_anything
%type <str> opt_pointer ecpg_ident cvariable ECPGDisconnect dis_name %type <str> opt_pointer cvariable ECPGDisconnect dis_name
%type <str> stmt symbol opt_symbol ECPGRelease execstring server_name %type <str> stmt symbol opt_symbol ECPGRelease execstring server_name
%type <str> connection_object opt_server opt_port %type <str> connection_object opt_server opt_port
%type <str> user_name opt_user char_variable ora_user ident %type <str> user_name opt_user char_variable ora_user ident
...@@ -762,7 +762,7 @@ stmt: AddAttrStmt { output_statement($1, 0); } ...@@ -762,7 +762,7 @@ stmt: AddAttrStmt { output_statement($1, 0); }
| ECPGOpen { output_statement($1, 0); } | ECPGOpen { output_statement($1, 0); }
| ECPGRelease { /* output already done */ } | ECPGRelease { /* output already done */ }
| ECPGSetConnection { | ECPGSetConnection {
fprintf(yyout, "ECPGsetcon(__LINE__, %s);", $1); fprintf(yyout, "ECPGsetconn(__LINE__, %s);", $1);
whenever_action(0); whenever_action(0);
free($1); free($1);
} }
...@@ -4014,6 +4014,13 @@ connection_target: database_name opt_server opt_port ...@@ -4014,6 +4014,13 @@ connection_target: database_name opt_server opt_port
{ {
$$ = $1; $$ = $1;
} }
| Sconst
{
$$ = strdup($1);
$$[0] = '\"';
$$[strlen($$) - 1] = '\"';
free($1);
}
db_prefix: ident cvariable db_prefix: ident cvariable
{ {
...@@ -4075,9 +4082,12 @@ ora_user: user_name ...@@ -4075,9 +4082,12 @@ ora_user: user_name
$$ = make3_str($1, make1_str(","), $3); $$ = make3_str($1, make1_str(","), $3);
} }
user_name: UserId { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); } user_name: UserId { if ($1[0] == '\"')
$$ = $1;
else
$$ = make3_str(make1_str("\""), $1, make1_str("\""));
}
| char_variable { $$ = $1; } | char_variable { $$ = $1; }
| CSTRING { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); }
| SCONST { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); } | SCONST { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); }
char_variable: cvariable char_variable: cvariable
...@@ -4137,7 +4147,8 @@ connection_object: connection_target { $$ = $1; } ...@@ -4137,7 +4147,8 @@ connection_object: connection_target { $$ = $1; }
*/ */
ECPGExecute : EXECUTE SQL_IMMEDIATE execstring { $$ = $3; }; ECPGExecute : EXECUTE SQL_IMMEDIATE execstring { $$ = $3; };
execstring: cvariable | CSTRING; execstring: cvariable |
CSTRING { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); };
/* /*
* open is an open cursor, at the moment this has to be removed * open is an open cursor, at the moment this has to be removed
...@@ -4534,7 +4545,7 @@ into_list : coutputvariable | into_list ',' coutputvariable; ...@@ -4534,7 +4545,7 @@ into_list : coutputvariable | into_list ',' coutputvariable;
ecpgstart: SQL_START { reset_variables();} ecpgstart: SQL_START { reset_variables();}
dotext: /* empty */ { $$ = make1_str(""); } dotext: /* empty */ { $$ = make1_str(""); }
| dotext sql_anything { $$ = make2_str($1, $2); } | dotext do_anything { $$ = make2_str($1, $2); }
vartext: var_anything { $$ = $1; } vartext: var_anything { $$ = $1; }
| vartext var_anything { $$ = make2_str($1, $2); } | vartext var_anything { $$ = make2_str($1, $2); }
...@@ -4559,16 +4570,15 @@ indicator: /* empty */ { $$ = NULL; } ...@@ -4559,16 +4570,15 @@ indicator: /* empty */ { $$ = NULL; }
| SQL_INDICATOR name { check_indicator((find_variable($2))->type); $$ = $2; } | SQL_INDICATOR name { check_indicator((find_variable($2))->type); $$ = $2; }
ident: IDENT { $$ = make1_str($1); } ident: IDENT { $$ = make1_str($1); }
| CSTRING { $$ = $1; }
ecpg_ident: ident { $$ = $1; }
| CSTRING { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); }
/* /*
* C stuff * C stuff
*/ */
symbol: ecpg_ident { $$ = $1; } symbol: IDENT { $$ = make1_str($1); }
c_anything: ecpg_ident { $$ = $1; } c_anything: IDENT { $$ = make1_str($1); }
| CSTRING { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); }
| Iconst { $$ = $1; } | Iconst { $$ = $1; }
| FCONST { $$ = make_name(); } | FCONST { $$ = make_name(); }
| '*' { $$ = make1_str("*"); } | '*' { $$ = make1_str("*"); }
...@@ -4597,12 +4607,14 @@ c_anything: ecpg_ident { $$ = $1; } ...@@ -4597,12 +4607,14 @@ c_anything: ecpg_ident { $$ = $1; }
| '=' { $$ = make1_str("="); } | '=' { $$ = make1_str("="); }
| ',' { $$ = make1_str(","); } | ',' { $$ = make1_str(","); }
sql_anything: ecpg_ident { $$ = $1; } do_anything: IDENT { $$ = make1_str($1); }
| CSTRING { $$ = make3_str(make1_str("\""), $1, make1_str("\""));}
| Iconst { $$ = $1; } | Iconst { $$ = $1; }
| FCONST { $$ = make_name(); } | FCONST { $$ = make_name(); }
| ',' { $$ = make1_str(","); } | ',' { $$ = make1_str(","); }
var_anything: ecpg_ident { $$ = $1; } var_anything: IDENT { $$ = make1_str($1); }
| CSTRING { $$ = make3_str(make1_str("\""), $1, make1_str("\"")); }
| Iconst { $$ = $1; } | Iconst { $$ = $1; }
| FCONST { $$ = make_name(); } | FCONST { $$ = make_name(); }
/*FIXME: | ',' { $$ = make1_str(","); }*/ /*FIXME: | ',' { $$ = make1_str(","); }*/
......
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