Skip to content

Migrate Oracle and MemSQL to BaseCaseInsensitiveMappingTest and some cleanups#11250

Merged
hashhar merged 4 commits intotrinodb:masterfrom
hashhar:hashhar/cleanup
Mar 3, 2022
Merged

Migrate Oracle and MemSQL to BaseCaseInsensitiveMappingTest and some cleanups#11250
hashhar merged 4 commits intotrinodb:masterfrom
hashhar:hashhar/cleanup

Conversation

@hashhar
Copy link
Copy Markdown
Member

@hashhar hashhar commented Mar 1, 2022

Description

Some test cleanups.

Documentation

(x) No documentation is needed.

Release notes

(x) No release notes entries required.

@hashhar hashhar added the WIP label Mar 1, 2022
@cla-bot cla-bot bot added the cla-signed label Mar 1, 2022
@hashhar hashhar removed the WIP label Mar 1, 2022
@hashhar hashhar requested review from ebyhr and grantatspothero March 1, 2022 18:15
Comment on lines 119 to 127
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not the perfect solution, needed for Oracle (and maybe others in future).

Suggestions welcome.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It does the job and is simple. Good to go IMO.

Copy link
Copy Markdown
Contributor

@grantatspothero grantatspothero left a comment

Choose a reason for hiding this comment

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

👍

This also changes some tests to not use the session schema for testing
mapping rules because `getSession().getSchema()` returns the schema name
as set in the session while the mapping rules require the schema name to
match what actually exists in the remote database.

In case of Oracle the default session schema is not quoted during
creation in `TestingOracleServer#createConfigureScript` which causes it
to be created in uppercase. The tests create the mapping rules with the
lowercase name which causes failures.

A possible solution is to inspect
`DatabaseMetaData#storesUpperCaseIdentifiers` and adjust the value
passed to the mapping rule accordingly but it's cumbersome to access
`DatabaseMetaData` from the test so instead we opt to run these tests in
new schemas which would get created with correct case.
@hashhar
Copy link
Copy Markdown
Member Author

hashhar commented Mar 3, 2022

CI hit #11130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants