Skip to content

Conversation

tohidemyname
Copy link
Contributor

@tohidemyname tohidemyname commented Jun 29, 2024

When the Oracle8iDialect creates a temporary table name for tables with names longer than 27 characters, the "H" from the usual temporary table name prefix ("HT_") is truncated.

fix #3456

@@ -529,7 +529,7 @@ public override bool SupportsTemporaryTables
public override string GenerateTemporaryTableName(String baseTableName)
{
string name = base.GenerateTemporaryTableName(baseTableName);
return name.Length > 30 ? name.Substring(1, (30) - (1)) : name;
return name.Length > 30 ? name.Substring(0, (30) - (1)) : name;
Copy link
Member

Choose a reason for hiding this comment

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

Need to remove -1 as well

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return name.Length > 30 ? name.Substring(0, (30) - (1)) : name;
return name.Length > 30 ? name.Substring(0, 30) : name;

Comment on lines +156 to +158
Assert.AreEqual(
30,
temporaryTableName.Length);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Assert.AreEqual(
30,
temporaryTableName.Length);
Assert.That(temporaryTableName, Has.Length.EqualTo(30));

Comment on lines +159 to +162
Assert.AreEqual(
"HT_TABLE_NAME_THAT_EXCEEDS_30_",
temporaryTableName
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Assert.AreEqual(
"HT_TABLE_NAME_THAT_EXCEEDS_30_",
temporaryTableName
);
Assert.That(temporaryTableName, Is.EqualTo("HT_TABLE_NAME_THAT_EXCEEDS_30_"));

@tohidemyname
Copy link
Contributor Author

@hazzik Thanks for the revision. It looks great for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Oracle8iDialect may not name temporary tables with HT_ prefix
2 participants