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

Oracle8iDialect may not name temporary tables with HT_ prefix #3456

Open
tohidemyname opened this issue Nov 29, 2023 · 1 comment · May be fixed by #3571
Open

Oracle8iDialect may not name temporary tables with HT_ prefix #3456

tohidemyname opened this issue Nov 29, 2023 · 1 comment · May be fixed by #3571

Comments

@tohidemyname
Copy link
Contributor

tohidemyname commented Nov 29, 2023

Oracle8iDialect may not name all temporary tables with HT_ prefix. Some may be prefixed with T_ instead.

This bug was reported to hibernate:
https://hibernate.atlassian.net/browse/HHH-9290

The buggy code of hibernate is as follows:

public String generateTemporaryTableName(String baseTableName) {
	final String name = super.generateTemporaryTableName( baseTableName );
	return name.length() > 30 ? name.substring( 1, 30 ) : name;
}

The fixed code is as follows:

public String generateTemporaryTableName(String baseTableName) {
	final String name = super.generateTemporaryTableName( baseTableName );
	return name.length() > 30 ? name.substring( 0, 30 ) : name;
}

The latest NHibernate is identical to the buggy code:

public override string GenerateTemporaryTableName(String baseTableName)
{
	string name = base.GenerateTemporaryTableName(baseTableName);
	return name.Length > 30 ? name.Substring(1, (30) - (1)) : name;
}

As a result, NHibernate can have the identical bug but leave it unfixed.

@fredericDelaporte fredericDelaporte changed the title Oracle8iDialect may not name tempory tables HT_ prefix Oracle8iDialect may not name tempory tables with HT_ prefix Dec 24, 2023
@fredericDelaporte fredericDelaporte changed the title Oracle8iDialect may not name tempory tables with HT_ prefix Oracle8iDialect may not name temporary tables with HT_ prefix Dec 24, 2023
@fredericDelaporte
Copy link
Member

fredericDelaporte commented Dec 24, 2023

Excepted the name discrepancy for some tables, has this bug any other effect? (Does the HT_ or T_ prefix has any special treatment with Oracle? Looking at the documentation, is does not seem so.)

The possible breaking change for this change is in case the database already has some other table with a name which would match the renamed temporary table: it may cause a name conflict that was previously avoided through the bug.

@fredericDelaporte fredericDelaporte linked a pull request Jun 30, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants