Repository navigation
fix: resolve schema-qualified table names in getFieldData() and protectIdentifiers()
#10604
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: develop
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -1338,7 +1338,7 @@ public function protectIdentifiers($item, bool $prefixSingle = false, ?bool $pro | |
|
|
||
| private function protectDotItem(string $item, string $alias, bool $protectIdentifiers, bool $fieldExists): string | ||
| { | ||
| $parts = explode('.', $item); | ||
| $parts = array_map(fn (string $part): string => trim($part, $this->escapeChar), explode('.', $item)); | ||
|
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. This case also failed before the PR, but it appears to be a missing case within the intended fix. With an empty |
||
|
|
||
| // Does the first segment of the exploded item match | ||
| // one of the aliases previously identified? If so, | ||
|
|
||
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.
With
QUOTED_IDENTIFIER OFF, the SQLSRV driver sets$this->escapeCharto['[', ']'].Passing this array as the second argument totrim()causes aTypeErrorwhen processing dotted identifiers. I verified thatprotectIdentifiers('jobs.id')returned[jobs].[id]before this change and now throws. We should handle the array form ofescapeCharand add a regression test.