Commit b1710339 authored by Michael Meskes's avatar Michael Meskes

Fixed parser and library to allow empty database names.

Streamlined connection name parsing.
Added Joachim's patch to shorten paths before diffing.
parent ba9f9bf1
......@@ -2126,5 +2126,10 @@ Su 27. Aug 17:54:36 CEST 2006
- Enabled single-quoted connection targets.
- Fixed a memory leak/segfault in unsuccessful connection.
Tu 29. Aug 14:21:31 CEST 2006
- Fixed parser and library to allow empty database names.
- Streamlined connection name parsing.
- Set ecpg library version to 5.2.
- Set ecpg version to 4.2.1.
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.34 2006/08/27 16:15:41 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/connect.c,v 1.35 2006/08/29 12:24:51 meskes Exp $ */
#define POSTGRES_ECPG_INTERNAL
#include "postgres_fe.h"
......@@ -427,7 +427,8 @@ ECPGconnect(int lineno, int c, const char *name, const char *user, const char *p
host = ECPGstrdup(tmp + 1, lineno);
*tmp = '\0';
}
realname = ECPGstrdup(dbname, lineno);
realname = (strlen(dbname) > 0) ? ECPGstrdup(dbname, lineno) : NULL;
}
}
else
......
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.333 2006/08/27 16:15:41 meskes Exp $ */
/* $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/preproc.y,v 1.334 2006/08/29 12:24:51 meskes Exp $ */
/* Copyright comment */
%{
......@@ -508,7 +508,7 @@ add_additional_variables(char *name, bool insert)
%type <str> opt_instead event RuleActionList opt_using CreateAssertStmt
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
%type <str> RuleStmt opt_column oper_argtypes NumConst var_name
%type <str> MathOp RemoveFuncStmt ECPGunreserved_con
%type <str> MathOp RemoveFuncStmt ECPGunreserved_con opt_database_name
%type <str> RemoveAggrStmt opt_procedural select_no_parens CreateCastStmt
%type <str> RemoveOperStmt RenameStmt all_Op opt_trusted opt_lancompiler
%type <str> VariableSetStmt var_value zone_value VariableShowStmt
......@@ -624,7 +624,7 @@ statement: ecpgstart opt_at stmt ';' { connection = NULL; }
| '}' { remove_typedefs(braces_open); remove_variables(braces_open--); fputs("}", yyout); }
;
opt_at: AT connection_target
opt_at: AT connection_object
{
connection = $2;
/*
......@@ -4616,7 +4616,7 @@ ECPGConnect: SQL_CONNECT TO connection_target opt_connection_name opt_user
{ $$ = cat2_str($2, make_str(",NULL,NULL,NULL")); }
;
connection_target: database_name opt_server opt_port
connection_target: opt_database_name opt_server opt_port
{
/* old style: dbname[@server][:port] */
if (strlen($2) > 0 && *($2) != '@')
......@@ -4628,7 +4628,7 @@ connection_target: database_name opt_server opt_port
else
$$ = make3_str(make_str("\""), make3_str($1, $2, $3), make_str("\""));
}
| db_prefix ':' server opt_port '/' database_name opt_options
| db_prefix ':' server opt_port '/' opt_database_name opt_options
{
/* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
if (strncmp($1, "unix:postgresql", strlen("unix:postgresql")) != 0 && strncmp($1, "tcp:postgresql", strlen("tcp:postgresql")) != 0)
......@@ -4659,6 +4659,10 @@ connection_target: database_name opt_server opt_port
}
;
opt_database_name: database_name { $$ = $1; }
| /*EMPTY*/ { $$ = EMPTY; }
;
db_prefix: ident cvariable
{
if (strcmp($2, "postgresql") != 0 && strcmp($2, "postgres") != 0)
......@@ -4693,7 +4697,7 @@ opt_port: ':' PosIntConst { $$ = make2_str(make_str(":"), $2); }
| /*EMPTY*/ { $$ = EMPTY; }
;
opt_connection_name: AS connection_target { $$ = $2; }
opt_connection_name: AS connection_object { $$ = $2; }
| /*EMPTY*/ { $$ = make_str("NULL"); }
;
......@@ -5494,11 +5498,12 @@ ECPGDisconnect: SQL_DISCONNECT dis_name { $$ = $2; }
dis_name: connection_object { $$ = $1; }
| SQL_CURRENT { $$ = make_str("\"CURRENT\""); }
| ALL { $$ = make_str("\"ALL\""); }
| /*EMPTY*/ { $$ = make_str("\"CURRENT\""); }
| /* EMPTY */ { $$ = make_str("\"CURRENT\""); }
;
connection_object: connection_target { $$ = $1; }
connection_object: database_name { $$ = make3_str(make_str("\""), $1, make_str("\"")); }
| DEFAULT { $$ = make_str("\"DEFAULT\""); }
| char_variable { $$ = $1; }
;
/*
......
......@@ -26,14 +26,25 @@ exec sql end declare section;
exec sql connect to connectdb@localhost as main;
exec sql disconnect main;
exec sql connect to @localhost as main;
exec sql disconnect main;
exec sql connect to connectdb@localhost:@TEMP_PORT@ as main;
exec sql disconnect main;
exec sql connect to @localhost:@TEMP_PORT@ as main;
exec sql disconnect main;
exec sql connect to connectdb:@TEMP_PORT@ as main;
exec sql disconnect main;
exec sql connect to :@TEMP_PORT@ as main;
exec sql disconnect main;
exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by connectpw;
exec sql disconnect nonexistant;
exec sql disconnect;
exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/ user connectdb;
exec sql disconnect;
strcpy(pw, "connectpw");
......
......@@ -37,6 +37,9 @@ exec sql end declare section;
exec sql connect to 'connectdb' as main;
exec sql disconnect main;
exec sql connect to as main user connectdb;
exec sql disconnect main;
exec sql connect to connectdb as main user connectuser/connectdb;
exec sql disconnect main;
......@@ -52,12 +55,16 @@ exec sql end declare section;
exec sql connect to "unix:postgresql://200.46.204.71/connectdb" as main user connectuser;
exec sql disconnect main;
exec sql disconnect nonexistant;
exec sql connect to unix:postgresql://localhost/ as main user connectdb;
exec sql disconnect main;
/* connect twice */
exec sql connect to connectdb as main;
exec sql connect to connectdb as main;
exec sql disconnect main;
/* not connected */
exec sql disconnect nonexistant;
return (0);
}
......@@ -17,7 +17,7 @@
#include <sqltypes.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -13,7 +13,7 @@
#include <stdlib.h>
#
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -13,7 +13,7 @@
#include <stdlib.h>
#
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -66,7 +66,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
/* this INSERT works */
rsetnull(CDECIMALTYPE, (char *)&j);
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( 7 , ? )",
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( 7 , ? ) ",
ECPGt_decimal,&(j),(long)1,(long)1,sizeof(decimal),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 27 "test_informix.pgc"
......@@ -82,7 +82,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
/* this INSERT should fail because i is a unique column */
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( 7 , 12 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( 7 , 12 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 31 "test_informix.pgc"
if (sqlca.sqlcode < 0) dosqlprint ( );}
......@@ -96,7 +96,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
#line 33 "test_informix.pgc"
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( ? , 1 )",
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into test ( i , j ) values( ? , 1 ) ",
ECPGt_int,&(i),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 35 "test_informix.pgc"
......@@ -177,7 +177,7 @@ if (sqlca.sqlcode < 0) dosqlprint ( );}
deccvint(7, &j);
deccvint(14, &m);
decadd(&j, &m, &n);
{ ECPGdo(__LINE__, 1, 1, NULL, "delete from test where i = ?",
{ ECPGdo(__LINE__, 1, 1, NULL, "delete from test where i = ? ",
ECPGt_decimal,&(n),(long)1,(long)1,sizeof(decimal),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 72 "test_informix.pgc"
......
......@@ -14,7 +14,7 @@
#include "sqltypes.h"
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -85,7 +85,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#line 5 "test_informix2.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -194,7 +194,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
sql_check("main", "create", 0);
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values( 1 , '2003-05-07 13:28:34 CEST' , 'test' , 'test' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 73 "test_informix2.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
......@@ -233,7 +233,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
c++;
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values( ? , ? , 'test' , 'test' )",
{ ECPGdo(__LINE__, 1, 1, NULL, "insert into history ( customerid , timestamp , action_taken , narrative ) values( ? , ? , 'test' , 'test' ) ",
ECPGt_int,&(c),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_timestamp,&(e),(long)1,(long)1,sizeof(timestamp),
......
......@@ -13,7 +13,7 @@
#include <stdio.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -374,7 +374,7 @@ if (sqlca.sqlcode < 0) PrintAndStop ( msg );}
amount[i]+=1000;
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, "pm", "insert into \"Test\" ( name , amount , letter ) values( ? , ? , ? )",
{ ECPGdo(__LINE__, 0, 1, "pm", "insert into \"Test\" ( name , amount , letter ) values( ? , ? , ? ) ",
ECPGt_char,(n),(long)8,(long)1,(8)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_int,&(amount[i]),(long)1,(long)1,sizeof(int),
......@@ -534,7 +534,7 @@ if (sqlca.sqlcode < 0) PrintAndStop ( msg );}
name_letter[4].amount=1407;
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into \"Test\" ( name , amount , letter ) values( ? , ? , ? )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into \"Test\" ( name , amount , letter ) values( ? , ? , ? ) ",
ECPGt_char,&(name_letter[4].name),(long)8,(long)1,(8)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_int,&(name_letter[4].amount),(long)1,(long)1,sizeof(int),
......
......@@ -11,7 +11,7 @@
#include <string.h>
#line 1 "./header_test.h"
#line 1 "header_test.h"
#include "stdlib.h"
static void
......@@ -22,19 +22,19 @@ Finish(char *msg)
/* finish transaction */
{ ECPGtrans(__LINE__, NULL, "rollback");}
#line 10 "./header_test.h"
#line 10 "header_test.h"
/* and remove test table */
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table meskes ", ECPGt_EOIT, ECPGt_EORT);}
#line 13 "./header_test.h"
#line 13 "header_test.h"
{ ECPGtrans(__LINE__, NULL, "commit");}
#line 14 "./header_test.h"
#line 14 "header_test.h"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 16 "./header_test.h"
#line 16 "header_test.h"
exit(-1);
......@@ -47,16 +47,16 @@ warn(void)
}
/* exec sql whenever sqlerror do Finish ( msg ) ; */
#line 29 "./header_test.h"
#line 29 "header_test.h"
/* exec sql whenever sql_warning do warn ( ) ; */
#line 32 "./header_test.h"
#line 32 "header_test.h"
#line 4 "test2.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -190,7 +190,7 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , married , children ) values( 'Petra' , '19900404' , 3 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , married , children ) values( 'Petra' , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 51 "test2.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -199,7 +199,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 51 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 52 "test2.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -208,7 +208,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 52 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 53 "test2.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -217,7 +217,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 53 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 54 "test2.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -226,7 +226,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 54 "test2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 55 "test2.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......
......@@ -11,7 +11,7 @@
/* Test comment */
/*--------------------------------------------------------------------------*/
#line 1 "./header_test.h"
#line 1 "header_test.h"
#include "stdlib.h"
static void
......@@ -22,19 +22,19 @@ Finish(char *msg)
/* finish transaction */
{ ECPGtrans(__LINE__, NULL, "rollback");}
#line 10 "./header_test.h"
#line 10 "header_test.h"
/* and remove test table */
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table meskes ", ECPGt_EOIT, ECPGt_EORT);}
#line 13 "./header_test.h"
#line 13 "header_test.h"
{ ECPGtrans(__LINE__, NULL, "commit");}
#line 14 "./header_test.h"
#line 14 "header_test.h"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 16 "./header_test.h"
#line 16 "header_test.h"
exit(-1);
......@@ -47,16 +47,16 @@ warn(void)
}
/* exec sql whenever sqlerror do Finish ( msg ) ; */
#line 29 "./header_test.h"
#line 29 "header_test.h"
/* exec sql whenever sql_warning do warn ( ) ; */
#line 32 "./header_test.h"
#line 32 "header_test.h"
#line 4 "test3.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -170,7 +170,7 @@ if (sqlca.sqlcode < 0) Finish ( msg );}
strcpy(msg, "insert");
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , married , children ) values( ? , '19900404' , 3 )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , married , children ) values( ? , '19900404' , 3 ) ",
ECPGt_char,&(wifesname),(long)0,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 45 "test3.pgc"
......@@ -181,7 +181,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 45 "test3.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age , married , children ) values( 'Michael' , 19660117 , 35 , '19900404' , 3 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 46 "test3.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -190,7 +190,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 46 "test3.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Carsten' , 19910103 , 10 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 47 "test3.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -199,7 +199,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 47 "test3.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Marc' , 19930907 , 8 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 48 "test3.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......@@ -208,7 +208,7 @@ if (sqlca.sqlwarn[0] == 'W') warn ( );
if (sqlca.sqlcode < 0) Finish ( msg );}
#line 48 "test3.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into meskes ( name , born , age ) values( 'Chris' , 19970923 , 4 ) ", ECPGt_EOIT, ECPGt_EORT);
#line 49 "test3.pgc"
if (sqlca.sqlwarn[0] == 'W') warn ( );
......
......@@ -16,7 +16,7 @@
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -87,7 +87,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#line 7 "test4.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -11,7 +11,7 @@
#include <stdlib.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -116,7 +116,7 @@ main (void)
exit (sqlca.sqlcode);
}
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into empl values( 1 , 'first user' , 320 , ? )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into empl values( 1 , 'first user' , 320 , ? ) ",
ECPGt_char,&(data),(long)0,(long)1,(1)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
#line 52 "test5.pgc"
......
......@@ -56,70 +56,95 @@ main(void)
#line 27 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "connectdb@localhost:55432" , NULL,NULL , "main", 0); }
{ ECPGconnect(__LINE__, 0, "@localhost" , NULL,NULL , "main", 0); }
#line 29 "test1.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 30 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "connectdb:55432" , NULL,NULL , "main", 0); }
{ ECPGconnect(__LINE__, 0, "connectdb@localhost:55432" , NULL,NULL , "main", 0); }
#line 32 "test1.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 33 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
{ ECPGconnect(__LINE__, 0, "@localhost:55432" , NULL,NULL , "main", 0); }
#line 35 "test1.pgc"
{ ECPGdisconnect(__LINE__, "nonexistant");}
{ ECPGdisconnect(__LINE__, "main");}
#line 36 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "connectdb:55432" , NULL,NULL , "main", 0); }
#line 38 "test1.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 39 "test1.pgc"
{ ECPGconnect(__LINE__, 0, ":55432" , NULL,NULL , "main", 0); }
#line 41 "test1.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 42 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
#line 44 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 37 "test1.pgc"
#line 45 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/" , "connectdb" , NULL , NULL, 0); }
#line 47 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 48 "test1.pgc"
strcpy(pw, "connectpw");
strcpy(db, "tcp:postgresql://localhost:55432/connectdb");
{ ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); }
#line 41 "test1.pgc"
#line 52 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 42 "test1.pgc"
#line 53 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
#line 44 "test1.pgc"
#line 55 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 45 "test1.pgc"
#line 56 "test1.pgc"
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , NULL , NULL, 0); }
#line 47 "test1.pgc"
#line 58 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 48 "test1.pgc"
#line 59 "test1.pgc"
/* wrong db */
{ ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/nonexistant" , "connectuser" , "connectpw" , NULL, 0); }
#line 51 "test1.pgc"
#line 62 "test1.pgc"
{ ECPGdisconnect(__LINE__, "CURRENT");}
#line 52 "test1.pgc"
#line 63 "test1.pgc"
/* wrong port */
{ ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:0/connectdb" , "connectuser" , "connectpw" , NULL, 0); }
#line 55 "test1.pgc"
#line 66 "test1.pgc"
/* no disconnect necessary */
/* wrong password */
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "wrongpw" , NULL, 0); }
#line 59 "test1.pgc"
#line 70 "test1.pgc"
/* no disconnect necessary */
......
......@@ -15,20 +15,34 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port 55432
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port 55432
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 in line 36, 'No such connection nonexistant in line 36.'.
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ecpg_finish: Connection connectdb closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database on localhost port 55432 for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection connectdb closed.
......@@ -43,19 +57,19 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database nonexistant on localhost port 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 51
[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 62
FATAL: database "nonexistant" does not exist
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection nonexistant closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -402 in line 51, 'Could not connect to database nonexistant in line 51.'.
[NO_PID]: raising sqlcode -402 in line 62, 'Could not connect to database nonexistant in line 62.'.
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 in line 52, 'No such connection CURRENT in line 52.'.
[NO_PID]: raising sqlcode -220 in line 63, 'No such connection CURRENT in line 63.'.
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 0 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: could not open database connectdb on localhost port 0 for user connectuser in line 55
[NO_PID]: connect: could not open database connectdb on localhost port 0 for user connectuser in line 66
could not connect to server: Connection refused
Is the server running on host "localhost" and accepting
TCP/IP connections on port 0?
......@@ -63,7 +77,7 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection connectdb closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -402 in line 55, 'Could not connect to database connectdb in line 55.'.
[NO_PID]: raising sqlcode -402 in line 66, 'Could not connect to database connectdb in line 66.'.
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
......@@ -18,7 +18,7 @@
#include <stdio.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -17,7 +17,7 @@
#include <stdio.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -13,7 +13,7 @@
#include <stdio.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -76,14 +76,14 @@ main(void)
#line 38 "test5.pgc"
{ ECPGconnect(__LINE__, 0, "connectdb" , "connectuser" , "connectdb" , "main", 0); }
{ ECPGconnect(__LINE__, 0, "" , "connectdb" , NULL , "main", 0); }
#line 40 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 41 "test5.pgc"
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , NULL , "main", 0); }
{ ECPGconnect(__LINE__, 0, "connectdb" , "connectuser" , "connectdb" , "main", 0); }
#line 43 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
......@@ -104,26 +104,41 @@ main(void)
#line 50 "test5.pgc"
{ ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/connectdb" , "connectuser" , NULL , "main", 0); }
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , NULL , "main", 0); }
#line 52 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 53 "test5.pgc"
{ ECPGdisconnect(__LINE__, "nonexistant");}
{ ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/connectdb" , "connectuser" , NULL , "main", 0); }
#line 55 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 56 "test5.pgc"
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/" , "connectdb" , NULL , "main", 0); }
#line 58 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 59 "test5.pgc"
/* connect twice */
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , "main", 0); }
#line 58 "test5.pgc"
#line 62 "test5.pgc"
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , "main", 0); }
#line 59 "test5.pgc"
#line 63 "test5.pgc"
{ ECPGdisconnect(__LINE__, "main");}
#line 60 "test5.pgc"
#line 64 "test5.pgc"
/* not connected */
{ ECPGdisconnect(__LINE__, "nonexistant");}
#line 67 "test5.pgc"
return (0);
......
......@@ -24,6 +24,10 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
......@@ -40,17 +44,21 @@
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: non-localhost access via sockets in line 52
[NO_PID]: connect: non-localhost access via sockets in line 55
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -402 in line 52, 'Could not connect to database connectdb in line 52.'.
[NO_PID]: raising sqlcode -402 in line 55, 'Could not connect to database connectdb in line 55.'.
[NO_PID]: sqlca: code: -402, state: 08001
[NO_PID]: raising sqlcode -220 in line 53, 'No such connection main in line 53.'.
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: raising sqlcode -220 in line 55, 'No such connection nonexistant in line 55.'.
[NO_PID]: raising sqlcode -220 in line 56, 'No such connection main in line 56.'.
[NO_PID]: sqlca: code: -220, state: 08003
[NO_PID]: ECPGconnect: opening database on <DEFAULT> port <DEFAULT> for user connectdb
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: connect: connection identifier main is already in use
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: raising sqlcode -220 in line 67, 'No such connection nonexistant in line 67.'.
[NO_PID]: sqlca: code: -220, state: 08003
......@@ -8,7 +8,7 @@
#line 1 "init.pgc"
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......
......@@ -15,7 +15,7 @@
#include <pgtypes_interval.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -14,7 +14,7 @@
#include <pgtypes_timestamp.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -13,7 +13,7 @@
#include <decimal.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -89,7 +89,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
des = PGTYPESnumeric_new();
PGTYPESnumeric_copy(res, des);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( text , num ) values( 'test' , ? )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( text , num ) values( 'test' , ? ) ",
ECPGt_numeric,&(des),(long)1,(long)0,sizeof(numeric),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);
#line 52 "num_test.pgc"
......
......@@ -14,7 +14,7 @@
#include <decimal.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -8,7 +8,7 @@
#line 1 "code100.pgc"
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#include <stdio.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -120,7 +120,7 @@ int main(int argc, char **argv)
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
for (index=0;index<10;++index)
{ { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( payload , index ) values( 0 , ? )",
{ { ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( payload , index ) values( 0 , ? ) ",
ECPGt_int,&(index),(long)1,(long)1,sizeof(int),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L, ECPGt_EOIT, ECPGt_EORT);}
#line 28 "code100.pgc"
......@@ -132,17 +132,17 @@ int main(int argc, char **argv)
if (sqlca.sqlcode) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "update test set payload = payload + 1 where index = - 1", ECPGt_EOIT, ECPGt_EORT);}
{ ECPGdo(__LINE__, 0, 1, NULL, "update test set payload = payload + 1 where index = - 1 ", ECPGt_EOIT, ECPGt_EORT);}
#line 35 "code100.pgc"
if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "delete from test where index = - 1", ECPGt_EOIT, ECPGt_EORT);}
{ ECPGdo(__LINE__, 0, 1, NULL, "delete from test where index = - 1 ", ECPGt_EOIT, ECPGt_EORT);}
#line 38 "code100.pgc"
if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( select * from test where index = - 1 )", ECPGt_EOIT, ECPGt_EORT);}
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( select * from test where index = - 1 ) ", ECPGt_EOIT, ECPGt_EORT);}
#line 41 "code100.pgc"
if (sqlca.sqlcode!=100) printf("%ld:%s\n",sqlca.sqlcode,sqlca.sqlerrm.sqlerrmc);
......
......@@ -10,7 +10,7 @@
#include <stdio.h>
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#line 3 "copystdout.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -118,19 +118,19 @@ if (sqlca.sqlcode < 0) sqlprint();}
if (sqlca.sqlcode < 0) sqlprint();}
#line 20 "copystdout.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into foo values( 5 , 'abc' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into foo values( 5 , 'abc' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 21 "copystdout.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 21 "copystdout.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into foo values( 6 , 'def' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into foo values( 6 , 'def' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 22 "copystdout.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
#line 22 "copystdout.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into foo values( 7 , 'ghi' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into foo values( 7 , 'ghi' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 23 "copystdout.pgc"
if (sqlca.sqlcode < 0) sqlprint();}
......
......@@ -8,7 +8,7 @@
#line 1 "define.pgc"
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -79,7 +79,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#line 1 "define.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -125,7 +125,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 19 "define.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 29 , 'abcdef' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 29 , 'abcdef' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 20 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
......@@ -133,7 +133,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , 'defined' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , 'defined' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 23 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
......@@ -146,7 +146,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , 'someothervar not defined' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , 'someothervar not defined' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 31 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
......@@ -171,7 +171,7 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 29 , 'no string' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 29 , 'no string' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 42 "define.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
......
......@@ -8,7 +8,7 @@
#line 1 "desc.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -9,7 +9,7 @@
#line 1 "dynalloc.pgc"
#include <stdio.h>
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#include <stdlib.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -190,13 +190,13 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 37 "dynalloc.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( b , c , d , e , f , g , h , i ) values( 23.456 , 'varchar' , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , true , '(1,2,3,4)' , '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( b , c , d , e , f , g , h , i ) values( 23.456 , 'varchar' , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , true , '(1,2,3,4)' , '2001:4f8:3:ba:2e0:81ff:fe22:d1f1/128' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 38 "dynalloc.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 38 "dynalloc.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( b , c , d , e , f , g , h , i ) values( 2.446456 , null , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , false , null , null )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( b , c , d , e , f , g , h , i ) values( 2.446456 , null , 'v' , 'c' , '2003-03-03 12:33:07 PDT' , false , null , null ) ", ECPGt_EOIT, ECPGt_EORT);
#line 39 "dynalloc.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
......
......@@ -9,7 +9,7 @@
#line 1 "dynalloc2.pgc"
#include <stdio.h>
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#include <stdlib.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -144,37 +144,37 @@ if (sqlca.sqlcode < 0) sqlprint ( );}
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 24 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 1 , 'one' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 1 , 'one' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 25 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 25 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 2 , 'two' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 2 , 'two' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 26 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 26 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , 'three' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , 'three' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 27 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 27 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 4 , 'four' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 4 , 'four' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 28 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 28 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 5 , null )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( 5 , null ) ", ECPGt_EOIT, ECPGt_EORT);
#line 29 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
#line 29 "dynalloc2.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , null )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test values( null , null ) ", ECPGt_EOIT, ECPGt_EORT);
#line 30 "dynalloc2.pgc"
if (sqlca.sqlcode < 0) sqlprint ( );}
......
......@@ -14,7 +14,7 @@
#include <stdlib.h>
#line 1 "./../../include/sql3types.h"
#line 1 "sql3types.h"
#ifndef _ECPG_SQL3TYPES_H
#define _ECPG_SQL3TYPES_H
......@@ -62,7 +62,7 @@ enum
#line 7 "dyntest.pgc"
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -133,7 +133,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#line 8 "dyntest.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -238,13 +238,13 @@ if (sqlca.sqlcode < 0) error ( );}
if (sqlca.sqlcode < 0) error ( );}
#line 53 "dyntest.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into dyntest values( 'first entry' , 14.7 , 14 , 123045607890 , true , 'The world''s most advanced open source database.' , '1987-07-14' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into dyntest values( 'first entry' , 14.7 , 14 , 123045607890 , true , 'The world''s most advanced open source database.' , '1987-07-14' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 54 "dyntest.pgc"
if (sqlca.sqlcode < 0) error ( );}
#line 54 "dyntest.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into dyntest values( 'second entry' , 1407.87 , 1407 , 987065403210 , false , 'The elephant never forgets.' , '1999-11-5' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into dyntest values( 'second entry' , 1407.87 , 1407 , 987065403210 , false , 'The elephant never forgets.' , '1999-11-5' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 55 "dyntest.pgc"
if (sqlca.sqlcode < 0) error ( );}
......
......@@ -12,7 +12,7 @@
#include <string.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -73,7 +73,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 30 "func.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1234 , 'Some random text' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1234 , 'Some random text' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 32 "func.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
......@@ -82,7 +82,7 @@ if (sqlca.sqlwarn[0] == 'W') sqlprint();
if (sqlca.sqlcode < 0) sqlprint();}
#line 32 "func.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 5678 , 'The Quick Brown' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 5678 , 'The Quick Brown' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 33 "func.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
......
......@@ -10,7 +10,7 @@
#include <stdio.h>
#line 1 "./../../include/sqlca.h"
#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
......@@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
#line 3 "indicators.pgc"
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -123,18 +123,18 @@ int main(int argc, char **argv)
#line 23 "indicators.pgc"
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( id , str , val ) values( 1 , 'Hello' , 0 )", ECPGt_EOIT, ECPGt_EORT);}
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( id , str , val ) values( 1 , 'Hello' , 0 ) ", ECPGt_EOIT, ECPGt_EORT);}
#line 25 "indicators.pgc"
/* use indicator in insert */
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( id , str , val ) values( 2 , 'Hi there' , ? )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( id , str , val ) values( 2 , 'Hi there' , ? ) ",
ECPGt_int,&(intvar),(long)1,(long)1,sizeof(int),
ECPGt_int,&(nullind),(long)1,(long)1,sizeof(int), ECPGt_EOIT, ECPGt_EORT);}
#line 28 "indicators.pgc"
nullind = 0;
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( id , str , val ) values( 3 , 'Good evening' , ? )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test ( id , str , val ) values( 3 , 'Good evening' , ? ) ",
ECPGt_int,&(intvar),(long)1,(long)1,sizeof(int),
ECPGt_int,&(nullind),(long)1,(long)1,sizeof(int), ECPGt_EOIT, ECPGt_EORT);}
#line 30 "indicators.pgc"
......@@ -164,7 +164,7 @@ int main(int argc, char **argv)
/* use indicators for update */
intvar = 5; nullind = -1;
{ ECPGdo(__LINE__, 0, 1, NULL, "update test set val = ? where id = 1",
{ ECPGdo(__LINE__, 0, 1, NULL, "update test set val = ? where id = 1 ",
ECPGt_int,&(intvar),(long)1,(long)1,sizeof(int),
ECPGt_int,&(nullind),(long)1,(long)1,sizeof(int), ECPGt_EOIT, ECPGt_EORT);}
#line 42 "indicators.pgc"
......
......@@ -12,7 +12,7 @@
#include <string.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -71,7 +71,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
printf("Standard conforming strings: %s\n", var);
/* this is a\\b actually */
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 25 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
......@@ -81,7 +81,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 25 "quote.pgc"
/* this is a\b */
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 27 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
......@@ -102,7 +102,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
/* this is a\\b actually */
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 32 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
......@@ -112,7 +112,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#line 32 "quote.pgc"
/* this is a\b */
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' )", ECPGt_EOIT, ECPGt_EORT);
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into My_Table values( 1 , 'a\\\\b' ) ", ECPGt_EOIT, ECPGt_EORT);
#line 34 "quote.pgc"
if (sqlca.sqlwarn[0] == 'W') sqlprint();
......
......@@ -12,7 +12,7 @@
#include <string.h>
#line 1 "./../regression.h"
#line 1 "regression.h"
......
......@@ -26,7 +26,7 @@ main(void)
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -167,7 +167,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#ifdef DEBUG
printf("%s: inserting %d\n", l_connection, l_i);
#endif
{ ECPGdo(__LINE__, 0, 1, l_connection, "insert into test_thread ( thread , iteration ) values( ? , ? )",
{ ECPGdo(__LINE__, 0, 1, l_connection, "insert into test_thread ( thread , iteration ) values( ? , ? ) ",
ECPGt_char,(l_connection),(long)128,(long)1,(128)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_int,&(l_i),(long)1,(long)1,sizeof(int),
......
......@@ -27,7 +27,7 @@ main(void)
#line 1 "./../regression.h"
#line 1 "regression.h"
......@@ -168,7 +168,7 @@ if (sqlca.sqlcode < 0) sqlprint();}
#ifdef DEBUG
printf("%s: inserting %d\n", l_connection, l_i);
#endif
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test_thread ( thread , iteration ) values( ? , ? )",
{ ECPGdo(__LINE__, 0, 1, NULL, "insert into test_thread ( thread , iteration ) values( ? , ? ) ",
ECPGt_char,(l_connection),(long)128,(long)1,(128)*sizeof(char),
ECPGt_NO_INDICATOR, NULL , 0L, 0L, 0L,
ECPGt_int,&(l_i),(long)1,(long)1,sizeof(int),
......
#! /bin/sh
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.7 2006/08/28 16:13:11 tgl Exp $
# $PostgreSQL: pgsql/src/interfaces/ecpg/test/pg_regress.sh,v 1.8 2006/08/29 12:24:51 meskes Exp $
me=`basename $0`
......@@ -691,6 +691,12 @@ echo "$bindir/createuser" $psql_options -R -S -D -q connectuser
if [ $? -ne 0 ]; then
echo Could not create user connectuser
fi
# to test username = dbname
echo "$bindir/createuser" $psql_options -R -S -D -q connectdb
"$bindir/createuser" $psql_options -R -S -D -q connectdb
if [ $? -ne 0 ]; then
echo Could not create user connectdb
fi
# this variable prevents that the PID gets included in the logfiles
ECPG_REGRESSION=1; export ECPG_REGRESSION
......
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