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

release-23.1: importer: fix collated string imports for MySQL/DELIMITED DATA #108286

Merged
merged 1 commit into from
Aug 8, 2023

Conversation

blathers-crl[bot]
Copy link

@blathers-crl blathers-crl bot commented Aug 7, 2023

Backport 1/1 commits from #107918 on behalf of @otan.

/cc @cockroachdb/release


We previously special cased ParseDatumStringWithRawBytes for MySQL related imports, which was buggy for collated strings as well. Instead, make import have a specialised method for converting MySQL literals to the relevant data type without compromising on collated strings.

Resolves #107917

Release note (bug fix): Previously, using IMPORT INTO for DELIMITED DATA or MySQL imports would error with column ... does not exist if it was importing into a collated string column.


Release justification: fixes bug with importing mysql data

@blathers-crl blathers-crl bot requested a review from a team as a code owner August 7, 2023 14:00
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-23.1-107918 branch from 4bc18b6 to 7c3a76e Compare August 7, 2023 14:00
@blathers-crl blathers-crl bot requested a review from DrewKimball August 7, 2023 14:00
@blathers-crl blathers-crl bot added blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot. labels Aug 7, 2023
@blathers-crl blathers-crl bot force-pushed the blathers/backport-release-23.1-107918 branch from c6e333d to 81ff5ca Compare August 7, 2023 14:00
@blathers-crl
Copy link
Author

blathers-crl bot commented Aug 7, 2023

Thanks for opening a backport.

Please check the backport criteria before merging:

  • Patches should only be created for serious issues or test-only changes.
  • Patches should not break backwards-compatibility.
  • Patches should change as little code as possible.
  • Patches should not change on-disk formats or node communication protocols.
  • Patches should not add new functionality.
  • Patches must not add, edit, or otherwise modify cluster versions; or add version gates.
If some of the basic criteria cannot be satisfied, ensure that the exceptional criteria are satisfied within.
  • There is a high priority need for the functionality that cannot wait until the next release and is difficult to address in another way.
  • The new functionality is additive-only and only runs for clusters which have specifically “opted in” to it (e.g. by a cluster setting).
  • New code is protected by a conditional check that is trivial to verify and ensures that it only runs for opt-in clusters.
  • The PM and TL on the team that owns the changed code have signed off that the change obeys the above rules.

Add a brief release justification to the body of your PR to justify this backport.

Some other things to consider:

  • What did we do to ensure that a user that doesn’t know & care about this backport, has no idea that it happened?
  • Will this work in a cluster of mixed patch versions? Did we test that?
  • If a user upgrades a patch version, uses this feature, and then downgrades, what happens?

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@DrewKimball DrewKimball left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 5 of 5 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @blathers-crl[bot] and @otan)


pkg/sql/importer/read_import_mysql.go line 214 at r1 (raw file):

		//  mysql emits raw byte strings that do not use the same escaping as our ParseBytes
		//	function expects, and the difference between ParseStringAs and
		//	ParseDatumStringAs is whether or not it attempts to parse bytes.

[nit] I just noticed, I think this comment is stale.

We previously special cased `ParseDatumStringWithRawBytes` for MySQL
related imports, which was buggy for collated strings as well. Instead,
make import have a specialised method for converting MySQL literals to
the relevant data type without compromising on collated strings.

Release note (bug fix): Previously, using IMPORT INTO for DELIMITED DATA
or MySQL imports would error with `column ... does not exist` if it was
importing into a collated string column.
@otan otan force-pushed the blathers/backport-release-23.1-107918 branch from 81ff5ca to 9679561 Compare August 7, 2023 23:50
@otan otan merged commit a227869 into release-23.1 Aug 8, 2023
@otan otan deleted the blathers/backport-release-23.1-107918 branch August 8, 2023 21:36
craig bot pushed a commit that referenced this pull request Aug 8, 2023
101260: sql: replicating JSON empty array ordering found in Postgres r=mgartner a=Shivs11

Currently, #97928 and #99275 are responsible for laying out a
lexicographical ordering for JSON columns to be forward indexable in
nature. This ordering is based on the rules posted by Postgres and is
in #99849.

However, Postgres currently sorts the empty JSON array before any other
JSON values. A Postgres bug report for this has been opened:
https://www.postgresql.org/message-id/17873-826fdc8bbcace4f1%40postgresql.org

This PR intends on replicating the Postgres behavior.

Fixes #105668

Epic: CRDB-24501

Release note: None


108160: roachtest/awsdms: run once a week instead r=Jeremyyang920 a=otan

Save a bit of mad dosh by running awsdms once a weekly instead of daily. We don't need this tested every week.

Epic: None

Release note: None

108300: schemachanger: Unskip some backup tests r=Xiang-Gu a=Xiang-Gu

Randomly skip subtests in the BACKUP/RESTORE suites before parallelizing them.

Epic: None
Release note: None

108328: rowexec: fix TestUncertaintyErrorIsReturned under race r=yuzefovich a=yuzefovich

We just saw a case when `TestUncertaintyErrorIsReturned` failed under race because we got a different DistSQL plan. This seems plausible in case the range cache population (which the test does explicitly) isn't quick enough for some reason, so this commit allows for the DistSQL plan to match the expectation via `SucceedsSoon` (if we happen to get a bad plan, then the following query execution should have the up-to-date range cache).

Fixes: #108250.

Release note: None

108341: importer: fix stale comment on mysqlStrToDatum r=mgartner,DrewKimball a=otan

Release note: None
Epic: None

From #108286 (review)

108370: go.mod: bump Pebble to fffe02a195e3 r=RahulAggarwal1016 a=RahulAggarwal1016

fffe02a1 db: simplify ScanInternal()
df7e2ae1 vfs: deflake TestDiskHealthChecking_Filesystem ff5c929a Rate Limit Scan Statistics
af8c5f27 internal/cache: mark panic messages as redaction-safe

Epic: none
Release note: none

108379: changefeedccl: deflake TestChangefeedSchemaChangeBackfillCheckpoint r=miretskiy a=jayshrivastava

Previously, the test `TestChangefeedSchemaChangeBackfillCheckpoint` would fail because it would read a table span too early. A schema change using the delcarative schema changer will update a table span to point to a new set of ranges. Previously, this test would use the span from before the schema change, which is incorrect. This change makes it use the span from after the schema change.

I stress tested this 30k times under the new schema changer and 10k times under the legacy schema changer to ensure the test is not flaky anymore.

Fixes: #108084
Release note: None
Epic: None

Co-authored-by: Shivam Saraf <[email protected]>
Co-authored-by: Oliver Tan <[email protected]>
Co-authored-by: Xiang Gu <[email protected]>
Co-authored-by: Yahor Yuzefovich <[email protected]>
Co-authored-by: Rahul Aggarwal <[email protected]>
Co-authored-by: Jayant Shrivastava <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blathers-backport This is a backport that Blathers created automatically. O-robot Originated from a bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants