Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate encoding issue in soci/postgresql #2769

Open
MonsieurNicolas opened this issue Oct 22, 2020 · 2 comments
Open

Investigate encoding issue in soci/postgresql #2769

MonsieurNicolas opened this issue Oct 22, 2020 · 2 comments
Assignees
Labels

Comments

@MonsieurNicolas
Copy link
Contributor

It looks like we're missing setting the proper encoding when we're talking to the database:

Ideally the default encoding of the database should not matter: we should create tables and queries with "C" encoding (and not rely on utf8 decoder on the sql side which probably has some performance impact).

@MonsieurNicolas MonsieurNicolas added this to To do in v15.1.0 Oct 23, 2020
@graydon graydon self-assigned this Oct 26, 2020
@graydon
Copy link
Contributor

graydon commented Oct 28, 2020

@MonsieurNicolas I'm a little unclear on the errors we can have, or what the problem here is. Can you elaborate?

@MonsieurNicolas
Copy link
Contributor Author

Ah yes, this was something that could only be triggered from test cases and with postgres setup with utf8 as encoding (in travis we don't create temp databases):
basically we used to not have the check https://github.com/stellar/stellar-core/blob/master/src/ledger/LedgerTxnTrustLineSQL.cpp#L25 and we could call LedgerTxnRoot::Impl::loadTrustLine(LedgerKey const& key) const with a garbage asset (must contain an invalid utf8 byte sequence) like what we can do in https://github.com/stellar/stellar-core/blob/master/src/ledger/test/LedgerTxnTests.cpp#L1426

What would happen then is that we'd get a "invalid utf-8 sequence" error from postgres -> soci -> abort.

@MonsieurNicolas MonsieurNicolas added this to To do in v15.2.0 via automation Nov 24, 2020
@MonsieurNicolas MonsieurNicolas removed this from To do in v15.1.0 Nov 24, 2020
@MonsieurNicolas MonsieurNicolas removed this from To do in v15.2.0 Jan 11, 2021
@MonsieurNicolas MonsieurNicolas added this to To do in v15.3.0 via automation Jan 11, 2021
@MonsieurNicolas MonsieurNicolas added this to To do in v15.4.0 via automation Feb 15, 2021
@MonsieurNicolas MonsieurNicolas removed this from To do in v15.3.0 Feb 15, 2021
@MonsieurNicolas MonsieurNicolas removed this from To do in v15.4.0 Feb 25, 2021
@MonsieurNicolas MonsieurNicolas added this to To do in v17.0.0 via automation Feb 25, 2021
@MonsieurNicolas MonsieurNicolas removed this from To do in v17.0.0 Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants