Skip to content
Snippets Groups Projects
Commit 348632d5 authored by Georgy Moshkin's avatar Georgy Moshkin :speech_balloon: Committed by Yaroslav Dynnikov
Browse files

test: support of the upper and lowercase table names

parent 70fe8e63
No related branches found
No related tags found
1 merge request!600Update cluster-wide SQL
Pipeline #20914 passed
......@@ -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"]]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment