aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/misc_functions.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/misc_functions.sql')
-rw-r--r--src/test/regress/sql/misc_functions.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/regress/sql/misc_functions.sql b/src/test/regress/sql/misc_functions.sql
index cfaba456e15..3db3f8bade2 100644
--- a/src/test/regress/sql/misc_functions.sql
+++ b/src/test/regress/sql/misc_functions.sql
@@ -1,3 +1,9 @@
+-- directory paths and dlsuffix are passed to us in environment variables
+\getenv libdir PG_LIBDIR
+\getenv dlsuffix PG_DLSUFFIX
+
+\set regresslib :libdir '/regress' :dlsuffix
+
--
-- num_nulls()
--
@@ -34,6 +40,11 @@ SELECT num_nulls();
-- canonicalize_path()
--
+CREATE FUNCTION test_canonicalize_path(text)
+ RETURNS text
+ AS :'regresslib'
+ LANGUAGE C STRICT IMMUTABLE;
+
SELECT test_canonicalize_path('/');
SELECT test_canonicalize_path('/./abc/def/');
SELECT test_canonicalize_path('/./../abc/def');
@@ -156,6 +167,11 @@ SELECT * FROM tenk1 a JOIN tenk1 b ON a.unique1 = b.unique1
WHERE my_int_eq(a.unique2, 42);
-- With support function that knows it's int4eq, we get a different plan
+CREATE FUNCTION test_support_func(internal)
+ RETURNS internal
+ AS :'regresslib', 'test_support_func'
+ LANGUAGE C STRICT;
+
ALTER FUNCTION my_int_eq(int, int) SUPPORT test_support_func;
EXPLAIN (COSTS OFF)