Added a test

This commit is contained in:
Alexey Milovidov 2020-07-09 01:41:25 +03:00
parent ba6dbb4bb2
commit 35f0e68892
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,4 @@
SELECT if(number = 1, \'hello\', if(number = 2, \'world\', \'xyz\'))
FROM numbers(10)
SELECT multiIf(number = 1, \'hello\', number = 2, \'world\', \'xyz\')
FROM numbers(10)

View File

@ -0,0 +1,5 @@
-- If you are reading this test please note that as of now this setting does not provide benefits in most of the cases.
SET optimize_if_chain_to_multiif = 0;
EXPLAIN SYNTAX SELECT number = 1 ? 'hello' : (number = 2 ? 'world' : 'xyz') FROM numbers(10);
SET optimize_if_chain_to_multiif = 1;
EXPLAIN SYNTAX SELECT number = 1 ? 'hello' : (number = 2 ? 'world' : 'xyz') FROM numbers(10);