-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🐛 Oracle: fix comment retrieval on table with reserved keyword name #6765
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
Changes from all 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 |
|---|---|---|
|
|
@@ -249,11 +249,12 @@ protected function doListTableColumns($table, $database = null): array | |
| ); | ||
| } | ||
|
|
||
| $normalizedTable = $this->normalizeName($table); | ||
|
|
||
| return $this->_getPortableTableColumnList( | ||
| $table, | ||
| $normalizedTable, | ||
| $database, | ||
| $this->selectTableColumns($database, $this->normalizeName($table)) | ||
| ->fetchAllAssociative(), | ||
| $this->selectTableColumns($database, $normalizedTable)->fetchAllAssociative(), | ||
| ); | ||
| } | ||
|
|
||
|
|
@@ -486,7 +487,7 @@ protected function doListTableDetails($name): Table | |
| $this->listTableIndexes($name), | ||
| [], | ||
| $foreignKeys, | ||
| $tableOptionsByTable[$normalizedName] ?? [], | ||
| $tableOptionsByTable[$name] ?? [], | ||
|
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. @morozov This change works for oracle but breaks for SQLite... I'm not sure of what approach should I take, but it looks like the mix between normalized / quoted names is the main issue here (and the various databases may not handle them the same).
Member
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. If you want, you can scope your pull request only to fixing the table comment, which is necessary only for Oracle (in my understanding). If you want to fix it for SQLite / column comments as well, you can try referring to the
Member
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.
I think options (and all other table objects) should be indexed by the normalized name. The quoted names are just form or user input, while the normalized ones are the actual values. E.g. on Oracle, the inputs
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.
I did not check whether there were mixed or no, but I confirm it works for both Oracle and SQLite there. |
||
| ); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.