Streamlined connection name parsing.
Added Joachim's patch to shorten paths before diffing.
- 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"
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 */
%{
%type opt_instead event RuleActionList opt_using CreateAssertStmt
%type RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
%type RuleStmt opt_column oper_argtypes NumConst var_name
-%type MathOp RemoveFuncStmt ECPGunreserved_con
+%type MathOp RemoveFuncStmt ECPGunreserved_con opt_database_name
%type RemoveAggrStmt opt_procedural select_no_parens CreateCastStmt
%type RemoveOperStmt RenameStmt all_Op opt_trusted opt_lancompiler
%type VariableSetStmt var_value zone_value VariableShowStmt
| '}' { remove_typedefs(braces_open); remove_variables(braces_open--); fputs("}", yyout); }
;
-opt_at: AT connection_target
+opt_at: AT connection_object
{
connection = $2;
/*
| ClusterStmt { output_statement($1, 0, connection); }
| CommentStmt { output_statement($1, 0, connection); }
| ConstraintsSetStmt { output_statement($1, 0, connection); }
- | CopyStmt { output_statement($1, 0, connection); }
+ | CopyStmt { output_statement($1, 0, connection); }
| CreateAsStmt { output_statement($1, 0, connection); }
| CreateAssertStmt { output_statement($1, 0, connection); }
| CreateCastStmt { output_statement($1, 0, connection); }
{ $$ = 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) != '@')
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: :postgresql://server[:port][/dbname] */
if (strncmp($1, "unix:postgresql", strlen("unix:postgresql")) != 0 && strncmp($1, "tcp:postgresql", strlen("tcp:postgresql")) != 0)
}
;
+opt_database_name: database_name { $$ = $1; }
+ | /*EMPTY*/ { $$ = EMPTY; }
+ ;
+
db_prefix: ident cvariable
{
if (strcmp($2, "postgresql") != 0 && strcmp($2, "postgres") != 0)
;
opt_port: ':' PosIntConst { $$ = make2_str(make_str(":"), $2); }
- | /*EMPTY*/ { $$ = EMPTY; }
+ | /*EMPTY*/ { $$ = EMPTY; }
;
-opt_connection_name: AS connection_target { $$ = $2; }
+opt_connection_name: AS connection_object { $$ = $2; }
| /*EMPTY*/ { $$ = make_str("NULL"); }
;
ECPGDisconnect: SQL_DISCONNECT dis_name { $$ = $2; }
;
-dis_name: connection_object { $$ = $1; }
- | SQL_CURRENT { $$ = make_str("\"CURRENT\""); }
- | ALL { $$ = make_str("\"ALL\""); }
- | /*EMPTY*/ { $$ = make_str("\"CURRENT\""); }
+dis_name: connection_object { $$ = $1; }
+ | SQL_CURRENT { $$ = make_str("\"CURRENT\""); }
+ | ALL { $$ = make_str("\"ALL\""); }
+ | /* EMPTY */ { $$ = make_str("\"CURRENT\""); }
;
-connection_object: connection_target { $$ = $1; }
- | DEFAULT { $$ = make_str("\"DEFAULT\""); }
+connection_object: database_name { $$ = make3_str(make_str("\""), $1, make_str("\"")); }
+ | DEFAULT { $$ = make_str("\"DEFAULT\""); }
+ | char_variable { $$ = $1; }
;
/*
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");
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;
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);
}
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#include
#
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#include
#
-#line 1 "./../regression.h"
+#line 1 "regression.h"
/* 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"
/* 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 ( );}
#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"
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"
#include "sqltypes.h"
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#line 5 "test_informix2.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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();}
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),
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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),
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),
#include
-#line 1 "./header_test.h"
+#line 1 "header_test.h"
#include "stdlib.h"
static void
/* 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);
}
/* 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"
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 ( );
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 ( );
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 ( );
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 ( );
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 ( );
/* Test comment */
/*--------------------------------------------------------------------------*/
-#line 1 "./header_test.h"
+#line 1 "header_test.h"
#include "stdlib.h"
static void
/* 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);
}
/* 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"
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"
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 ( );
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 ( );
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 ( );
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 ( );
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#line 7 "test4.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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"
#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 */
[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 on localhost port
+[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 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 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 on 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.
[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?
[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 port 55432 for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#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");}
#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);
[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 on port 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 port for user connectuser
[NO_PID]: sqlca: code: 0, state: 00000
[NO_PID]: ecpg_finish: Connection main closed.
[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 port 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 port
[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
#line 1 "init.pgc"
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
-#line 1 "./../regression.h"
+#line 1 "regression.h"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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"
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#line 1 "code100.pgc"
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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"
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);
#include
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#line 3 "copystdout.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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();}
#line 1 "define.pgc"
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#line 1 "define.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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 ( );}
- { 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 ( );}
- { 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 ( );}
- { 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 ( );}
#line 1 "desc.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#line 1 "dynalloc.pgc"
#include
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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 ( );}
#line 1 "dynalloc2.pgc"
#include
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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 ( );}
#include
-#line 1 "./../../include/sql3types.h"
+#line 1 "sql3types.h"
#ifndef _ECPG_SQL3TYPES_H
#define _ECPG_SQL3TYPES_H
#line 7 "dyntest.pgc"
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#line 8 "dyntest.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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 ( );}
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#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();
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();
#include
-#line 1 "./../../include/sqlca.h"
+#line 1 "sqlca.h"
#ifndef POSTGRES_SQLCA_H
#define POSTGRES_SQLCA_H
#line 3 "indicators.pgc"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#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"
/* 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"
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
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();
#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();
/* 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();
#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();
#include
-#line 1 "./../regression.h"
+#line 1 "regression.h"
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#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),
-#line 1 "./../regression.h"
+#line 1 "regression.h"
#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`
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