should be it

This commit is contained in:
2025-10-24 19:21:19 -05:00
parent a4b23fc57c
commit f09560c7b1
14047 changed files with 3161551 additions and 1 deletions

View File

@@ -0,0 +1,83 @@
# name: test/sql/function/string/test_concat.test
# description: Test concat function
# group: [string]
statement ok
SET default_null_order='nulls_first';
# Test Case disclaimer
# Assertions built using the Domain Testing technique
# at: https://bbst.courses/wp-content/uploads/2018/01/Kaner-Intro-to-Domain-Testing-2018.pdf
statement ok
PRAGMA enable_verification
statement ok
CREATE TABLE strings(s VARCHAR)
statement ok
INSERT INTO strings VALUES ('hello'), ('world'), (NULL)
# normal concat
query T
SELECT s || ' ' || s FROM strings ORDER BY s
----
NULL
hello hello
world world
# unicode concat
query T
SELECT s || ' ' || '🦆' FROM strings ORDER BY s
----
NULL
hello 🦆
world 🦆
query T
SELECT s || ' ' || '🦆' FROM strings ORDER BY s
----
NULL
hello 🦆
world 🦆
# concat with constant NULL
query T
SELECT s || ' ' || '🦆' || NULL FROM strings ORDER BY s
----
NULL
NULL
NULL
# concat requires at least one argument
statement error
SELECT CONCAT()
----
# concat with one argument works
query T
SELECT CONCAT('hello')
----
hello
# varargs concat
query T
SELECT CONCAT('hello', 33, 22)
----
hello3322
# CONCAT ignores null values
query T
SELECT CONCAT('hello', 33, NULL, 22, NULL)
----
hello3322
# this also applies to non-constant null values
query T
SELECT CONCAT('hello', ' ', s) FROM strings ORDER BY s
----
hello
hello hello
hello world