Skip to content
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

Oracle fix duplicate identifier for 3.2.x #5007

Closed
wants to merge 1 commit into from
Closed

Oracle fix duplicate identifier for 3.2.x #5007

wants to merge 1 commit into from

Conversation

aimeos
Copy link
Contributor

@aimeos aimeos commented Nov 20, 2021

Q A
Type bug
BC Break no
Fixed issues N/A

Rebased #5000 to 3.2.x

Summary

The Oracle platform class creates duplicate identifier if the passed name is longer then 24 characters because the original code simply truncates everything beyond that limit. For example:

my_really_lengthy_table_name -> MY_REALLY_LENGTHY_TABLE_N_AI_PK
my_really_lengthy_table_name2 -> MY_REALLY_LENGTHY_TABLE_N_AI_PK

The database reports an already existing identifier and fails to proceed. This PR adds a three character random part if the identifier would be longer then allowed:

my_really_lengthy_table_name -> MY_REALLY_LENGTHY_TABL_EAD_SEQ
my_really_lengthy_table_name2 -> MY_REALLY_LENGTHY_TABL_085_SEQ

@morozov
Copy link
Member

morozov commented Nov 21, 2021

Next time, please do not file a new PR in order to rebase the changes. Edit the existing one instead.

sequences for tables with 27 to 30 characters change their name because the hash digits are added.

For an existing project, it means that if a table uses the sequence with the old name to implement autoincrement and starts using a new sequence, the next sequence value will be 1 which will likely break the application. The same was previously discussed in #4744 (comment).

@aimeos
Copy link
Contributor Author

aimeos commented Nov 21, 2021

I've added the use function hash; line and used git commit --amend . && git push --force to update the PR but it's not visible here. Instead, Github only offers create a new PR. Any ideas how this can be solved?

@greg0ire greg0ire modified the milestones: 3.2.0, 3.3.0 Nov 26, 2021
@aimeos aimeos closed this Nov 28, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants