From 348632d533a03d64b41884f37d8e1260adfa3eaa Mon Sep 17 00:00:00 2001 From: Georgy Moshkin <gmoshkin@picodata.io> Date: Mon, 15 May 2023 19:17:05 +0300 Subject: [PATCH] test: support of the upper and lowercase table names --- test/int/test_sql.py | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/test/int/test_sql.py b/test/int/test_sql.py index 54533c7d85..d4926caa9f 100644 --- a/test/int/test_sql.py +++ b/test/int/test_sql.py @@ -121,3 +121,52 @@ def test_hash(cluster: Cluster): assert data["row_count"] == 1 data = i1.sql(""" select "bucket_id" from t where a = ?""", 1) assert data["rows"] == [[lua_hash % bucket_count]] + + +def test_select_lowercase_name(cluster: Cluster): + i1, *_ = cluster.deploy(instance_count=1) + + space_id = 837 + index = i1.propose_create_space( + dict( + id=space_id, + name="lowercase_name", + format=[ + dict(name="id", type="integer", is_nullable=False), + ], + primary_key=[dict(field="id")], + distribution=dict(kind="sharded_implicitly", sharding_key=["id"]), + ) + ) + i1.raft_wait_index(index, 3) + + assert i1.call("box.space.lowercase_name:select") == [] + + data = i1.sql("""insert into "lowercase_name" values(420);""") + assert data["row_count"] == 1 + data = i1.sql("""select * from "lowercase_name" """) + assert data["rows"] == [[420]] + + +def test_select_string_field(cluster: Cluster): + i1, *_ = cluster.deploy(instance_count=1) + + space_id = 826 + index = i1.propose_create_space( + dict( + id=space_id, + name="STUFF", + format=[ + dict(name="id", type="integer", is_nullable=False), + dict(name="str", type="string", is_nullable=False), + ], + primary_key=[dict(field="id")], + distribution=dict(kind="sharded_implicitly", sharding_key=["id"]), + ) + ) + i1.raft_wait_index(index, 3) + + data = i1.sql("""insert into STUFF values(1337, 'foo');""") + assert data["row_count"] == 1 + data = i1.sql("""select * from STUFF """) + assert data["rows"] == [[1337, "foo"]] -- GitLab