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

pgwire: test \u0001 in JSON pgwire encoding #33222

Merged
merged 1 commit into from Dec 18, 2018
Merged

pgwire: test \u0001 in JSON pgwire encoding #33222

merged 1 commit into from Dec 18, 2018

Conversation

maddyblue
Copy link
Contributor

Verify that we handle "\u0001" JSON strings identically to postgres. The
printing of \u0001 instead of some other character is correct, and the
same as what postgres does. (We do not test \u0000 here because postgres
rejects it as a valid string, even though we accept it.)

Closes #33165

Release note: None

Verify that we handle "\u0001" JSON strings identically to postgres. The
printing of \u0001 instead of some other character is correct, and the
same as what postgres does. (We do not test \u0000 here because postgres
rejects it as a valid string, even though we accept it.)

Closes #33165

Release note: None
@maddyblue maddyblue requested review from knz and a team December 18, 2018 06:05
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@maddyblue
Copy link
Contributor Author

bors r+

craig bot pushed a commit that referenced this pull request Dec 18, 2018
33221: sql: always use typed expressions for shift on int r=mjibson a=mjibson

Previously the expressions 1 << 63 and 1::int << 63 would return positive
and negative results, respectively. This was because constant folding
in the first case is not subject to 2s complent that causes negative
ints in the second case.

Change shift on int to not fold. This prevents the surprising behavior
described above in addition to other bugs where shifting by a large
amount could allocate huge amounts of memory and crash the process.

Fixes #32682

Release note (sql change): Shift operators on integers now always operate
on explicit types instead of possibly an untyped constant. They also
now return an error if the right-side operand is out of range.

33222: pgwire: test \u0001 in JSON pgwire encoding r=mjibson a=mjibson

Verify that we handle "\u0001" JSON strings identically to postgres. The
printing of \u0001 instead of some other character is correct, and the
same as what postgres does. (We do not test \u0000 here because postgres
rejects it as a valid string, even though we accept it.)

Closes #33165

Release note: None

Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig
Copy link
Contributor

craig bot commented Dec 18, 2018

Build succeeded

@craig craig bot merged commit 6af01b9 into cockroachdb:master Dec 18, 2018
@maddyblue maddyblue deleted the json-enc branch December 18, 2018 19:59
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.

None yet

3 participants