Skip to content

Commit 7522179

Browse files
committed
Fix variants in state tables
1 parent 5dd1add commit 7522179

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/fill-postgresql.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,9 @@ struct session : enable_shared_from_this<session> {
10721072
for (auto& f : field.type->fields)
10731073
fill_value(bulk, nested_bulk, t, base_name + field.name + "_", fields, values, bin, f);
10741074
} else if (field.type->filled_variant && field.type->fields.size() == 1 && field.type->fields[0].type->filled_struct) {
1075+
auto v = read_varuint32(bin);
1076+
if (v)
1077+
throw std::runtime_error("invalid variant in " + field.type->name);
10751078
for (auto& f : field.type->fields[0].type->fields)
10761079
fill_value(bulk, nested_bulk, t, base_name + field.name + "_", fields, values, bin, f);
10771080
} else if (field.type->array_of && field.type->array_of->filled_struct) {

0 commit comments

Comments
 (0)