-
Notifications
You must be signed in to change notification settings - Fork 929
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||||||||||
using NHibernate.Cfg; | ||||||||||||
using NHibernate.Cfg; | ||||||||||||
using NHibernate.Dialect; | ||||||||||||
using NHibernate.SqlCommand; | ||||||||||||
using NHibernate.Util; | ||||||||||||
|
@@ -148,5 +148,18 @@ public void CheckUnicodeWithPrefix() | |||||||||||
} | ||||||||||||
|
||||||||||||
#endregion | ||||||||||||
[Test] | ||||||||||||
public void TemporaryTableNameTruncation() | ||||||||||||
{ | ||||||||||||
string temporaryTableName = new Oracle8iDialect().GenerateTemporaryTableName( | ||||||||||||
"TABLE_NAME_THAT_EXCEEDS_30_CHARACTERS"); | ||||||||||||
Assert.AreEqual( | ||||||||||||
30, | ||||||||||||
temporaryTableName.Length); | ||||||||||||
Assert.AreEqual( | ||||||||||||
"HT_TABLE_NAME_THAT_EXCEEDS_30_", | ||||||||||||
temporaryTableName | ||||||||||||
); | ||||||||||||
Comment on lines
+159
to
+162
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
} | ||||||||||||
} | ||||||||||||
} | ||||||||||||
} |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. Need to remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
|
||||||
/// <inheritdoc /> | ||||||
|
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.