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

Disable bytes usage with postgres #6186

Merged
merged 7 commits into from Oct 10, 2019

Conversation

@erikjohnston
Copy link
Member

erikjohnston commented Oct 8, 2019

More often than not passing bytes to txn.execute is a bug (where we
meant to pass a string) that just happens to work if BYTEA_OUTPUT is
set to ESCAPE. However, this is a bit of a footgun so we want to
instead error when this happens, and force using bytearray if we
actually want to use bytes.

Based on #6185

@erikjohnston erikjohnston requested review from matrix-org/synapse-core and removed request for matrix-org/synapse-core Oct 8, 2019
More often than not passing bytes to `txn.execute` is a bug (where we
meant to pass a string) that just happens to work if `BYTEA_OUTPUT` is
set to `ESCAPE`. However, this is a bit of a footgun so we want to
instead error when this happens, and force using `bytearray` if we
actually want to use bytes.
@erikjohnston erikjohnston force-pushed the erikj/disable_sql_bytes branch from 75b53a6 to 1d38583 Oct 8, 2019
erikjohnston added 2 commits Oct 9, 2019
@erikjohnston erikjohnston force-pushed the erikj/disable_sql_bytes branch 2 times, most recently from 763f430 to c3b34dc Oct 10, 2019
@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Oct 10, 2019
Copy link
Member

richvdh left a comment

lgtm.

@erikjohnston erikjohnston merged commit 329eae9 into develop Oct 10, 2019
18 checks passed
18 checks passed
buildkite/synapse Build #4912 passed (21 minutes, 9 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 40 seconds)
Details
buildkite/synapse/check-style Passed (1 minute, 47 seconds)
Details
buildkite/synapse/isort Passed (40 seconds)
Details
buildkite/synapse/mypy Passed (25 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (15 seconds)
Details
buildkite/synapse/packaging Passed (19 seconds)
Details
buildkite/synapse/pipeline Passed (2 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (17 minutes, 20 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (7 minutes, 10 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite-slash-old-deps Passed (15 minutes, 36 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (6 minutes, 2 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (17 minutes, 37 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (18 minutes, 44 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (7 minutes, 11 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-monolith Passed (16 minutes, 3 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-workers Passed (13 minutes, 57 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-sqlite-slash-monolith Passed (12 minutes, 48 seconds)
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.