mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
Add column type check before UUID insertion in MsgPack format
This commit is contained in:
parent
12e7cd6b19
commit
59e7eb084c
@ -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