-
Notifications
You must be signed in to change notification settings - Fork 928
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
fixing a truncated table name #3571
base: master
Are you sure you want to change the base?
Conversation
@@ -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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return name.Length > 30 ? name.Substring(0, (30) - (1)) : name; | |
return name.Length > 30 ? name.Substring(0, 30) : name; |
Assert.AreEqual( | ||
30, | ||
temporaryTableName.Length); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert.AreEqual( | |
30, | |
temporaryTableName.Length); | |
Assert.That(temporaryTableName, Has.Length.EqualTo(30)); |
Assert.AreEqual( | ||
"HT_TABLE_NAME_THAT_EXCEEDS_30_", | ||
temporaryTableName | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assert.AreEqual( | |
"HT_TABLE_NAME_THAT_EXCEEDS_30_", | |
temporaryTableName | |
); | |
Assert.That(temporaryTableName, Is.EqualTo("HT_TABLE_NAME_THAT_EXCEEDS_30_")); |
@hazzik Thanks for the revision. It looks great for me. |
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