mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 09:32:06 +00:00
Add test_storage_mysql::test_mysql_in with multiple columns in IN
This commit is contained in:
parent
f40ab891eb
commit
5ad9cb9b79
@ -367,6 +367,36 @@ def test_settings_connection_wait_timeout(started_cluster):
|
||||
drop_mysql_table(conn, table_name)
|
||||
conn.close()
|
||||
|
||||
# Regression for (k, v) IN ((k, v))
|
||||
def test_mysql_in(started_cluster):
|
||||
table_name = 'test_mysql_in'
|
||||
node1.query(f'DROP TABLE IF EXISTS {table_name}')
|
||||
|
||||
conn = get_mysql_conn(started_cluster, cluster.mysql_ip)
|
||||
drop_mysql_table(conn, table_name)
|
||||
create_mysql_table(conn, table_name)
|
||||
|
||||
node1.query('''
|
||||
CREATE TABLE {}
|
||||
(
|
||||
id UInt32,
|
||||
name String,
|
||||
age UInt32,
|
||||
money UInt32
|
||||
)
|
||||
ENGINE = MySQL('mysql57:3306', 'clickhouse', '{}', 'root', 'clickhouse')
|
||||
'''.format(table_name, table_name)
|
||||
)
|
||||
|
||||
node1.query("INSERT INTO {} (id, name) SELECT number, concat('name_', toString(number)) from numbers(10) ".format(table_name))
|
||||
node1.query("SELECT * FROM {} WHERE (id) IN (1)".format(table_name))
|
||||
node1.query("SELECT * FROM {} WHERE (id) IN (1, 2)".format(table_name))
|
||||
node1.query("SELECT * FROM {} WHERE (id, name) IN ((1, 'name_1'))".format(table_name))
|
||||
node1.query("SELECT * FROM {} WHERE (id, name) IN ((1, 'name_1'),(1, 'name_1'))".format(table_name))
|
||||
|
||||
drop_mysql_table(conn, table_name)
|
||||
conn.close()
|
||||
|
||||
if __name__ == '__main__':
|
||||
with contextmanager(started_cluster)() as cluster:
|
||||
for name, instance in list(cluster.instances.items()):
|
||||
|
Loading…
Reference in New Issue
Block a user