Skip to content

Respect configured identifier folding - #12677

Merged
greg0ire merged 1 commit into
doctrine:3.7.xfrom
SomSamantray:fix/12272-unquoted-identifier-folding
Oct 21, 2026
Merged

greg0ire merged 1 commit into
doctrine:3.7.xfrom
SomSamantray:fix/12272-unquoted-identifier-folding

Conversation

@SomSamantray

@SomSamantray SomSamantray commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Result aliases now use the configured unquoted identifier folding on every DBAL platform that exposes the API. On DBAL versions without it, PostgreSQL aliases are lowercased and DB2 and Oracle aliases are uppercased.

Fixes #12272.

Validation

  • DBAL 4.5 regression test: 4 tests, 2 assertions, 2 skipped.
  • DBAL 3.10.4 regression test: 4 tests, 2 assertions, 2 skipped; both legacy fallback cases pass.
  • Full PHPUnit suite with DBAL 4.5: 3,673 tests, 12,487 assertions, 43 deprecations, 61 skipped, 2 incomplete; no failures or errors.
  • PHPStan passes with both DBAL 3 and DBAL 4 configurations.
  • PHPCS passes on all seven changed files.

AI disclosure

Prepared with OpenAI Codex assistance; the change and validation results were reviewed.

@greg0ire

Copy link
Copy Markdown
Member

Use DBAL identifier folding when it is available so result aliases\nfollow the configured casing. Keep the existing fallback for DBAL 3.\n\nFixes https://github.com/doctrine/orm/issues/12272.

Are those literal \n characters? Or is it a display issue?

Comment thread src/Internal/SQLResultCasing.php Resolved
@SomSamantray
SomSamantray force-pushed the fix/12272-unquoted-identifier-folding branch from e0a97ef to 896329c Compare October 16, 2026 11:10
@SomSamantray

Copy link
Copy Markdown
Contributor Author

Good catch, those were literal \n characters in the commit message. I've reworded it so it has real line breaks.

Comment thread src/Internal/SQLResultCasing.php Resolved
@SomSamantray
SomSamantray force-pushed the fix/12272-unquoted-identifier-folding branch from 896329c to 18ddfdd Compare October 16, 2026 21:01
Comment thread src/Internal/SQLResultCasing.php Resolved
@SomSamantray
SomSamantray force-pushed the fix/12272-unquoted-identifier-folding branch from 18ddfdd to 658f670 Compare October 18, 2026 13:46
Comment thread phpstan.neon Outdated
# DBAL 4 compatibility
-
message: '~^Call to function method_exists\(\) with .* and ''getUnquotedIdentifi…'' will always evaluate to true\.$~'
path: src/Internal/SQLResultCasing.php

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.

Please use a phpstan-ignore annotation with the error identifier. You should be able to find examples in the project.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 6792e4a: moved it to an inline @phpstan-ignore function.alreadyNarrowedType on the method_exists() call and reverted the phpstan.neon entry.

Use DBAL's configured folding for unquoted identifiers while preserving legacy casing on DBAL platforms without the folding API.

Fixes doctrine#12272.
@SomSamantray
SomSamantray force-pushed the fix/12272-unquoted-identifier-folding branch from 658f670 to 6792e4a Compare October 18, 2026 16:18
@greg0ire greg0ire added this to the 3.7.6 milestone Oct 21, 2026
@greg0ire
greg0ire merged commit b44f3df into doctrine:3.7.x Oct 21, 2026
130 of 131 checks passed
@greg0ire

Copy link
Copy Markdown
Member

Thanks @SomSamantray

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLResultCasing ignores UnquotedIdentifierFolding and breaks hydration when using DBAL portability (Oracle)

4 participants