Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Correctly handle resolver info in binary exporter - #5546

#5546
Merged
NinoFloris merged 1 commit into
mainnpgsql/npgsql:mainfrom
exporter-converter-resolvernpgsql/npgsql:exporter-converter-resolverCopy head branch name to clipboard
Jan 24, 2024
Merged

Correctly handle resolver info in binary exporter#5546
NinoFloris merged 1 commit into
mainnpgsql/npgsql:mainfrom
exporter-converter-resolvernpgsql/npgsql:exporter-converter-resolverCopy head branch name to clipboard

Conversation

@NinoFloris

@NinoFloris NinoFloris commented Jan 24, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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)

case PgResolverTypeInfo resolverInfo:
var resolution = resolverInfo.GetResolution(field);
if (!HasCachedInfo(resolution.Converter)
if (HasCachedInfo(resolution.Converter)

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.