It looks like the multibyte regress tests only work if both
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Apr 1999 23:30:31 +0000 (23:30 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 25 Apr 1999 23:30:31 +0000 (23:30 +0000)
the database encoding and the client encoding match the encoding expected
by the test.  So, force both of them to be set from the MULTIBYTE
environment var.  This allows regress tests to be run successfully in
multibyte environments other than the compiled-in default.

src/test/regress/regress.sh

index 7a9f7d0b40368c1578e22ec98201b679ecccf12e..48d15ef2069e5a0935c3139499e837c6cf752e2c 100755 (executable)
@@ -47,22 +47,24 @@ echo "=============== destroying old regression database... ================="
 destroydb $HOST regression
 
 echo "=============== creating new regression database...   ================="
-createdb $HOST regression
-if [ $? -ne 0 ]; then
-     echo createdb failed
-     exit 1
-fi
-
-echo "=============== running regression queries...         ================="
-echo "" > regression.diffs
 if [ -n "$MULTIBYTE" ];then
        mbtests=`echo $MULTIBYTE | tr "[A-Z]" "[a-z]"`
        PGCLIENTENCODING="$MULTIBYTE"
        export PGCLIENTENCODING
+       ENCODINGOPT="-E $MULTIBYTE"
 else
        mbtests=""
        unset PGCLIENTENCODING
+       ENCODINGOPT=""
 fi
+createdb $ENCODINGOPT $HOST regression
+if [ $? -ne 0 ]; then
+     echo createdb failed
+     exit 1
+fi
+
+echo "=============== running regression queries...         ================="
+echo "" > regression.diffs
 for i in `cat sql/tests` $mbtests
 do
        $ECHO_N "${i} .. " $ECHO_C