From 2ba268c80ad713e03a1e5bedfb8350c68a958ded Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 29 May 2020 23:45:47 +0300 Subject: [PATCH] Added a test for #6228 --- ...56_max_execution_speed_sample_merge.reference | 4 ++++ .../00156_max_execution_speed_sample_merge.sql | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/queries/1_stateful/00156_max_execution_speed_sample_merge.reference create mode 100644 tests/queries/1_stateful/00156_max_execution_speed_sample_merge.sql diff --git a/tests/queries/1_stateful/00156_max_execution_speed_sample_merge.reference b/tests/queries/1_stateful/00156_max_execution_speed_sample_merge.reference new file mode 100644 index 00000000000..53bb58224b9 --- /dev/null +++ b/tests/queries/1_stateful/00156_max_execution_speed_sample_merge.reference @@ -0,0 +1,4 @@ +4392010 +1 +4392010 +1 diff --git a/tests/queries/1_stateful/00156_max_execution_speed_sample_merge.sql b/tests/queries/1_stateful/00156_max_execution_speed_sample_merge.sql new file mode 100644 index 00000000000..37e91296f14 --- /dev/null +++ b/tests/queries/1_stateful/00156_max_execution_speed_sample_merge.sql @@ -0,0 +1,16 @@ +SET max_execution_speed = 4000000, timeout_before_checking_execution_speed = 0.001; + +CREATE TEMPORARY TABLE times (t DateTime); + +INSERT INTO times SELECT now(); +SELECT count() FROM test.hits SAMPLE 1 / 2; +INSERT INTO times SELECT now(); + +SELECT max(t) - min(t) >= 1 FROM times; +TRUNCATE TABLE times; + +INSERT INTO times SELECT now(); +SELECT count() FROM merge(test, '^hits$') SAMPLE 1 / 2; +INSERT INTO times SELECT now(); + +SELECT max(t) - min(t) >= 1 FROM times;