Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
245 changes: 213 additions & 32 deletions regress/expected/expr.out
Original file line number Diff line number Diff line change
Expand Up @@ -3927,6 +3927,41 @@ SELECT * FROM age_reverse('gnirts a si siht'::cstring);
"this is a string"
(1 row)

-- should return empty string
SELECT * FROM age_reverse('');
age_reverse
-------------
""
(1 row)

SELECT * FROM age_reverse(''::text);
age_reverse
-------------
""
(1 row)

SELECT * FROM age_reverse(''::cstring);
age_reverse
-------------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN reverse('')
$$) AS (result agtype);
result
--------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN reverse("")
$$) AS (result agtype);
result
--------
""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN reverse(null)
Expand Down Expand Up @@ -4104,6 +4139,75 @@ SELECT * FROM age_tolower('CSTRING'::cstring);
"cstring"
(1 row)

-- should return empty string
SELECT * FROM age_toupper('');
age_toupper
-------------
""
(1 row)

SELECT * FROM age_toupper(''::text);
age_toupper
-------------
""
(1 row)

SELECT * FROM age_toupper(''::cstring);
age_toupper
-------------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN toupper('')
$$) AS (result agtype);
result
--------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN toupper("")
$$) AS (result agtype);
result
--------
""
(1 row)

SELECT * FROM age_tolower('');
age_tolower
-------------
""
(1 row)

SELECT * FROM age_tolower(''::text);
age_tolower
-------------
""
(1 row)

SELECT * FROM age_tolower(''::cstring);
age_tolower
-------------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN tolower('')
$$) AS (result agtype);
result
--------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN tolower("")
$$) AS (result agtype);
result
--------
""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN toUpper(null)
Expand Down Expand Up @@ -4211,6 +4315,73 @@ SELECT * FROM age_trim(' string ');
"string"
(1 row)

-- should return empty string
SELECT * FROM cypher('expr', $$
RETURN lTrim('')
$$) AS (results agtype);
results
---------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN rTrim('')
$$) AS (results agtype);
results
---------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN trim('')
$$) AS (results agtype);
results
---------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN lTrim("")
$$) AS (results agtype);
results
---------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN rTrim("")
$$) AS (results agtype);
results
---------
""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN trim("")
$$) AS (results agtype);
results
---------
""
(1 row)

SELECT * FROM age_ltrim('');
age_ltrim
-----------
""
(1 row)

SELECT * FROM age_rtrim('');
age_rtrim
-----------
""
(1 row)

SELECT * FROM age_trim('');
age_trim
----------
""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN lTrim(null)
Expand Down Expand Up @@ -4322,15 +4493,16 @@ $$) AS (results agtype);
"123"
(1 row)

-- should return null
-- should return empty string
SELECT * FROM cypher('expr', $$
RETURN left("123456789", 0)
$$) AS (results agtype);
results
---------

""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN left(null, 1)
$$) AS (results agtype);
Expand Down Expand Up @@ -4401,15 +4573,16 @@ $$) AS (results agtype);
"789"
(1 row)

-- should return null
-- should return empty string
SELECT * FROM cypher('expr', $$
RETURN right("123456789", 0)
$$) AS (results agtype);
results
---------

""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN right(null, 1)
$$) AS (results agtype);
Expand Down Expand Up @@ -4508,6 +4681,13 @@ SELECT * FROM age_substring('0123456789', 1);
"123456789"
(1 row)

-- should return empty string
SELECT * FROM age_substring('0123456789', 0, 0);
age_substring
---------------
""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN substring(null, null, null)
Expand Down Expand Up @@ -4747,49 +4927,68 @@ $$) AS (results agtype);
"ababab"
(1 row)

-- should return null
-- should return empty string
SELECT * FROM cypher('expr', $$
RETURN replace(null, null, null)
RETURN replace("", "", "")
$$) AS (results agtype);
results
---------

""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN replace("Hello", null, null)
RETURN replace("Hello", "Hello", "")
$$) AS (results agtype);
results
---------

""
(1 row)

SELECT * FROM cypher('expr', $$
RETURN replace("Hello", "", null)
RETURN replace("", "Hello", "Mellow")
$$) AS (results agtype);
results
---------

""
(1 row)

SELECT * FROM age_replace('', '', '');
age_replace
-------------
""
(1 row)

SELECT * FROM age_replace('Hello', 'Hello', '');
age_replace
-------------
""
(1 row)

SELECT * FROM age_replace('', 'Hello', 'Mellow');
age_replace
-------------
""
(1 row)

-- should return null
SELECT * FROM cypher('expr', $$
RETURN replace("", "", "")
RETURN replace(null, null, null)
$$) AS (results agtype);
results
---------

(1 row)

SELECT * FROM cypher('expr', $$
RETURN replace("Hello", "Hello", "")
RETURN replace("Hello", null, null)
$$) AS (results agtype);
results
---------

(1 row)

SELECT * FROM cypher('expr', $$
RETURN replace("", "Hello", "Mellow")
RETURN replace("Hello", "", null)
$$) AS (results agtype);
results
---------
Expand All @@ -4814,24 +5013,6 @@ SELECT * FROM age_replace('Hello', '', null);

(1 row)

SELECT * FROM age_replace('', '', '');
age_replace
-------------

(1 row)

SELECT * FROM age_replace('Hello', 'Hello', '');
age_replace
-------------

(1 row)

SELECT * FROM age_replace('', 'Hello', 'Mellow');
age_replace
-------------

(1 row)

-- should fail
SELECT * FROM cypher('expr', $$
RETURN replace()
Expand Down
Loading