@@ -38,7 +38,7 @@ public void CanRetrieveReservedWords()
38
38
[ Test ]
39
39
public void UpdateReservedWordsInDialect ( )
40
40
{
41
- var reservedDb = new HashSet < string > ( ) ;
41
+ var reservedDb = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
42
42
var configuration = TestConfigurationHelper . GetDefaultConfiguration ( ) ;
43
43
var dialect = Dialect . Dialect . GetDialect ( configuration . Properties ) ;
44
44
var connectionHelper = new ManagedProviderConnectionHelper ( configuration . Properties ) ;
@@ -58,7 +58,7 @@ public void UpdateReservedWordsInDialect()
58
58
59
59
var sf = ( ISessionFactoryImplementor ) configuration . BuildSessionFactory ( ) ;
60
60
SchemaMetadataUpdater . Update ( sf ) ;
61
- var match = reservedDb . Intersect ( sf . Dialect . Keywords ) ;
61
+ var match = reservedDb . Intersect ( sf . Dialect . Keywords , StringComparer . OrdinalIgnoreCase ) ;
62
62
63
63
// tests that nothing in the first metaData.GetReservedWords() is left out of the second metaData.GetReservedWords() call.
64
64
// i.e. always passes.
@@ -68,7 +68,7 @@ public void UpdateReservedWordsInDialect()
68
68
[ Test ]
69
69
public void EnsureReservedWordsHardCodedInDialect ( )
70
70
{
71
- var reservedDb = new HashSet < string > ( ) ;
71
+ var reservedDb = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
72
72
var configuration = TestConfigurationHelper . GetDefaultConfiguration ( ) ;
73
73
var dialect = Dialect . Dialect . GetDialect ( configuration . Properties ) ;
74
74
var connectionHelper = new ManagedProviderConnectionHelper ( configuration . Properties ) ;
@@ -90,7 +90,7 @@ public void EnsureReservedWordsHardCodedInDialect()
90
90
var sf = ( ISessionFactoryImplementor ) configuration . BuildSessionFactory ( ) ;
91
91
92
92
// use the dialect as configured, with no update
93
- var match = reservedDb . Intersect ( sf . Dialect . Keywords ) . ToList ( ) ;
93
+ var match = reservedDb . Intersect ( sf . Dialect . Keywords , StringComparer . OrdinalIgnoreCase ) . ToList ( ) ;
94
94
95
95
// tests that nothing in metaData.GetReservedWords() is left out of the Dialect.Keywords (without a refresh).
96
96
var differences = reservedDb . Except ( match ) . ToList ( ) ;
@@ -99,7 +99,7 @@ public void EnsureReservedWordsHardCodedInDialect()
99
99
Console . WriteLine ( "Update Dialect {0} with RegisterKeyword:" , sf . Dialect . GetType ( ) . Name ) ;
100
100
foreach ( var keyword in differences . OrderBy ( x => x ) )
101
101
{
102
- Console . WriteLine ( " RegisterKeyword(\" {0}\" );" , keyword ) ;
102
+ Console . WriteLine ( " RegisterKeyword(\" {0}\" );" , keyword . ToLowerInvariant ( ) ) ;
103
103
}
104
104
}
105
105
@@ -114,7 +114,7 @@ public void EnsureReservedWordsHardCodedInDialect()
114
114
[ Test ]
115
115
public void CheckForExcessReservedWordsHardCodedInDialect ( )
116
116
{
117
- var reservedDb = new HashSet < string > ( ) ;
117
+ var reservedDb = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
118
118
var configuration = TestConfigurationHelper . GetDefaultConfiguration ( ) ;
119
119
var dialect = Dialect . Dialect . GetDialect ( configuration . Properties ) ;
120
120
var connectionHelper = new ManagedProviderConnectionHelper ( configuration . Properties ) ;
@@ -124,7 +124,7 @@ public void CheckForExcessReservedWordsHardCodedInDialect()
124
124
var metaData = dialect . GetDataBaseSchema ( connectionHelper . Connection ) ;
125
125
foreach ( var rw in metaData . GetReservedWords ( ) )
126
126
{
127
- reservedDb . Add ( rw . ToLowerInvariant ( ) ) ;
127
+ reservedDb . Add ( rw ) ;
128
128
}
129
129
}
130
130
finally
@@ -136,13 +136,13 @@ public void CheckForExcessReservedWordsHardCodedInDialect()
136
136
137
137
// use the dialect as configured, with no update
138
138
// tests that nothing in Dialect.Keyword is not in metaData.GetReservedWords()
139
- var differences = sf . Dialect . Keywords . Except ( reservedDb ) . Except ( AnsiSqlKeywords . Sql2003 ) . ToList ( ) ;
139
+ var differences = sf . Dialect . Keywords . Except ( reservedDb , StringComparer . OrdinalIgnoreCase ) . Except ( AnsiSqlKeywords . Sql2003 , StringComparer . OrdinalIgnoreCase ) . ToList ( ) ;
140
140
if ( differences . Count > 0 )
141
141
{
142
142
Console . WriteLine ( "Excess RegisterKeyword in Dialect {0}:" , sf . Dialect . GetType ( ) . Name ) ;
143
143
foreach ( var keyword in differences . OrderBy ( x => x ) )
144
144
{
145
- Console . WriteLine ( " RegisterKeyword(\" {0}\" );" , keyword ) ;
145
+ Console . WriteLine ( " RegisterKeyword(\" {0}\" );" , keyword . ToLowerInvariant ( ) ) ;
146
146
}
147
147
}
148
148
@@ -189,7 +189,7 @@ public void AutoQuoteTableAndColumnsAtStratup()
189
189
[ Test ]
190
190
public void AutoQuoteTableAndColumnsAtStratupIncludeKeyWordsImport ( )
191
191
{
192
- var reservedDb = new HashSet < string > ( ) ;
192
+ var reservedDb = new HashSet < string > ( StringComparer . OrdinalIgnoreCase ) ;
193
193
var configuration = TestConfigurationHelper . GetDefaultConfiguration ( ) ;
194
194
var dialect = Dialect . Dialect . GetDialect ( configuration . Properties ) ;
195
195
var connectionHelper = new ManagedProviderConnectionHelper ( configuration . Properties ) ;
@@ -211,8 +211,8 @@ public void AutoQuoteTableAndColumnsAtStratupIncludeKeyWordsImport()
211
211
configuration . AddResource ( "NHibernate.Test.Tools.hbm2ddl.SchemaMetadataUpdaterTest.HeavyEntity.hbm.xml" ,
212
212
GetType ( ) . Assembly ) ;
213
213
var sf = ( ISessionFactoryImplementor ) configuration . BuildSessionFactory ( ) ;
214
- var match = reservedDb . Intersect ( sf . Dialect . Keywords ) ;
215
- Assert . That ( match , Is . EquivalentTo ( reservedDb ) ) ;
214
+ var match = reservedDb . Intersect ( sf . Dialect . Keywords , StringComparer . OrdinalIgnoreCase ) ;
215
+ Assert . That ( match , Is . EquivalentTo ( reservedDb ) . IgnoreCase ) ;
216
216
}
217
217
218
218
private static Column GetColumnByName ( IEnumerable < Column > columns , string colName )
0 commit comments