From 0993da439e414d2ddba19b4731798cfe2070df39 Mon Sep 17 00:00:00 2001
From: Arseniy Volynets <a.volynets@picodata.io>
Date: Tue, 24 Sep 2024 10:09:29 +0300
Subject: [PATCH] feat(sql): lower/upper string functions

---
 CHANGELOG.md         |  1 +
 sbroad               |  2 +-
 test/int/test_sql.py | 23 +++++++++++++++++++++++
 3 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5e290877fa..302dea52b5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -45,6 +45,7 @@ with the `YY.MINOR.MICRO` scheme.
 
 ### SQL
 - SQL supports `LIKE` operator
+- SQL supports `lower` and `upper` string functions
 
 ## [24.5.1] - 2024-09-04
 
diff --git a/sbroad b/sbroad
index bbcb04cc15..93dc653dc5 160000
--- a/sbroad
+++ b/sbroad
@@ -1 +1 @@
-Subproject commit bbcb04cc15a8fd3dde612f458952a7a9b2eaeb9a
+Subproject commit 93dc653dc57a58702c4e8e8af9a52d3fd4fd58e6
diff --git a/test/int/test_sql.py b/test/int/test_sql.py
index e859825990..f26457fd0a 100644
--- a/test/int/test_sql.py
+++ b/test/int/test_sql.py
@@ -1465,6 +1465,29 @@ def test_substr(instance: Instance):
     assert data[0] == [""]
 
 
+def test_lower_upper(instance: Instance):
+    instance.sql(
+        """
+        create table t (id int primary key, s string)
+        using memtx
+        """
+    )
+
+    instance.sql(""" insert into t values (1, 'AbbA') """)
+
+    data = instance.sql(""" select lower(s) from t """)
+    assert data[0] == ["abba"]
+
+    data = instance.sql(""" select upper(s) from t """)
+    assert data[0] == ["ABBA"]
+
+    data = instance.sql(""" select lower(upper(s)) from t """)
+    assert data[0] == ["abba"]
+
+    data = instance.sql(""" select upper(lower(s)) from t """)
+    assert data[0] == ["ABBA"]
+
+
 def test_except_on_global_tbls(cluster: Cluster):
     cluster.deploy(instance_count=1)
     i1 = cluster.instances[0]
-- 
GitLab