Releases: snelg/cakephp-3-oracle
Releases · snelg/cakephp-3-oracle
Avoid ORA-00972 (identifier too long)
This is the code I'm least proud of so far in this project ;)
Oracle has an absolute limit of 30 characters for any identifier, including aliases (e.g. "SELECT field AS alias").
Cake's automagic creates aliases that follow the pattern "TABLENAME__FIELDNAME", so it's fairly common for those combined strings to exceed 30 characters.
My hacky workaround:
- Down inside "quoteIdentifier", I replace any >30-character identifier with "XXAUTO_SHORTENED_ID[n]" with [n] as a simple incrementing integer.
- After fetching each row, if there were any auto-shortened identifiers then I replace them with the original >30-character strings.
Really ugly, and I suspect it could cause problems in as-yet-unforeseen ways, but it Works For Me™
1.0.10: Revert "Ensure bound variables remain active until after execute"
Yajra 1.0.1 fixed PHP7 bug, so no longer need local workaround for the same bug