mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
* Fixing a bug in StorageLiveView.cpp in the getHeader() method
when header block would not match blocks in the stream when Const column is present. * Updating 00963_temporary_live_view_watch_live_timeout.py and removed timeout=5 after WATCH query is aborted with Ctrl-C so that the default timeout of 20sec is used * Small style fixes in tests
This commit is contained in:
parent
6cca6d359d
commit
13978c03f3
@ -159,12 +159,25 @@ Block StorageLiveView::getHeader() const
|
||||
{
|
||||
if (!sample_block)
|
||||
{
|
||||
auto storage = global_context.getTable(select_database_name, select_table_name);
|
||||
sample_block = InterpreterSelectQuery(inner_query, global_context, storage).getSampleBlock();
|
||||
sample_block.insert({DataTypeUInt64().createColumnConst(
|
||||
sample_block.rows(), 0)->convertToFullColumnIfConst(),
|
||||
std::make_shared<DataTypeUInt64>(),
|
||||
"_version"});
|
||||
if (!(*blocks_ptr) || (*blocks_ptr)->empty())
|
||||
{
|
||||
auto storage = global_context.getTable(select_database_name, select_table_name);
|
||||
sample_block = InterpreterSelectQuery(inner_query, global_context, storage, SelectQueryOptions(QueryProcessingStage::Complete)).getSampleBlock();
|
||||
sample_block.insert({DataTypeUInt64().createColumnConst(
|
||||
sample_block.rows(), 0)->convertToFullColumnIfConst(),
|
||||
std::make_shared<DataTypeUInt64>(),
|
||||
"_version"});
|
||||
/// convert all columns to full columns
|
||||
/// in case some of them are constant
|
||||
for (size_t i = 0; i < sample_block.columns(); ++i)
|
||||
{
|
||||
sample_block.safeGetByPosition(i).column = sample_block.safeGetByPosition(i).column->convertToFullColumnIfConst();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sample_block = (*blocks_ptr)->front().cloneEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
return sample_block;
|
||||
|
@ -31,7 +31,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
||||
client2.send('INSERT INTO test.mt VALUES (4),(5),(6)')
|
||||
client1.expect(r'21.*3' + end_of_block)
|
||||
# send Ctrl-C
|
||||
os.kill(client1.process.pid,signal.SIGINT)
|
||||
os.kill(client1.process.pid, signal.SIGINT)
|
||||
client1.expect(prompt)
|
||||
client1.send('DROP TABLE test.lv')
|
||||
client1.expect(prompt)
|
||||
|
@ -31,7 +31,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
||||
client2.send('INSERT INTO test.mt VALUES (4),(5),(6)')
|
||||
client1.expect('3.*2186dbea325ee4c56b67e9b792e993a3' + end_of_block)
|
||||
# send Ctrl-C
|
||||
os.kill(client1.process.pid,signal.SIGINT)
|
||||
os.kill(client1.process.pid, signal.SIGINT)
|
||||
client1.expect(prompt)
|
||||
client1.send('DROP TABLE test.lv')
|
||||
client1.expect(prompt)
|
||||
|
@ -31,7 +31,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
||||
client2.send('INSERT INTO test.mt VALUES (4),(5),(6)')
|
||||
client1.expect(r'21.*3' + end_of_block)
|
||||
# send Ctrl-C
|
||||
os.kill(client1.process.pid,signal.SIGINT)
|
||||
os.kill(client1.process.pid, signal.SIGINT)
|
||||
client1.expect(prompt)
|
||||
client1.send('DROP TABLE test.lv')
|
||||
client1.expect(prompt)
|
||||
|
@ -35,8 +35,8 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
||||
client2.expect(prompt)
|
||||
client1.expect(r'21.*3' + end_of_block)
|
||||
# send Ctrl-C
|
||||
os.kill(client1.process.pid,signal.SIGINT)
|
||||
client1.expect(prompt, timeout=5)
|
||||
os.kill(client1.process.pid, signal.SIGINT)
|
||||
client1.expect(prompt)
|
||||
client1.send('SELECT sleep(1)')
|
||||
client1.expect(prompt)
|
||||
client1.send('DROP TABLE test.lv')
|
||||
|
@ -33,7 +33,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
||||
# wait for heartbeat
|
||||
client1.expect('Progress: 2.00 rows.*\)')
|
||||
# send Ctrl-C
|
||||
os.kill(client1.process.pid,signal.SIGINT)
|
||||
os.kill(client1.process.pid, signal.SIGINT)
|
||||
client1.expect(prompt)
|
||||
client1.send('DROP TABLE test.lv')
|
||||
client1.expect(prompt)
|
||||
|
@ -34,7 +34,7 @@ with client(name='client1>', log=log) as client1, client(name='client2>', log=lo
|
||||
# wait for heartbeat
|
||||
client1.expect('Progress: 2.00 rows.*\)')
|
||||
# send Ctrl-C
|
||||
os.kill(client1.process.pid,signal.SIGINT)
|
||||
os.kill(client1.process.pid, signal.SIGINT)
|
||||
client1.expect(prompt)
|
||||
client1.send('DROP TABLE test.lv')
|
||||
client1.expect(prompt)
|
||||
|
Loading…
Reference in New Issue
Block a user