ISSUES-195 fix complex in expression with single element

This commit is contained in:
zhang2014 2018-01-29 09:39:41 +08:00 committed by Vitaliy Lyudvichenko
parent 94f38d744e
commit c74970c098
3 changed files with 14 additions and 1 deletions

View File

@ -1570,7 +1570,9 @@ void ExpressionAnalyzer::makeSetsForIndexImpl(const ASTPtr & node, const Block &
{
try
{
makeExplicitSet(func, sample_block, true);
ExpressionActionsPtr temp_actions = std::make_shared<ExpressionActions>(columns, settings);
getRootActions(func->arguments->children.at(0), true, false, temp_actions);
makeExplicitSet(func, temp_actions->getSampleBlock(), true);
}
catch (const Exception & e)
{

View File

@ -0,0 +1,2 @@
2018-01-29 100 key
2018-01-29 100 key

View File

@ -0,0 +1,9 @@
DROP TABLE IF EXISTS test.test;
CREATE TABLE test.test ( dt Date, site_id Int32, site_key String ) ENGINE = MergeTree(dt, (site_id, site_key, dt), 8192);
INSERT INTO test.test (dt,site_id, site_key) VALUES ('2018-1-29', 100, 'key');
SELECT * FROM test.test WHERE toInt32(site_id) IN (100);
SELECT * FROM test.test WHERE toInt32(site_id) IN (100,101);
DROP TABLE IF EXISTS test.test;