# HG changeset patch # User Tom Gottfried # Date 1567526450 -7200 # Node ID d24e951206caa5a1e43d7992089aa2e0a8fe0247 # Parent 9fef9930aa8ab383b7f9d3cd10c073f3411ae7a0 Do not try to execute NULL as a subquery diff -r 9fef9930aa8a -r d24e951206ca schema/gemma.sql --- a/schema/gemma.sql Mon Sep 02 18:45:15 2019 +0200 +++ b/schema/gemma.sql Tue Sep 03 18:00:50 2019 +0200 @@ -38,7 +38,8 @@ RETURN false; END $$ - LANGUAGE plpgsql; + LANGUAGE plpgsql + STRICT; -- diff -r 9fef9930aa8a -r d24e951206ca schema/gemma_tests.sql --- a/schema/gemma_tests.sql Mon Sep 02 18:45:15 2019 +0200 +++ b/schema/gemma_tests.sql Tue Sep 03 18:00:50 2019 +0200 @@ -21,6 +21,9 @@ SELECT ok(NOT is_valid_from_item('This is not SQL'), 'Arbitrary text does not pass check'); +SELECT ok(is_valid_from_item(NULL) IS NULL, + 'NULL value is not checked'); + SELECT throws_ok($$ INSERT INTO waterway.waterway_axis (wtwaxs, objnam) VALUES (ST_GeogFromText('LINESTRING(0 0, 1 1)'), 'test'), diff -r 9fef9930aa8a -r d24e951206ca schema/run_tests.sh --- a/schema/run_tests.sh Mon Sep 02 18:45:15 2019 +0200 +++ b/schema/run_tests.sh Tue Sep 03 18:00:50 2019 +0200 @@ -80,7 +80,7 @@ -c 'SET client_min_messages TO WARNING' \ -c "DROP ROLE IF EXISTS $TEST_ROLES" \ -f "$BASEDIR"/tap_tests_data.sql \ - -c "SELECT plan(75 + ( + -c "SELECT plan(76 + ( SELECT count(*)::int FROM information_schema.tables WHERE table_schema = 'waterway'))" \