mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Fixed parser and library to allow empty database names.
Streamlined connection name parsing. Added Joachim's patch to shorten paths before diffing.
This commit is contained in:
parent
ba9f9bf1b1
commit
b1710339ba
@ -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.
|
||||
|
@ -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
|
||||
|
@ -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 <str> opt_instead event RuleActionList opt_using CreateAssertStmt
|
||||
%type <str> RuleActionStmtOrEmpty RuleActionMulti func_as reindex_type
|
||||
%type <str> RuleStmt opt_column oper_argtypes NumConst var_name
|
||||
%type <str> MathOp RemoveFuncStmt ECPGunreserved_con
|
||||
%type <str> MathOp RemoveFuncStmt ECPGunreserved_con opt_database_name
|
||||
%type <str> RemoveAggrStmt opt_procedural select_no_parens CreateCastStmt
|
||||
%type <str> RemoveOperStmt RenameStmt all_Op opt_trusted opt_lancompiler
|
||||
%type <str> VariableSetStmt var_value zone_value VariableShowStmt
|
||||
@ -624,7 +624,7 @@ statement: ecpgstart opt_at stmt ';' { connection = NULL; }
|
||||
| '}' { remove_typedefs(braces_open); remove_variables(braces_open--); fputs("}", yyout); }
|
||||
;
|
||||
|
||||
opt_at: AT connection_target
|
||||
opt_at: AT connection_object
|
||||
{
|
||||
connection = $2;
|
||||
/*
|
||||
@ -4616,7 +4616,7 @@ ECPGConnect: SQL_CONNECT TO connection_target opt_connection_name opt_user
|
||||
{ $$ = cat2_str($2, make_str(",NULL,NULL,NULL")); }
|
||||
;
|
||||
|
||||
connection_target: database_name opt_server opt_port
|
||||
connection_target: opt_database_name opt_server opt_port
|
||||
{
|
||||
/* old style: dbname[@server][:port] */
|
||||
if (strlen($2) > 0 && *($2) != '@')
|
||||
@ -4628,7 +4628,7 @@ connection_target: database_name opt_server opt_port
|
||||
else
|
||||
$$ = make3_str(make_str("\""), make3_str($1, $2, $3), make_str("\""));
|
||||
}
|
||||
| db_prefix ':' server opt_port '/' database_name opt_options
|
||||
| db_prefix ':' server opt_port '/' opt_database_name opt_options
|
||||
{
|
||||
/* new style: <tcp|unix>:postgresql://server[:port][/dbname] */
|
||||
if (strncmp($1, "unix:postgresql", strlen("unix:postgresql")) != 0 && strncmp($1, "tcp:postgresql", strlen("tcp:postgresql")) != 0)
|
||||
@ -4659,6 +4659,10 @@ connection_target: database_name opt_server opt_port
|
||||
}
|
||||
;
|
||||
|
||||
opt_database_name: database_name { $$ = $1; }
|
||||
| /*EMPTY*/ { $$ = EMPTY; }
|
||||
;
|
||||
|
||||
db_prefix: ident cvariable
|
||||
{
|
||||
if (strcmp($2, "postgresql") != 0 && strcmp($2, "postgres") != 0)
|
||||
@ -4693,7 +4697,7 @@ opt_port: ':' PosIntConst { $$ = make2_str(make_str(":"), $2); }
|
||||
| /*EMPTY*/ { $$ = EMPTY; }
|
||||
;
|
||||
|
||||
opt_connection_name: AS connection_target { $$ = $2; }
|
||||
opt_connection_name: AS connection_object { $$ = $2; }
|
||||
| /*EMPTY*/ { $$ = make_str("NULL"); }
|
||||
;
|
||||
|
||||
@ -5497,8 +5501,9 @@ dis_name: connection_object { $$ = $1; }
|
||||
| /* EMPTY */ { $$ = make_str("\"CURRENT\""); }
|
||||
;
|
||||
|
||||
connection_object: connection_target { $$ = $1; }
|
||||
connection_object: database_name { $$ = make3_str(make_str("\""), $1, make_str("\"")); }
|
||||
| DEFAULT { $$ = make_str("\"DEFAULT\""); }
|
||||
| char_variable { $$ = $1; }
|
||||
;
|
||||
|
||||
/*
|
||||
|
@ -26,14 +26,25 @@ exec sql end declare section;
|
||||
exec sql connect to connectdb@localhost as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to @localhost as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to connectdb@localhost:@TEMP_PORT@ as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to @localhost:@TEMP_PORT@ as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to connectdb:@TEMP_PORT@ as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to :@TEMP_PORT@ as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/connectdb user connectuser identified by connectpw;
|
||||
exec sql disconnect nonexistant;
|
||||
exec sql disconnect;
|
||||
|
||||
exec sql connect to tcp:postgresql://localhost:@TEMP_PORT@/ user connectdb;
|
||||
exec sql disconnect;
|
||||
|
||||
strcpy(pw, "connectpw");
|
||||
|
@ -37,6 +37,9 @@ exec sql end declare section;
|
||||
exec sql connect to 'connectdb' as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to as main user connectdb;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql connect to connectdb as main user connectuser/connectdb;
|
||||
exec sql disconnect main;
|
||||
|
||||
@ -52,12 +55,16 @@ exec sql end declare section;
|
||||
exec sql connect to "unix:postgresql://200.46.204.71/connectdb" as main user connectuser;
|
||||
exec sql disconnect main;
|
||||
|
||||
exec sql disconnect nonexistant;
|
||||
exec sql connect to unix:postgresql://localhost/ as main user connectdb;
|
||||
exec sql disconnect main;
|
||||
|
||||
/* connect twice */
|
||||
exec sql connect to connectdb as main;
|
||||
exec sql connect to connectdb as main;
|
||||
exec sql disconnect main;
|
||||
|
||||
/* not connected */
|
||||
exec sql disconnect nonexistant;
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <sqltypes.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#line 1 "./header_test.h"
|
||||
#line 1 "header_test.h"
|
||||
#include "stdlib.h"
|
||||
|
||||
static void
|
||||
@ -22,19 +22,19 @@ Finish(char *msg)
|
||||
|
||||
/* finish transaction */
|
||||
{ ECPGtrans(__LINE__, NULL, "rollback");}
|
||||
#line 10 "./header_test.h"
|
||||
#line 10 "header_test.h"
|
||||
|
||||
|
||||
/* and remove test table */
|
||||
{ ECPGdo(__LINE__, 0, 1, NULL, "drop table meskes ", ECPGt_EOIT, ECPGt_EORT);}
|
||||
#line 13 "./header_test.h"
|
||||
#line 13 "header_test.h"
|
||||
|
||||
{ ECPGtrans(__LINE__, NULL, "commit");}
|
||||
#line 14 "./header_test.h"
|
||||
#line 14 "header_test.h"
|
||||
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "CURRENT");}
|
||||
#line 16 "./header_test.h"
|
||||
#line 16 "header_test.h"
|
||||
|
||||
|
||||
exit(-1);
|
||||
@ -47,16 +47,16 @@ warn(void)
|
||||
}
|
||||
|
||||
/* exec sql whenever sqlerror do Finish ( msg ) ; */
|
||||
#line 29 "./header_test.h"
|
||||
#line 29 "header_test.h"
|
||||
|
||||
/* exec sql whenever sql_warning do warn ( ) ; */
|
||||
#line 32 "./header_test.h"
|
||||
#line 32 "header_test.h"
|
||||
|
||||
|
||||
#line 4 "test2.pgc"
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -87,7 +87,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
#line 7 "test4.pgc"
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -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 */
|
||||
|
||||
|
@ -15,20 +15,34 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port <DEFAULT>
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database <DEFAULT> on localhost port 55432
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port 55432
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: raising sqlcode -220 in line 36, 'No such connection nonexistant in line 36.'.
|
||||
[NO_PID]: sqlca: code: -220, state: 08003
|
||||
[NO_PID]: ecpg_finish: Connection connectdb closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database on localhost port 55432 for user connectdb
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 55432 for user connectuser
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection connectdb closed.
|
||||
@ -43,19 +57,19 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database nonexistant on localhost port 55432 for user connectuser
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 51
|
||||
[NO_PID]: connect: could not open database nonexistant on localhost port 55432 for user connectuser in line 62
|
||||
FATAL: database "nonexistant" does not exist
|
||||
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection nonexistant closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: raising sqlcode -402 in line 51, 'Could not connect to database nonexistant in line 51.'.
|
||||
[NO_PID]: raising sqlcode -402 in line 62, 'Could not connect to database nonexistant in line 62.'.
|
||||
[NO_PID]: sqlca: code: -402, state: 08001
|
||||
[NO_PID]: raising sqlcode -220 in line 52, 'No such connection CURRENT in line 52.'.
|
||||
[NO_PID]: raising sqlcode -220 in line 63, 'No such connection CURRENT in line 63.'.
|
||||
[NO_PID]: sqlca: code: -220, state: 08003
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on localhost port 0 for user connectuser
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: connect: could not open database connectdb on localhost port 0 for user connectuser in line 55
|
||||
[NO_PID]: connect: could not open database connectdb on localhost port 0 for user connectuser in line 66
|
||||
could not connect to server: Connection refused
|
||||
Is the server running on host "localhost" and accepting
|
||||
TCP/IP connections on port 0?
|
||||
@ -63,7 +77,7 @@ THE PORT NUMBER MIGHT HAVE BEEN CHANGED BY THE REGRESSION SCRIPT
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection connectdb closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: raising sqlcode -402 in line 55, 'Could not connect to database connectdb in line 55.'.
|
||||
[NO_PID]: raising sqlcode -402 in line 66, 'Could not connect to database connectdb in line 66.'.
|
||||
[NO_PID]: sqlca: code: -402, state: 08001
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port 55432 for user connectuser
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -76,14 +76,14 @@ main(void)
|
||||
#line 38 "test5.pgc"
|
||||
|
||||
|
||||
{ ECPGconnect(__LINE__, 0, "connectdb" , "connectuser" , "connectdb" , "main", 0); }
|
||||
{ ECPGconnect(__LINE__, 0, "" , "connectdb" , NULL , "main", 0); }
|
||||
#line 40 "test5.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "main");}
|
||||
#line 41 "test5.pgc"
|
||||
|
||||
|
||||
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , NULL , "main", 0); }
|
||||
{ ECPGconnect(__LINE__, 0, "connectdb" , "connectuser" , "connectdb" , "main", 0); }
|
||||
#line 43 "test5.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "main");}
|
||||
@ -104,26 +104,41 @@ main(void)
|
||||
#line 50 "test5.pgc"
|
||||
|
||||
|
||||
{ ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/connectdb" , "connectuser" , NULL , "main", 0); }
|
||||
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , NULL , "main", 0); }
|
||||
#line 52 "test5.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "main");}
|
||||
#line 53 "test5.pgc"
|
||||
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "nonexistant");}
|
||||
{ ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/connectdb" , "connectuser" , NULL , "main", 0); }
|
||||
#line 55 "test5.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "main");}
|
||||
#line 56 "test5.pgc"
|
||||
|
||||
|
||||
{ ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/" , "connectdb" , NULL , "main", 0); }
|
||||
#line 58 "test5.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "main");}
|
||||
#line 59 "test5.pgc"
|
||||
|
||||
|
||||
/* connect twice */
|
||||
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , "main", 0); }
|
||||
#line 58 "test5.pgc"
|
||||
#line 62 "test5.pgc"
|
||||
|
||||
{ ECPGconnect(__LINE__, 0, "connectdb" , NULL,NULL , "main", 0); }
|
||||
#line 59 "test5.pgc"
|
||||
#line 63 "test5.pgc"
|
||||
|
||||
{ ECPGdisconnect(__LINE__, "main");}
|
||||
#line 60 "test5.pgc"
|
||||
#line 64 "test5.pgc"
|
||||
|
||||
|
||||
/* not connected */
|
||||
{ ECPGdisconnect(__LINE__, "nonexistant");}
|
||||
#line 67 "test5.pgc"
|
||||
|
||||
|
||||
return (0);
|
||||
|
@ -24,6 +24,10 @@
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database <DEFAULT> on <DEFAULT> port <DEFAULT> for user connectdb
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT> for user connectuser
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
@ -40,17 +44,21 @@
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: connect: non-localhost access via sockets in line 52
|
||||
[NO_PID]: connect: non-localhost access via sockets in line 55
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: raising sqlcode -402 in line 52, 'Could not connect to database connectdb in line 52.'.
|
||||
[NO_PID]: raising sqlcode -402 in line 55, 'Could not connect to database connectdb in line 55.'.
|
||||
[NO_PID]: sqlca: code: -402, state: 08001
|
||||
[NO_PID]: raising sqlcode -220 in line 53, 'No such connection main in line 53.'.
|
||||
[NO_PID]: sqlca: code: -220, state: 08003
|
||||
[NO_PID]: raising sqlcode -220 in line 55, 'No such connection nonexistant in line 55.'.
|
||||
[NO_PID]: raising sqlcode -220 in line 56, 'No such connection main in line 56.'.
|
||||
[NO_PID]: sqlca: code: -220, state: 08003
|
||||
[NO_PID]: ECPGconnect: opening database on <DEFAULT> port <DEFAULT> for user connectdb
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ECPGconnect: opening database connectdb on <DEFAULT> port <DEFAULT>
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: connect: connection identifier main is already in use
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: ecpg_finish: Connection main closed.
|
||||
[NO_PID]: sqlca: code: 0, state: 00000
|
||||
[NO_PID]: raising sqlcode -220 in line 67, 'No such connection nonexistant in line 67.'.
|
||||
[NO_PID]: sqlca: code: -220, state: 08003
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#line 1 "init.pgc"
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include <pgtypes_interval.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <pgtypes_timestamp.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include <decimal.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <decimal.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#line 1 "code100.pgc"
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
#line 3 "copystdout.pgc"
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
||||
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#line 1 "desc.pgc"
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#line 1 "dynalloc.pgc"
|
||||
#include <stdio.h>
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#line 1 "dynalloc2.pgc"
|
||||
#include <stdio.h>
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
#line 1 "./../../include/sql3types.h"
|
||||
#line 1 "sql3types.h"
|
||||
#ifndef _ECPG_SQL3TYPES_H
|
||||
#define _ECPG_SQL3TYPES_H
|
||||
|
||||
@ -62,7 +62,7 @@ enum
|
||||
#line 7 "dyntest.pgc"
|
||||
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -133,7 +133,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
#line 8 "dyntest.pgc"
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#line 1 "./../../include/sqlca.h"
|
||||
#line 1 "sqlca.h"
|
||||
#ifndef POSTGRES_SQLCA_H
|
||||
#define POSTGRES_SQLCA_H
|
||||
|
||||
@ -81,7 +81,7 @@ struct sqlca_t *ECPGget_sqlca(void);
|
||||
#line 3 "indicators.pgc"
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include <string.h>
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -26,7 +26,7 @@ main(void)
|
||||
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -27,7 +27,7 @@ main(void)
|
||||
|
||||
|
||||
|
||||
#line 1 "./../regression.h"
|
||||
#line 1 "regression.h"
|
||||
|
||||
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user