diff --git a/CHANGELOG.md b/CHANGELOG.md index 302dea52b52e9c0201b7b0228d2ba58ce4831810..df9fa5774c603816c2f60dc738da5781ee2e3743 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,7 +44,9 @@ with the `YY.MINOR.MICRO` scheme. [.proc_wait_index]: https://docs.picodata.io/picodata/devel/architecture/rpc_api/#proc_wait_index ### SQL + - SQL supports `LIKE` operator +- SQL supports `ILIKE` operator - SQL supports `lower` and `upper` string functions ## [24.5.1] - 2024-09-04 diff --git a/sbroad b/sbroad index 93dc653dc57a58702c4e8e8af9a52d3fd4fd58e6..cf127608d6030c50da9e0c5e1a3168607e678896 160000 --- a/sbroad +++ b/sbroad @@ -1 +1 @@ -Subproject commit 93dc653dc57a58702c4e8e8af9a52d3fd4fd58e6 +Subproject commit cf127608d6030c50da9e0c5e1a3168607e678896 diff --git a/test/int/test_sql.py b/test/int/test_sql.py index f26457fd0a045e7a8b687b56e291fce3e2608c5d..18773df20ac12ee4f910f434ab5728bccf6499b0 100644 --- a/test/int/test_sql.py +++ b/test/int/test_sql.py @@ -5240,6 +5240,7 @@ def test_like(instance: Instance): ) instance.sql(""" insert into t values (1, 'abacaba'), (2, 'AbaC'), (3, '%__%')""") + # test LIKE operator data = instance.sql(r" select '_' like '\_' and '%' like '\%' from (values (1))") assert data == [[True]] @@ -5301,3 +5302,21 @@ def test_like(instance: Instance): match="ESCAPE expression must be a single character", ): instance.sql(r"""select s like '%' escape 'a' || 'a' from t""") + + # test ILIKE operator + data = instance.sql("select 'AbA' ilike 'aba' from (values (1))") + assert data[0] == [True] + + data = instance.sql("select 'aba' ilike 'aBa' from (values (1))") + assert data[0] == [True] + + data = instance.sql("select 'ABA' ilike '%b%' from (values (1))") + assert data[0] == [True] + + data = instance.sql("select 'ABA' ilike '_b%' from (values (1))") + assert data[0] == [True] + + data = instance.sql( + r"""select '%UU_' ilike '\%uu\_' escape '\' from (values (1))""" + ) + assert data[0] == [True]