mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-11 17:02:25 +00:00
Merge pull request #41309 from Avogar/fix-msgpack
Add column type check before UUID insertion in MsgPack format
This commit is contained in:
commit
73cf72a5a4
@ -235,8 +235,10 @@ static void insertNull(IColumn & column, DataTypePtr type)
|
||||
assert_cast<ColumnNullable &>(column).insertDefault();
|
||||
}
|
||||
|
||||
static void insertUUID(IColumn & column, DataTypePtr /*type*/, const char * value, size_t size)
|
||||
static void insertUUID(IColumn & column, DataTypePtr type, const char * value, size_t size)
|
||||
{
|
||||
if (!isUUID(type))
|
||||
throw Exception(ErrorCodes::ILLEGAL_COLUMN, "Cannot insert MessagePack UUID into column with type {}.", type->getName());
|
||||
ReadBufferFromMemory buf(value, size);
|
||||
UUID uuid;
|
||||
readBinaryBigEndian(uuid.toUnderType().items[0], buf);
|
||||
|
@ -0,0 +1,4 @@
|
||||
-- Tags: no-parallel, no-fasttest
|
||||
|
||||
insert into function file(02422_data.msgpack) select toUUID('f4cdd80d-5d15-4bdc-9527-adcca635ec1f') as uuid settings output_format_msgpack_uuid_representation='ext';
|
||||
select * from file(02422_data.msgpack, auto, 'x Int32'); -- {serverError ILLEGAL_COLUMN}
|
Loading…
Reference in New Issue
Block a user