X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Fcommand%2Fget-data-psql.sh;h=1d8afadaa815f2ece469e7d488845844540f8951;hb=c4942b88d3090c38f0844af32c0c8d5be30809de;hp=7735c36b04e2138ad958413eb1ce767643cf573a;hpb=274c90615ffd6975784232b709cff0b99da8b38d;p=pspp-builds.git diff --git a/tests/command/get-data-psql.sh b/tests/command/get-data-psql.sh index 7735c36b..1d8afada 100755 --- a/tests/command/get-data-psql.sh +++ b/tests/command/get-data-psql.sh @@ -22,7 +22,7 @@ export LANG port=6543 dbase=pspptest PG_CONFIG=${PG_CONFIG:=pg_config} -pgpath=`$PG_CONFIG | awk '/BINDIR/{print $3}'` +pgpath=`$PG_CONFIG --bindir` cleanup() { @@ -31,6 +31,7 @@ cleanup() return ; fi PGHOST=$TEMPDIR $pgpath/pg_ctl -D $TEMPDIR/cluster stop -W -o "-k $TEMPDIR -h ''" > /dev/null 2>&1 + cd / rm -rf $TEMPDIR } @@ -426,4 +427,44 @@ diff -b $TEMPDIR/pspp.list - << 'EOF' EOF if [ $? -ne 0 ] ; then fail ; fi + + +# Check for a bug caused by having string variables in the database, +# all of which are null. + +activity="populate database 4" +$pgpath/psql -h $TEMPDIR -p $port $dbase > /dev/null << EOF + +-- a table which has a text field containing only null, or zero +-- length entries. + +CREATE TABLE foo (int4 int4, text text); + +INSERT INTO foo VALUES ('12', ''); + +INSERT INTO foo VALUES (null, ''); + +EOF +if [ $? -ne 0 ] ; then fail ; fi + + +activity="create program 4" +cat > $TESTFILE <