Skip to content

Commit 4e204ed

Browse files
committed
StringTypeWithLengthFixture: Use long string size 65535 on MySql which should be the maximum for the TEXT type.
1 parent 5b9c562 commit 4e204ed

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/NHibernate.Test/TypesTest/StringTypeWithLengthFixture.cs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,21 @@ public class StringTypeWithLengthFixture : TestCaseMappingByCode
1919
{
2020
private int GetLongStringMappedLength()
2121
{
22+
// This is a bit ugly...
23+
//
24+
// Return a value that should be the largest possible length of a string column
25+
// in the corresponding database. Note that the actual column type selected by the dialect
26+
// depends on this value, so it must be the largest possible value for the type
27+
// that the dialect will pick. Doesn't matter if the dialect can pick another
28+
// type for an even larger size.
29+
2230
if (Dialect is Oracle8iDialect)
2331
return 2000;
24-
else
25-
return 4000;
32+
33+
if (Dialect is MySQLDialect)
34+
return 65535;
35+
36+
return 4000;
2637
}
2738

2839
protected override HbmMapping GetMappings()

0 commit comments

Comments
 (0)