Skip to content

Conversation

NinoFloris
Copy link
Member

@NinoFloris NinoFloris commented Jan 24, 2024

Fixes #5520

@NinoFloris NinoFloris force-pushed the exporter-converter-resolver branch from 6436979 to bb2a6b3 Compare January 24, 2024 21:10
// Binary export has no type info so we only do caller-directed interpretation of data.
return info.Bind(new Field("?", info.PgTypeId!.Value, -1), DataFormat.Binary);
return info.Bind(new Field("?",
info.PgTypeId ?? ((PgResolverTypeInfo)info).GetDefaultResolution(null).PgTypeId, -1), DataFormat.Binary);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to do this GetDefaultResolution crap as we do not know what we should pick otherwise. (COPY being untyped)

@@ -150,7 +150,7 @@ internal bool TryBind(Field field, DataFormat format, out PgConverterInfo info)
return true;
case PgResolverTypeInfo resolverInfo:
var resolution = resolverInfo.GetResolution(field);
if (!HasCachedInfo(resolution.Converter)
if (HasCachedInfo(resolution.Converter)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha, the good old inversed logic bug...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, wasn't noticed as it was only a problem for reads over undecided type infos.

So never, except for binary export :')

@NinoFloris NinoFloris merged commit 010878c into main Jan 24, 2024
@NinoFloris NinoFloris deleted the exporter-converter-resolver branch January 24, 2024 22:58
NinoFloris added a commit that referenced this pull request Jan 31, 2024
@NinoFloris
Copy link
Member Author

Backported to 8.0.2 via 31941d1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Binary export doesn't have default type mapping for DateTime and DateTimeOffset
2 participants