Skip to content

Oracle8iDialect may not name temporary tables with HT_ prefix #3456

Open
@tohidemyname

Description

@tohidemyname
Contributor

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.

Activity

changed the title [-]Oracle8iDialect may not name tempory tables HT_ prefix[/-] [+]Oracle8iDialect may not name tempory tables with HT_ prefix[/+] on Dec 24, 2023
changed the title [-]Oracle8iDialect may not name tempory tables with HT_ prefix[/-] [+]Oracle8iDialect may not name temporary tables with HT_ prefix[/+] on Dec 24, 2023
fredericDelaporte

fredericDelaporte commented on Dec 24, 2023

@fredericDelaporte
Member

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.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @fredericDelaporte@tohidemyname

      Issue actions

        Oracle8iDialect may not name temporary tables with HT_ prefix · Issue #3456 · nhibernate/nhibernate-core