ClickHouse/tests/queries/0_stateless/01943_query_id_check.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

27 lines
1.3 KiB
MySQL
Raw Normal View History

2021-09-12 12:35:27 +00:00
-- Tags: no-replicated-database
-- Tag no-replicated-database: Different query_id
2022-02-11 14:15:56 +00:00
SET prefer_localhost_replica = 1;
2021-07-20 13:10:55 +00:00
DROP TABLE IF EXISTS tmp;
2021-07-16 11:47:17 +00:00
CREATE TABLE tmp ENGINE = TinyLog AS SELECT queryID();
SYSTEM FLUSH LOGS;
2021-07-16 13:18:18 +00:00
SELECT query FROM system.query_log WHERE query_id = (SELECT * FROM tmp) AND current_database = currentDatabase() LIMIT 1;
2021-07-16 11:47:17 +00:00
DROP TABLE tmp;
CREATE TABLE tmp ENGINE = TinyLog AS SELECT initialQueryID();
SYSTEM FLUSH LOGS;
2021-07-16 13:18:18 +00:00
SELECT query FROM system.query_log WHERE initial_query_id = (SELECT * FROM tmp) AND current_database = currentDatabase() LIMIT 1;
2021-07-16 11:47:17 +00:00
DROP TABLE tmp;
2021-07-20 13:10:55 +00:00
CREATE TABLE tmp (str String) ENGINE = Log;
INSERT INTO tmp (*) VALUES ('a');
2021-07-20 13:10:55 +00:00
SELECT count() FROM (SELECT initialQueryID() FROM remote('127.0.0.{1..3}', currentDatabase(), 'tmp') GROUP BY queryID());
SELECT count() FROM (SELECT queryID() FROM remote('127.0.0.{1..3}', currentDatabase(), 'tmp') GROUP BY queryID());
SELECT count() FROM (SELECT queryID() AS t FROM remote('127.0.0.{1..3}', currentDatabase(), 'tmp') GROUP BY queryID() HAVING t == initialQueryID());
SELECT count(DISTINCT t) FROM (SELECT initialQueryID() AS t FROM remote('127.0.0.{1..3}', currentDatabase(), 'tmp') GROUP BY queryID());
SELECT count(DISTINCT t) FROM (SELECT queryID() AS t FROM remote('127.0.0.{1..3}', currentDatabase(), 'tmp') GROUP BY queryID());
DROP TABLE tmp;