diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-07-17 18:42:31 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-07-17 18:42:43 -0400 |
commit | 18555b1323bd225c7882e80723c52f25ce60afed (patch) | |
tree | 6913712a47c4bd2de14b86b2366c6eb728a109c0 /src/interfaces/ecpg/test/expected/connect-test5.c | |
parent | 7482fc4600ee97f8b2570e87b8c216a83b918065 (diff) | |
download | postgresql-18555b1323bd225c7882e80723c52f25ce60afed.tar.gz postgresql-18555b1323bd225c7882e80723c52f25ce60afed.zip |
Establish conventions about global object names used in regression tests.
To ensure that "make installcheck" can be used safely against an existing
installation, we need to be careful about what global object names
(database, role, and tablespace names) we use; otherwise we might
accidentally clobber important objects. There's been a weak consensus that
test databases should have names including "regression", and that test role
names should start with "regress_", but we didn't have any particular rule
about tablespace names; and neither of the other rules was followed with
any consistency either.
This commit moves us a long way towards having a hard-and-fast rule that
regression test databases must have names including "regression", and that
test role and tablespace names must start with "regress_". It's not
completely there because I did not touch some test cases in rolenames.sql
that test creation of special role names like "session_user". That will
require some rethinking of exactly what we want to test, whereas the intent
of this patch is just to hit all the cases in which the needed renamings
are cosmetic.
There is no enforcement mechanism in this patch either, but if we don't
add one we can expect that the tests will soon be violating the convention
again. Again, that's not such a cosmetic change and it will require
discussion. (But I did use a quick-hack enforcement patch to find these
cases.)
Discussion: <16638.1468620817@sss.pgh.pa.us>
Diffstat (limited to 'src/interfaces/ecpg/test/expected/connect-test5.c')
-rw-r--r-- | src/interfaces/ecpg/test/expected/connect-test5.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/interfaces/ecpg/test/expected/connect-test5.c b/src/interfaces/ecpg/test/expected/connect-test5.c index 79decd3595f..e991ee79b63 100644 --- a/src/interfaces/ecpg/test/expected/connect-test5.c +++ b/src/interfaces/ecpg/test/expected/connect-test5.c @@ -33,20 +33,20 @@ main(void) char id [ 200 ] ; #line 18 "test5.pgc" - char * user = "connectuser" ; + char * user = "regress_ecpg_user1" ; /* exec sql end declare section */ #line 19 "test5.pgc" ECPGdebug(1, stderr); - { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); } #line 23 "test5.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user connectdb encrypted password 'insecure'", ECPGt_EOIT, ECPGt_EORT);} + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user regress_ecpg_user2 encrypted password 'insecure'", ECPGt_EOIT, ECPGt_EORT);} #line 24 "test5.pgc" - { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user connectuser encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);} + { ECPGdo(__LINE__, 0, 1, NULL, 0, ECPGst_normal, "alter user regress_ecpg_user1 encrypted password 'connectpw'", ECPGt_EOIT, ECPGt_EORT);} #line 25 "test5.pgc" { ECPGtrans(__LINE__, NULL, "commit");} @@ -56,7 +56,7 @@ main(void) #line 27 "test5.pgc" /* <-- "main" not specified */ - strcpy(db, "connectdb"); + strcpy(db, "ecpg2_regression"); strcpy(id, "main"); { ECPGconnect(__LINE__, 0, db , NULL, NULL , id, 0); } #line 31 "test5.pgc" @@ -65,77 +65,77 @@ main(void) #line 32 "test5.pgc" - { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); } #line 34 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 35 "test5.pgc" - { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); } #line 37 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 38 "test5.pgc" - { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); } #line 40 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 41 "test5.pgc" - { ECPGconnect(__LINE__, 0, "" , "connectdb" , "insecure" , "main", 0); } + { ECPGconnect(__LINE__, 0, "" , "regress_ecpg_user2" , "insecure" , "main", 0); } #line 43 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 44 "test5.pgc" - { ECPGconnect(__LINE__, 0, "connectdb" , "connectuser" , "connectpw" , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); } #line 46 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 47 "test5.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , "main", 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); } #line 49 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 50 "test5.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , "connectuser" , "connectpw" , "main", 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); } #line 52 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 53 "test5.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb" , user , "connectpw" , "main", 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression" , user , "connectpw" , "main", 0); } #line 55 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 56 "test5.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/connectdb?connect_timeout=14 & client_encoding=latin1" , "connectuser" , "connectpw" , "main", 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/ecpg2_regression?connect_timeout=14 & client_encoding=latin1" , "regress_ecpg_user1" , "connectpw" , "main", 0); } #line 58 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 59 "test5.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/connectdb" , "connectuser" , "connectpw" , "main", 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://200.46.204.71/ecpg2_regression" , "regress_ecpg_user1" , "connectpw" , "main", 0); } #line 61 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} #line 62 "test5.pgc" - { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/" , "connectdb" , "insecure" , "main", 0); } + { ECPGconnect(__LINE__, 0, "unix:postgresql://localhost/" , "regress_ecpg_user2" , "insecure" , "main", 0); } #line 64 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} @@ -143,10 +143,10 @@ main(void) /* connect twice */ - { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); } #line 68 "test5.pgc" - { ECPGconnect(__LINE__, 0, "connectdb" , NULL, NULL , "main", 0); } + { ECPGconnect(__LINE__, 0, "ecpg2_regression" , NULL, NULL , "main", 0); } #line 69 "test5.pgc" { ECPGdisconnect(__LINE__, "main");} |