-
Notifications
You must be signed in to change notification settings - Fork 17
[#417] warn against assumed collation order #420
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
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -201,6 +201,21 @@ There are a few other options that can be used with GenQuery to affect how the r | |||||
| - no-distinct: Instructs GenQuery to return all results, even repeating identical results where applicable. | ||||||
| - uppercase: When specified, all VALUEs should be supplied in UPPERCASE and the query will be made case-insensitive. | ||||||
|
|
||||||
| ### Collation Order | ||||||
|
|
||||||
| It should be noted, with regard to the case-sensitive query defaults, that one cannot always rely on an assumed | ||||||
| collation order (i.e. the result of comparing mixed-case string arguments) to be followed. Because GenQuery passes | ||||||
| operators such as <, =, >, BETWEEN, and ORDER directly to the backing database, such assumptions are inherently | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes . except in GEnQuery it's just ORDER and ORDER_DESC
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh right. Forgot about that in GenQuery1. |
||||||
| non-portable. Consider the following query, when run in the context of three data objects named `a`, `A`, and `a_`: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To maintain consistency throughout the file, please combine these lines so that they are one long line. The rendered text should not be affected by the change.
alanking marked this conversation as resolved.
Outdated
|
||||||
|
|
||||||
| ```sql | ||||||
| select DATA_NAME where DATA_NAME between 'a' 'a_' | ||||||
| ``` | ||||||
|
|
||||||
| Under the default American setup of MySQL, for example, 'A' will fall in the range defined by `between` (as corroborated | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| by testing the result of the query `select 'a' <= 'A' and 'A' <= 'a_'` in the mysql client) and thus be reported among | ||||||
| GenQuery's results; whereas under the default setup of PostgreSQL, it will not. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To maintain consistency throughout the file, please combine these lines so that they are one long line. The rendered text should not be affected by the change. |
||||||
|
|
||||||
| ### Attributes | ||||||
|
|
||||||
| GenQuery attributes can be used in concert to retrieve information about an entity or category of entities from multiple different tables. If the attributes are not related in some way that will allow for table joinery, an error will occur, so make sure the query makes logical sense. Attempting a query where the selected ATTRIBUTEs cannot be logically linked together will result in the error `CAT_FAILED_TO_LINK_TABLES` (iRODS error code -825000). If this problem occurs, consider splitting the query into multiple queries or finding another ATTRIBUTE which will accomplish the task. | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.