mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Merge pull request #9367 from huiwangcs/cow_sof
fix stack overflow issue when using initializer_list
This commit is contained in:
commit
ab0bb7a48e
@ -292,7 +292,7 @@ public:
|
||||
static MutablePtr create(Args &&... args) { return MutablePtr(new Derived(std::forward<Args>(args)...)); }
|
||||
|
||||
template <typename T>
|
||||
static MutablePtr create(std::initializer_list<T> && arg) { return create(std::forward<std::initializer_list<T>>(arg)); }
|
||||
static MutablePtr create(std::initializer_list<T> && arg) { return MutablePtr(new Derived(std::forward<std::initializer_list<T>>(arg))); }
|
||||
|
||||
typename Base::MutablePtr clone() const override { return typename Base::MutablePtr(new Derived(*derived())); }
|
||||
|
||||
|
@ -30,13 +30,13 @@ try
|
||||
ColumnWithTypeAndName column1;
|
||||
column1.name = "Sign";
|
||||
column1.type = std::make_shared<DataTypeInt8>();
|
||||
column1.column = ColumnInt8::create({1, -1});
|
||||
column1.column = ColumnInt8::create({static_cast<int8_t>(1), static_cast<int8_t>(-1)});
|
||||
block1.insert(column1);
|
||||
|
||||
ColumnWithTypeAndName column2;
|
||||
column2.name = "CounterID";
|
||||
column2.type = std::make_shared<DataTypeUInt32>();
|
||||
column2.column = ColumnUInt32::create({123, 123});
|
||||
column2.column = ColumnUInt32::create({static_cast<uint32_t>(123), static_cast<uint32_t>(123)});
|
||||
block1.insert(column2);
|
||||
}
|
||||
|
||||
@ -46,13 +46,13 @@ try
|
||||
ColumnWithTypeAndName column1;
|
||||
column1.name = "Sign";
|
||||
column1.type = std::make_shared<DataTypeInt8>();
|
||||
column1.column = ColumnInt8::create({1, 1});
|
||||
column1.column = ColumnInt8::create({static_cast<int8_t>(1), static_cast<int8_t>(1)});
|
||||
block2.insert(column1);
|
||||
|
||||
ColumnWithTypeAndName column2;
|
||||
column2.name = "CounterID";
|
||||
column2.type = std::make_shared<DataTypeUInt32>();
|
||||
column2.column = ColumnUInt32::create({123, 456});
|
||||
column2.column = ColumnUInt32::create({static_cast<uint32_t>(123), static_cast<uint32_t>(456)});
|
||||
block2.insert(column2);
|
||||
}
|
||||
|
||||
@ -76,6 +76,7 @@ try
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
catch (const DB::Exception & e)
|
||||
{
|
||||
std::cerr << e.what() << ", " << e.displayText() << std::endl;
|
||||
|
Loading…
Reference in New Issue
Block a user