Fix omission of -X (--no-psqlrc) in some psql invocations.
As of commit d5563d7df, psql -c no longer implies -X, but not all of our regression testing scripts had gotten that memo. To ensure consistency of results across different developers, make sure that *all* invocations of psql in all scripts in our tree use -X, even where this is not what previously happened. Michael Paquier and Tom Lane
This commit is contained in:
parent
151c4ffe41
commit
870df2b3b7
@ -233,7 +233,7 @@ echo "ok"
|
|||||||
|
|
||||||
# loadable module must be installed and not configured to permissive mode
|
# loadable module must be installed and not configured to permissive mode
|
||||||
echo -n "checking sepgsql installation ... "
|
echo -n "checking sepgsql installation ... "
|
||||||
VAL="`${CMD_PSQL} -t -c 'SHOW sepgsql.permissive' template1 2>/dev/null`"
|
VAL="`${CMD_PSQL} -X -t -c 'SHOW sepgsql.permissive' template1 2>/dev/null`"
|
||||||
RETVAL="$?"
|
RETVAL="$?"
|
||||||
if [ $RETVAL -eq 2 ]; then
|
if [ $RETVAL -eq 2 ]; then
|
||||||
echo "failed"
|
echo "failed"
|
||||||
@ -266,7 +266,7 @@ echo "ok"
|
|||||||
# NOTE: this test is wrong; we really ought to be checking template0.
|
# NOTE: this test is wrong; we really ought to be checking template0.
|
||||||
# But we can't connect to that without extra pushups, and it's not worth it.
|
# But we can't connect to that without extra pushups, and it's not worth it.
|
||||||
echo -n "checking for labels in template1 ... "
|
echo -n "checking for labels in template1 ... "
|
||||||
NUM=`${CMD_PSQL} -At -c 'SELECT count(*) FROM pg_catalog.pg_seclabel' template1 2>/dev/null`
|
NUM=`${CMD_PSQL} -XAt -c 'SELECT count(*) FROM pg_catalog.pg_seclabel' template1 2>/dev/null`
|
||||||
if [ -z "${NUM}" ]; then
|
if [ -z "${NUM}" ]; then
|
||||||
echo "failed"
|
echo "failed"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -156,7 +156,7 @@ standard_initdb "$oldbindir"/initdb
|
|||||||
if "$MAKE" -C "$oldsrc" installcheck; then
|
if "$MAKE" -C "$oldsrc" installcheck; then
|
||||||
pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
|
pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
|
||||||
if [ "$newsrc" != "$oldsrc" ]; then
|
if [ "$newsrc" != "$oldsrc" ]; then
|
||||||
oldpgversion=`psql -A -t -d regression -c "SHOW server_version_num"`
|
oldpgversion=`psql -X -A -t -d regression -c "SHOW server_version_num"`
|
||||||
fix_sql=""
|
fix_sql=""
|
||||||
case $oldpgversion in
|
case $oldpgversion in
|
||||||
804??)
|
804??)
|
||||||
@ -169,7 +169,7 @@ if "$MAKE" -C "$oldsrc" installcheck; then
|
|||||||
fix_sql="UPDATE pg_proc SET probin = replace(probin, '$oldsrc', '$newsrc') WHERE probin LIKE '$oldsrc%';"
|
fix_sql="UPDATE pg_proc SET probin = replace(probin, '$oldsrc', '$newsrc') WHERE probin LIKE '$oldsrc%';"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
psql -d regression -c "$fix_sql;" || psql_fix_sql_status=$?
|
psql -X -d regression -c "$fix_sql;" || psql_fix_sql_status=$?
|
||||||
|
|
||||||
mv "$temp_root"/dump1.sql "$temp_root"/dump1.sql.orig
|
mv "$temp_root"/dump1.sql "$temp_root"/dump1.sql.orig
|
||||||
sed "s;$oldsrc;$newsrc;g" "$temp_root"/dump1.sql.orig >"$temp_root"/dump1.sql
|
sed "s;$oldsrc;$newsrc;g" "$temp_root"/dump1.sql.orig >"$temp_root"/dump1.sql
|
||||||
|
@ -37,8 +37,8 @@ for f in char varchar text; do
|
|||||||
|
|
||||||
dropdb testlocale >/dev/null 2>&1
|
dropdb testlocale >/dev/null 2>&1
|
||||||
createdb testlocale || abort "createdb failed"
|
createdb testlocale || abort "createdb failed"
|
||||||
psql -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
psql -X -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
||||||
psql testlocale < test-de.sql.in > test-de-$f.sql.out 2>/dev/null || abort "test query failed"
|
psql -X testlocale < test-de.sql.in > test-de-$f.sql.out 2>/dev/null || abort "test query failed"
|
||||||
diff expected/test-de-$f.sql.out test-de-$f.sql.out
|
diff expected/test-de-$f.sql.out test-de-$f.sql.out
|
||||||
done
|
done
|
||||||
|
|
||||||
@ -52,13 +52,13 @@ for f in char varchar text; do
|
|||||||
|
|
||||||
dropdb testlocale >/dev/null 2>&1
|
dropdb testlocale >/dev/null 2>&1
|
||||||
createdb testlocale || abort "createdb failed"
|
createdb testlocale || abort "createdb failed"
|
||||||
psql -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
psql -X -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
||||||
psql testlocale < test-de-upper.sql.in > test-de-upper-$f.sql.out 2>/dev/null || abort "test query failed"
|
psql -X testlocale < test-de-upper.sql.in > test-de-upper-$f.sql.out 2>/dev/null || abort "test query failed"
|
||||||
diff expected/test-de-upper-$f.sql.out test-de-upper-$f.sql.out
|
diff expected/test-de-upper-$f.sql.out test-de-upper-$f.sql.out
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Testing PgSQL: select on regexp..."
|
echo "Testing PgSQL: select on regexp..."
|
||||||
psql testlocale < test-de-select.sql.in > test-de-select.sql.out 2>/dev/null || abort "select query failed"
|
psql -X testlocale < test-de-select.sql.in > test-de-select.sql.out 2>/dev/null || abort "select query failed"
|
||||||
diff expected/test-de-select.sql.out test-de-select.sql.out
|
diff expected/test-de-select.sql.out test-de-select.sql.out
|
||||||
dropdb testlocale || abort "dropdb failed"
|
dropdb testlocale || abort "dropdb failed"
|
||||||
echo "Finished."
|
echo "Finished."
|
||||||
|
@ -38,12 +38,12 @@ for f in char varchar text; do
|
|||||||
|
|
||||||
dropdb testlocale >/dev/null 2>&1
|
dropdb testlocale >/dev/null 2>&1
|
||||||
createdb testlocale || abort "createdb failed"
|
createdb testlocale || abort "createdb failed"
|
||||||
psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_gr $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_gr $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
||||||
psql testlocale < test-gr.sql.in > test-gr-$f.sql.out 2>/dev/null || abort "test query failed"
|
psql -X testlocale < test-gr.sql.in > test-gr-$f.sql.out 2>/dev/null || abort "test query failed"
|
||||||
diff expected/test-gr-$f.sql.out test-gr-$f.sql.out
|
diff expected/test-gr-$f.sql.out test-gr-$f.sql.out
|
||||||
done
|
done
|
||||||
echo "Testing PgSQL: select on regexp..."
|
echo "Testing PgSQL: select on regexp..."
|
||||||
psql testlocale < test-gr-select.sql.in > test-gr-select.sql.out 2>/dev/null || abort "select query failed"
|
psql -X testlocale < test-gr-select.sql.in > test-gr-select.sql.out 2>/dev/null || abort "select query failed"
|
||||||
diff expected/test-gr-select.sql.out test-gr-select.sql.out
|
diff expected/test-gr-select.sql.out test-gr-select.sql.out
|
||||||
dropdb testlocale || abort "dropdb failed"
|
dropdb testlocale || abort "dropdb failed"
|
||||||
echo "Finished."
|
echo "Finished."
|
||||||
|
@ -38,12 +38,12 @@ for f in char varchar text; do
|
|||||||
|
|
||||||
dropdb testlocale >/dev/null 2>&1
|
dropdb testlocale >/dev/null 2>&1
|
||||||
createdb testlocale || abort "createdb failed"
|
createdb testlocale || abort "createdb failed"
|
||||||
psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
||||||
psql testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
|
psql -X testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
|
||||||
diff expected/test-koi8-$f.sql.out test-koi8-$f.sql.out
|
diff expected/test-koi8-$f.sql.out test-koi8-$f.sql.out
|
||||||
done
|
done
|
||||||
echo "Testing PgSQL: select on regexp..."
|
echo "Testing PgSQL: select on regexp..."
|
||||||
psql testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
|
psql -X testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
|
||||||
diff expected/test-koi8-select.sql.out test-koi8-select.sql.out
|
diff expected/test-koi8-select.sql.out test-koi8-select.sql.out
|
||||||
dropdb testlocale || abort "dropdb failed"
|
dropdb testlocale || abort "dropdb failed"
|
||||||
echo "Finished."
|
echo "Finished."
|
||||||
|
@ -35,12 +35,12 @@ for f in char varchar text; do
|
|||||||
|
|
||||||
dropdb testlocale >/dev/null 2>&1
|
dropdb testlocale >/dev/null 2>&1
|
||||||
createdb testlocale || abort "createdb failed"
|
createdb testlocale || abort "createdb failed"
|
||||||
psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
|
||||||
psql testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
|
psql -X testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
|
||||||
diff expected/test-koi8-$f.sql.out test-koi8-$f.sql.out
|
diff expected/test-koi8-$f.sql.out test-koi8-$f.sql.out
|
||||||
done
|
done
|
||||||
echo "Testing PgSQL: select on regexp..."
|
echo "Testing PgSQL: select on regexp..."
|
||||||
psql testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
|
psql -X testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
|
||||||
diff expected/test-koi8-select.sql.out test-koi8-select.sql.out
|
diff expected/test-koi8-select.sql.out test-koi8-select.sql.out
|
||||||
dropdb testlocale || abort "dropdb failed"
|
dropdb testlocale || abort "dropdb failed"
|
||||||
echo "Finished."
|
echo "Finished."
|
||||||
|
@ -17,7 +17,7 @@ fi
|
|||||||
dropdb --if-exists utf8
|
dropdb --if-exists utf8
|
||||||
createdb -T template0 -l C -E UTF8 utf8 || exit 1
|
createdb -T template0 -l C -E UTF8 utf8 || exit 1
|
||||||
|
|
||||||
PSQL="psql -n -e -q"
|
PSQL="psql -X -n -e -q"
|
||||||
|
|
||||||
# in the test list, client-only encodings must follow the server encoding
|
# in the test list, client-only encodings must follow the server encoding
|
||||||
# they're to be tested with; see hard-coded cases below
|
# they're to be tested with; see hard-coded cases below
|
||||||
|
@ -37,7 +37,7 @@ sub run_test_psql
|
|||||||
my $logstring = $_[1];
|
my $logstring = $_[1];
|
||||||
|
|
||||||
my $cmd = [
|
my $cmd = [
|
||||||
'psql', '-A', '-t', '-c', "SELECT 'connected with $connstr'",
|
'psql', '-X', '-A', '-t', '-c', "SELECT 'connected with $connstr'",
|
||||||
'-d', "$connstr" ];
|
'-d', "$connstr" ];
|
||||||
|
|
||||||
my $result = run_log($cmd);
|
my $result = run_log($cmd);
|
||||||
|
@ -47,4 +47,4 @@ echo "
|
|||||||
from debug2
|
from debug2
|
||||||
where scope = 'T' and func != 'main'
|
where scope = 'T' and func != 'main'
|
||||||
order by file, func;
|
order by file, func;
|
||||||
" |psql debug
|
" |psql -X debug
|
||||||
|
Loading…
x
Reference in New Issue
Block a user