From b1710339ba2e318cf6af1a50d4256e9fa98e6c8a Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Tue, 29 Aug 2006 12:24:52 +0000 Subject: [PATCH] Fixed parser and library to allow empty database names. Streamlined connection name parsing. Added Joachim's patch to shorten paths before diffing. --- src/interfaces/ecpg/ChangeLog | 5 ++ src/interfaces/ecpg/ecpglib/connect.c | 5 +- src/interfaces/ecpg/preproc/preproc.y | 33 +++++----- src/interfaces/ecpg/test/connect/test1.pgc.in | 13 +++- src/interfaces/ecpg/test/connect/test5.pgc | 9 ++- .../test/expected/compat_informix-dec_test.c | 2 +- .../test/expected/compat_informix-rnull.c | 2 +- .../expected/compat_informix-test_informix.c | 10 +-- .../expected/compat_informix-test_informix2.c | 8 +-- .../ecpg/test/expected/complex-test1.c | 6 +- .../ecpg/test/expected/complex-test2.c | 26 ++++---- .../ecpg/test/expected/complex-test3.c | 26 ++++---- .../ecpg/test/expected/complex-test4.c | 4 +- .../ecpg/test/expected/complex-test5.c | 4 +- .../ecpg/test/expected/connect-test1.c | 61 +++++++++++++------ .../ecpg/test/expected/connect-test1.stderr | 28 ++++++--- .../ecpg/test/expected/connect-test2.c | 2 +- .../ecpg/test/expected/connect-test3.c | 2 +- .../ecpg/test/expected/connect-test4.c | 2 +- .../ecpg/test/expected/connect-test5.c | 29 ++++++--- .../ecpg/test/expected/connect-test5.stderr | 18 ++++-- .../ecpg/test/expected/errors-init.c | 2 +- .../ecpg/test/expected/pgtypeslib-dt_test.c | 2 +- .../ecpg/test/expected/pgtypeslib-dt_test2.c | 2 +- .../ecpg/test/expected/pgtypeslib-num_test.c | 4 +- .../ecpg/test/expected/pgtypeslib-num_test2.c | 2 +- .../ecpg/test/expected/sql-code100.c | 12 ++-- .../ecpg/test/expected/sql-copystdout.c | 10 +-- .../ecpg/test/expected/sql-define.c | 12 ++-- src/interfaces/ecpg/test/expected/sql-desc.c | 2 +- .../ecpg/test/expected/sql-dynalloc.c | 8 +-- .../ecpg/test/expected/sql-dynalloc2.c | 16 ++--- .../ecpg/test/expected/sql-dyntest.c | 10 +-- src/interfaces/ecpg/test/expected/sql-func.c | 6 +- .../ecpg/test/expected/sql-indicators.c | 12 ++-- src/interfaces/ecpg/test/expected/sql-quote.c | 10 +-- src/interfaces/ecpg/test/expected/sql-show.c | 2 +- .../ecpg/test/expected/thread-thread.c | 4 +- .../test/expected/thread-thread_implicit.c | 4 +- src/interfaces/ecpg/test/pg_regress.sh | 8 ++- 40 files changed, 260 insertions(+), 163 deletions(-) diff --git a/src/interfaces/ecpg/ChangeLog b/src/interfaces/ecpg/ChangeLog index 032e997b11..c7e65abb3f 100644 --- a/src/interfaces/ecpg/ChangeLog +++ b/src/interfaces/ecpg/ChangeLog @@ -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. diff --git a/src/interfaces/ecpg/ecpglib/connect.c b/src/interfaces/ecpg/ecpglib/connect.c index 4ce68c23e1..b07a8bbeb6 100644 --- a/src/interfaces/ecpg/ecpglib/connect.c +++ b/src/interfaces/ecpg/ecpglib/connect.c @@ -1,4 +1,4 @@ -/* $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 diff --git a/src/interfaces/ecpg/preproc/preproc.y b/src/interfaces/ecpg/preproc/preproc.y index e2bd8c40a5..3bdd5d9912 100644 --- a/src/interfaces/ecpg/preproc/preproc.y +++ b/src/interfaces/ecpg/preproc/preproc.y @@ -1,4 +1,4 @@ -/* $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 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 @@ -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; /* @@ -677,7 +677,7 @@ stmt: AlterDatabaseStmt { output_statement($1, 0, connection); } | 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); } @@ -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: :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) @@ -4690,10 +4694,10 @@ server_name: ColId { $$ = $1; } ; 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"); } ; @@ -5491,14 +5495,15 @@ ECPGDeclare: DECLARE STATEMENT ident 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; } ; /* diff --git a/src/interfaces/ecpg/test/connect/test1.pgc.in b/src/interfaces/ecpg/test/connect/test1.pgc.in index b2141d1c23..3962ff317a 100644 --- a/src/interfaces/ecpg/test/connect/test1.pgc.in +++ b/src/interfaces/ecpg/test/connect/test1.pgc.in @@ -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"); diff --git a/src/interfaces/ecpg/test/connect/test5.pgc b/src/interfaces/ecpg/test/connect/test5.pgc index 8601196bda..ae0199daf6 100644 --- a/src/interfaces/ecpg/test/connect/test5.pgc +++ b/src/interfaces/ecpg/test/connect/test5.pgc @@ -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); } diff --git a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c index cb51daaf0b..76e321af15 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-dec_test.c @@ -17,7 +17,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/compat_informix-rnull.c b/src/interfaces/ecpg/test/expected/compat_informix-rnull.c index 74fcfc74a7..9ee19ace76 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-rnull.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-rnull.c @@ -13,7 +13,7 @@ #include # -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c index b6efd82727..53e39a008d 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix.c @@ -13,7 +13,7 @@ #include # -#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" diff --git a/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c b/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c index cbad25aba5..12c34203fa 100644 --- a/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c +++ b/src/interfaces/ecpg/test/expected/compat_informix-test_informix2.c @@ -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), diff --git a/src/interfaces/ecpg/test/expected/complex-test1.c b/src/interfaces/ecpg/test/expected/complex-test1.c index f0f93a04ca..82a3df9559 100644 --- a/src/interfaces/ecpg/test/expected/complex-test1.c +++ b/src/interfaces/ecpg/test/expected/complex-test1.c @@ -13,7 +13,7 @@ #include -#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), diff --git a/src/interfaces/ecpg/test/expected/complex-test2.c b/src/interfaces/ecpg/test/expected/complex-test2.c index 92fe0fabf0..d11a1c3337 100644 --- a/src/interfaces/ecpg/test/expected/complex-test2.c +++ b/src/interfaces/ecpg/test/expected/complex-test2.c @@ -11,7 +11,7 @@ #include -#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 ( ); diff --git a/src/interfaces/ecpg/test/expected/complex-test3.c b/src/interfaces/ecpg/test/expected/complex-test3.c index e97822a8ce..ab4c33def1 100644 --- a/src/interfaces/ecpg/test/expected/complex-test3.c +++ b/src/interfaces/ecpg/test/expected/complex-test3.c @@ -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 ( ); diff --git a/src/interfaces/ecpg/test/expected/complex-test4.c b/src/interfaces/ecpg/test/expected/complex-test4.c index 9ac0fe0d25..d56b1954c7 100644 --- a/src/interfaces/ecpg/test/expected/complex-test4.c +++ b/src/interfaces/ecpg/test/expected/complex-test4.c @@ -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" diff --git a/src/interfaces/ecpg/test/expected/complex-test5.c b/src/interfaces/ecpg/test/expected/complex-test5.c index ec7f04f9b3..337a5d8984 100644 --- a/src/interfaces/ecpg/test/expected/complex-test5.c +++ b/src/interfaces/ecpg/test/expected/complex-test5.c @@ -11,7 +11,7 @@ #include -#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" diff --git a/src/interfaces/ecpg/test/expected/connect-test1.c b/src/interfaces/ecpg/test/expected/connect-test1.c index e76e81f684..61119dd6fd 100644 --- a/src/interfaces/ecpg/test/expected/connect-test1.c +++ b/src/interfaces/ecpg/test/expected/connect-test1.c @@ -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" - { ECPGdisconnect(__LINE__, "CURRENT");} -#line 37 "test1.pgc" + + { ECPGconnect(__LINE__, 0, "connectdb:55432" , NULL,NULL , "main", 0); } +#line 38 "test1.pgc" + + { ECPGdisconnect(__LINE__, "main");} +#line 39 "test1.pgc" - strcpy(pw, "connectpw"); - strcpy(db, "tcp:postgresql://localhost:55432/connectdb"); - { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); } + { ECPGconnect(__LINE__, 0, ":55432" , NULL,NULL , "main", 0); } #line 41 "test1.pgc" - { ECPGdisconnect(__LINE__, "CURRENT");} + { ECPGdisconnect(__LINE__, "main");} #line 42 "test1.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); } #line 44 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} #line 45 "test1.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , NULL , NULL, 0); } + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/" , "connectdb" , NULL , NULL, 0); } #line 47 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} #line 48 "test1.pgc" - /* wrong db */ - { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/nonexistant" , "connectuser" , "connectpw" , NULL, 0); } -#line 51 "test1.pgc" + strcpy(pw, "connectpw"); + strcpy(db, "tcp:postgresql://localhost:55432/connectdb"); + { ECPGconnect(__LINE__, 0, db , "connectuser" , pw , NULL, 0); } +#line 52 "test1.pgc" { ECPGdisconnect(__LINE__, "CURRENT");} -#line 52 "test1.pgc" +#line 53 "test1.pgc" + + + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , "connectpw" , NULL, 0); } +#line 55 "test1.pgc" + + { ECPGdisconnect(__LINE__, "CURRENT");} +#line 56 "test1.pgc" + + + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost:55432/connectdb" , "connectuser" , NULL , NULL, 0); } +#line 58 "test1.pgc" + + { ECPGdisconnect(__LINE__, "CURRENT");} +#line 59 "test1.pgc" + + + /* wrong db */ + { ECPGconnect(__LINE__, 0, "tcp:postgresql://localhost:55432/nonexistant" , "connectuser" , "connectpw" , NULL, 0); } +#line 62 "test1.pgc" + + { ECPGdisconnect(__LINE__, "CURRENT");} +#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 */ diff --git a/src/interfaces/ecpg/test/expected/connect-test1.stderr b/src/interfaces/ecpg/test/expected/connect-test1.stderr index 50ec23f831..9668223f7a 100644 --- a/src/interfaces/ecpg/test/expected/connect-test1.stderr +++ b/src/interfaces/ecpg/test/expected/connect-test1.stderr @@ -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 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. @@ -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 port 55432 for user connectuser [NO_PID]: sqlca: code: 0, state: 00000 diff --git a/src/interfaces/ecpg/test/expected/connect-test2.c b/src/interfaces/ecpg/test/expected/connect-test2.c index 731f203b60..ce18b08bf8 100644 --- a/src/interfaces/ecpg/test/expected/connect-test2.c +++ b/src/interfaces/ecpg/test/expected/connect-test2.c @@ -18,7 +18,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/connect-test3.c b/src/interfaces/ecpg/test/expected/connect-test3.c index 32d24bedf4..5e4451a4c5 100644 --- a/src/interfaces/ecpg/test/expected/connect-test3.c +++ b/src/interfaces/ecpg/test/expected/connect-test3.c @@ -17,7 +17,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/connect-test4.c b/src/interfaces/ecpg/test/expected/connect-test4.c index 34388ebde2..ba15660f33 100644 --- a/src/interfaces/ecpg/test/expected/connect-test4.c +++ b/src/interfaces/ecpg/test/expected/connect-test4.c @@ -13,7 +13,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/connect-test5.c b/src/interfaces/ecpg/test/expected/connect-test5.c index 31eb145bf2..6075aacf13 100644 --- a/src/interfaces/ecpg/test/expected/connect-test5.c +++ b/src/interfaces/ecpg/test/expected/connect-test5.c @@ -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); diff --git a/src/interfaces/ecpg/test/expected/connect-test5.stderr b/src/interfaces/ecpg/test/expected/connect-test5.stderr index a50cff0d18..877b24b37d 100644 --- a/src/interfaces/ecpg/test/expected/connect-test5.stderr +++ b/src/interfaces/ecpg/test/expected/connect-test5.stderr @@ -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 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. @@ -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 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 diff --git a/src/interfaces/ecpg/test/expected/errors-init.c b/src/interfaces/ecpg/test/expected/errors-init.c index c546ee3425..0d085b140d 100644 --- a/src/interfaces/ecpg/test/expected/errors-init.c +++ b/src/interfaces/ecpg/test/expected/errors-init.c @@ -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 diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c index ed734e5449..0ce27f4596 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test.c @@ -15,7 +15,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c index 9df8b9b14d..805f50f7e8 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-dt_test2.c @@ -14,7 +14,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c index d865bc5485..e997a2ce4e 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test.c @@ -13,7 +13,7 @@ #include -#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" diff --git a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c index 3d7468678c..df7a39898a 100644 --- a/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c +++ b/src/interfaces/ecpg/test/expected/pgtypeslib-num_test2.c @@ -14,7 +14,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/sql-code100.c b/src/interfaces/ecpg/test/expected/sql-code100.c index 7e8aa4acc5..88bb07925a 100644 --- a/src/interfaces/ecpg/test/expected/sql-code100.c +++ b/src/interfaces/ecpg/test/expected/sql-code100.c @@ -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 -#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); diff --git a/src/interfaces/ecpg/test/expected/sql-copystdout.c b/src/interfaces/ecpg/test/expected/sql-copystdout.c index d8af0fb051..8e14452872 100644 --- a/src/interfaces/ecpg/test/expected/sql-copystdout.c +++ b/src/interfaces/ecpg/test/expected/sql-copystdout.c @@ -10,7 +10,7 @@ #include -#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();} diff --git a/src/interfaces/ecpg/test/expected/sql-define.c b/src/interfaces/ecpg/test/expected/sql-define.c index 96aeb88f01..44cd13bedb 100644 --- a/src/interfaces/ecpg/test/expected/sql-define.c +++ b/src/interfaces/ecpg/test/expected/sql-define.c @@ -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 ( );} diff --git a/src/interfaces/ecpg/test/expected/sql-desc.c b/src/interfaces/ecpg/test/expected/sql-desc.c index 2ca755b3a0..d1c776fca1 100644 --- a/src/interfaces/ecpg/test/expected/sql-desc.c +++ b/src/interfaces/ecpg/test/expected/sql-desc.c @@ -8,7 +8,7 @@ #line 1 "desc.pgc" -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/sql-dynalloc.c b/src/interfaces/ecpg/test/expected/sql-dynalloc.c index adee7305b4..77cfa52b19 100644 --- a/src/interfaces/ecpg/test/expected/sql-dynalloc.c +++ b/src/interfaces/ecpg/test/expected/sql-dynalloc.c @@ -9,7 +9,7 @@ #line 1 "dynalloc.pgc" #include -#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 -#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 ( );} diff --git a/src/interfaces/ecpg/test/expected/sql-dynalloc2.c b/src/interfaces/ecpg/test/expected/sql-dynalloc2.c index 10ab466ac8..69d9446169 100644 --- a/src/interfaces/ecpg/test/expected/sql-dynalloc2.c +++ b/src/interfaces/ecpg/test/expected/sql-dynalloc2.c @@ -9,7 +9,7 @@ #line 1 "dynalloc2.pgc" #include -#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 -#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 ( );} diff --git a/src/interfaces/ecpg/test/expected/sql-dyntest.c b/src/interfaces/ecpg/test/expected/sql-dyntest.c index 167b6aeb68..5ecd7c6518 100644 --- a/src/interfaces/ecpg/test/expected/sql-dyntest.c +++ b/src/interfaces/ecpg/test/expected/sql-dyntest.c @@ -14,7 +14,7 @@ #include -#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 ( );} diff --git a/src/interfaces/ecpg/test/expected/sql-func.c b/src/interfaces/ecpg/test/expected/sql-func.c index 0f3a833bf5..6f8bf3a17f 100644 --- a/src/interfaces/ecpg/test/expected/sql-func.c +++ b/src/interfaces/ecpg/test/expected/sql-func.c @@ -12,7 +12,7 @@ #include -#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(); diff --git a/src/interfaces/ecpg/test/expected/sql-indicators.c b/src/interfaces/ecpg/test/expected/sql-indicators.c index bf8df3bdbf..cc7054d473 100644 --- a/src/interfaces/ecpg/test/expected/sql-indicators.c +++ b/src/interfaces/ecpg/test/expected/sql-indicators.c @@ -10,7 +10,7 @@ #include -#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" diff --git a/src/interfaces/ecpg/test/expected/sql-quote.c b/src/interfaces/ecpg/test/expected/sql-quote.c index 652c02871c..5c2dceb4d0 100644 --- a/src/interfaces/ecpg/test/expected/sql-quote.c +++ b/src/interfaces/ecpg/test/expected/sql-quote.c @@ -12,7 +12,7 @@ #include -#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(); diff --git a/src/interfaces/ecpg/test/expected/sql-show.c b/src/interfaces/ecpg/test/expected/sql-show.c index 46fadb436a..e5c906b45e 100644 --- a/src/interfaces/ecpg/test/expected/sql-show.c +++ b/src/interfaces/ecpg/test/expected/sql-show.c @@ -12,7 +12,7 @@ #include -#line 1 "./../regression.h" +#line 1 "regression.h" diff --git a/src/interfaces/ecpg/test/expected/thread-thread.c b/src/interfaces/ecpg/test/expected/thread-thread.c index cd7ea2a9c2..96be500f6f 100644 --- a/src/interfaces/ecpg/test/expected/thread-thread.c +++ b/src/interfaces/ecpg/test/expected/thread-thread.c @@ -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), diff --git a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c index 3e28677618..b2a95d5400 100644 --- a/src/interfaces/ecpg/test/expected/thread-thread_implicit.c +++ b/src/interfaces/ecpg/test/expected/thread-thread_implicit.c @@ -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), diff --git a/src/interfaces/ecpg/test/pg_regress.sh b/src/interfaces/ecpg/test/pg_regress.sh index 35a42158cd..d9d9f66945 100644 --- a/src/interfaces/ecpg/test/pg_regress.sh +++ b/src/interfaces/ecpg/test/pg_regress.sh @@ -1,5 +1,5 @@ #! /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