Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Add idle session timeout error#963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
sfackler merged 4 commits intorust-postgres:masterfromjkosh44:idle-session-timeout
Nov 22, 2022
Merged

Add idle session timeout error#963

sfackler merged 4 commits intorust-postgres:masterfromjkosh44:idle-session-timeout
Nov 22, 2022

Conversation

jkosh44
Copy link
Contributor

This commit adds the idle session timeout error (57P05). Seehttps://www.postgresql.org/docs/current/errcodes-appendix.html

("55006",SqlState::OBJECT_IN_USE),
("42P01",SqlState::UNDEFINED_TABLE),
("25P03",SqlState::IDLE_IN_TRANSACTION_SESSION_TIMEOUT),
("57P05",SqlState::IDLE_SESSION_TIMEOUT),
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

It didn't seem like there was any specific order here, so I just put this next to a similar timeout error. Let me know if I missed something.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This file is generated by thecodegen crate in this repo. The proper way to update it is to update errcodes.txt, pg_range.dat, and pg_type.dat andcargo run the codegen.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Oops, totally missed the comment at the top. I'll do that now.

Copy link
ContributorAuthor

@jkosh44jkosh44Nov 21, 2022
edited
Loading

Choose a reason for hiding this comment

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

It looks like there have been quite a few changes since this was last updated. Specifically multi-ranges causes the type gen code to panic becuase it thinks the oid is for the normal range type. I can take a look and see how we can update the code for multi-ranges. Let me know if you have any thoughts/ideas.

@jkosh44
Copy link
ContributorAuthor

jkosh44 commentedNov 21, 2022
edited
Loading

I copied errcodes.txt, pg_range.dat, and pg_type.dat from the 51b5834cd53f0bd068729043b55f7da3ca6bb15f commit of PostgreSQL.

EDIT: I should note that the file contents are identical to commit c5dc80c1bc216f0e21a2f79f5e0415c2d4cfb35d which was the official 15.1 release.

Comment on lines +222 to +230
"r" => range_elements[&oid],
"m" => multi_range_elements[&oid],
Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

You can find the description of this field in thepg_type catalog table (https://www.postgresql.org/docs/current/catalog-pg-type.html). The relevant part is:

r for a range type, or m for a multirange type.

@sfackler
Copy link
Collaborator

It looks like multirange types are currently mapping toKind::Range, but it would probably make more sense to create a separateKind::Multirange.

You'll also need to runcargo fmt on the project after the codegen'd files are recreated.

@jkosh44
Copy link
ContributorAuthor

It looks like multirange types are currently mapping toKind::Range, but it would probably make more sense to create a separateKind::Multirange.

You'll also need to runcargo fmt on the project after the codegen'd files are recreated.

Just did both. Let me know if you have notes on the approach.

@jkosh44
Copy link
ContributorAuthor

@sfackler The test and clippy failures look like they're in parts of the code that I haven't touched. Any ideas what's going on?

@sfackler
Copy link
Collaborator

Those should be fixed on master now if you merge/rebase.

@sfackler
Copy link
Collaborator

LGTM otherwise!

@jkosh44
Copy link
ContributorAuthor

Those should be fixed on master now if you merge/rebase.

Just rebased from master

@sfacklersfackler merged commit5ebe602 intorust-postgres:masterNov 22, 2022
@sfackler
Copy link
Collaborator

Thanks!

jkosh44 reacted with hooray emoji

@jkosh44jkosh44 deleted the idle-session-timeout branchNovember 22, 2022 00:34
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sfacklersfacklersfackler left review comments

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@jkosh44@sfackler

[8]ページ先頭

©2009-2025 Movatter.jp