Closed vpetrovykh closed 3 years ago
Well, this is another undocumented edge case of postgres encoding (similar to edgedb/edgedb#2266)
Here is what we get. Descriptors:
Output Descr [
BaseScalar(
BaseScalarTypeDescriptor {
id: 00000000-0000-0000-0000-000000000101,
},
),
BaseScalar(
BaseScalarTypeDescriptor {
id: 00000000-0000-0000-0000-000000000100,
},
),
ObjectShape(
ObjectShapeDescriptor {
id: efe95c60-52b0-b0c8-aedc-5b62246a66f1,
elements: [
ShapeElement {
flag_implicit: true,
flag_link_property: false,
flag_link: false,
name: "__tname__",
type_pos: TypePos(
0,
),
},
ShapeElement {
flag_implicit: true,
flag_link_property: false,
flag_link: false,
name: "id",
type_pos: TypePos(
1,
),
},
],
},
),
Array(
ArrayTypeDescriptor {
id: 2c62c8e7-92af-4d96-6bf5-1ee710d1e0ac,
type_pos: TypePos(
2,
),
dimensions: [
None,
],
},
),
]
Data:
// TODO(tailhook) test with non-zero reserved bytes
b"\0\0\0\x01" // number of dimensions
b"\0\0\0\0\0\0\x0b\x86" // 2 reserved words
b"\0\0\0\x01" // size
b"\0\0\0\x01" // lower index
b"\0\0\0\x10" // array element size
b"\x81g\xb4\xb8" // number of elements in the object !?!?!?
b"\x8e.\x11\xeb\x9c\xb4\x8b~\x81$\x18\r"
This is also reproduced in python:
RuntimeError: cannot decode Object: expected 1 elements, got 2171057336
And JavaScript:
Error: cannot decode Object: expected 1 elements, got 2171057336
Well this seems to be fixed on the new versions of edgedb. Perhaps by edgedb/edgedb#2384.
EdgeDB Version: EdgeDB 1.0-beta.2+dev.5540.g4142fc6c9
EdgeDB CLI Version: edgedb-cli 1.0.0-beta.1
OS Version: Linux
Steps to Reproduce:
Object
runs into a different bug)I don't know how to trigger this bug without
min
ormax
, but soon we will likely forbid passing objects (or object arrays) to either one of these. However, there might be other ways to trigger this that I just haven't come across yet.