diff --git a/CHANGELOG.md b/CHANGELOG.md index 090de2e5e33edcabdfcc222a47ad3bf7e7c4afc3..afba101e5203b3c96bdc2385c776f7fefe0eb1a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -120,6 +120,7 @@ with the `YY.MINOR.MICRO` scheme. support WAIT APPLIED (GLOBALLY | LOCALLY) options, allowing users to wait for operations to be committed across all replicasets or only on the current one - EXPLAIN estimates query buckets +- SQL supports `COALESCE` function ### Fixes diff --git a/Cargo.lock b/Cargo.lock index 538ba46cf23aaa993dc1c6eca4a7dc44c333d242..43d8cc98fa106edf1d94e11e4cedc8a2d6e51191 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3457,7 +3457,6 @@ dependencies = [ "hash32", "itertools", "lazy_static", - "opentelemetry", "pest", "pest_derive", "pretty_assertions 1.4.1", @@ -3465,7 +3464,6 @@ dependencies = [ "rmp", "rmp-serde", "rmpv", - "sbroad-proc", "serde", "serde_bytes", "serde_yaml", @@ -3475,14 +3473,6 @@ dependencies = [ "uuid 1.11.0", ] -[[package]] -name = "sbroad-proc" -version = "0.1.0" -dependencies = [ - "quote 1.0.37", - "syn 1.0.109", -] - [[package]] name = "schannel" version = "0.1.26" diff --git a/sbroad b/sbroad index 73e6815a3399c085fcaff3bca7df86463b284bde..aaa0da6bc442f42adce3780c47e1d7f98fb53f11 160000 --- a/sbroad +++ b/sbroad @@ -1 +1 @@ -Subproject commit 73e6815a3399c085fcaff3bca7df86463b284bde +Subproject commit aaa0da6bc442f42adce3780c47e1d7f98fb53f11 diff --git a/test/conftest.py b/test/conftest.py index 2b4a42707a2efa5a10c0839f3c76a410765a4914..9cd3d5500a6ab61d4cb2e10dcdaf6a540ddf176e 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -2131,7 +2131,7 @@ def cargo_build(with_webui: bool = False) -> None: eprint("Skipping cargo build") return - features = ["error_injection", "sbroad-core/tracing"] + features = ["error_injection"] if with_webui: features.append("webui") diff --git a/test/int/test_sql.py b/test/int/test_sql.py index cf5965b33fa51a2322e0b73cb8b23b327027de68..9db03d749ecee329aedc8cf1066560b93d891cd9 100644 --- a/test/int/test_sql.py +++ b/test/int/test_sql.py @@ -1380,6 +1380,23 @@ def test_substr(instance: Instance): assert data[0] == [""] +def test_coalesce(instance: Instance): + instance.sql("create table foo (id int primary key, bar unsigned null);") + instance.sql("insert into foo values (1, null), (2, 1);") + + # Coalesce returns first non null value from its arguments. + data = instance.sql("select coalesce(bar, 0) from foo;") + assert data == [[0], [1]] + + # Type mismatch: all values must have the same type. + with pytest.raises(TarantoolError, match=" expected unsigned type, but got string"): + instance.sql("select coalesce(bar, 'none') from foo;") + + # 0 / 0 is not evaluated. + data = instance.sql("select coalesce(bar, 0, 0 / 0) from foo;") + assert data == [[0], [1]] + + def test_lower_upper(instance: Instance): instance.sql( """