@@ -109,9 +109,13 @@ public override string ConnectionString
109109 public override DataTable GetSchema ( string collectionName , string [ ] restrictionValues )
110110 {
111111 GaxPreconditions . CheckNotNullOrEmpty ( collectionName , nameof ( collectionName ) ) ;
112- switch ( collectionName )
112+ if ( restrictionValues != null && restrictionValues . Length != 0 )
113113 {
114- case "MetaDataCollections" :
114+ throw new ArgumentException ( "Restrictions are not supported for the requested schema collection." , nameof ( restrictionValues ) ) ;
115+ }
116+ switch ( collectionName . ToUpperInvariant ( ) )
117+ {
118+ case "METADATACOLLECTIONS" :
115119 var collections = CreateSchemaTable ( collectionName ,
116120 ( "CollectionName" , typeof ( string ) ) ,
117121 ( "NumberOfRestrictions" , typeof ( int ) ) ,
@@ -121,7 +125,7 @@ public override DataTable GetSchema(string collectionName, string[] restrictionV
121125 collections . Rows . Add ( name , 0 , 0 ) ;
122126 }
123127 return collections ;
124- case "DataSourceInformation " :
128+ case "DATASOURCEINFORMATION " :
125129 return CreateSchemaTable ( collectionName ,
126130 ( "CompositeIdentifierSeparatorPattern" , typeof ( string ) ) ,
127131 ( "DataSourceProductName" , typeof ( string ) ) ,
@@ -139,7 +143,7 @@ public override DataTable GetSchema(string collectionName, string[] restrictionV
139143 ( "StatementSeparatorPattern" , typeof ( string ) ) ,
140144 ( "StringLiteralPattern" , typeof ( string ) ) ,
141145 ( "SupportedJoinOperators" , typeof ( int ) ) ) ;
142- case "DataTypes " :
146+ case "DATATYPES " :
143147 return CreateSchemaTable ( collectionName ,
144148 ( "TypeName" , typeof ( string ) ) , ( "ProviderDbType" , typeof ( int ) ) , ( "ColumnSize" , typeof ( long ) ) ,
145149 ( "CreateFormat" , typeof ( string ) ) , ( "CreateParameters" , typeof ( string ) ) , ( "DataType" , typeof ( string ) ) ,
@@ -149,11 +153,11 @@ public override DataTable GetSchema(string collectionName, string[] restrictionV
149153 ( "IsUnsigned" , typeof ( bool ) ) , ( "MaximumScale" , typeof ( short ) ) , ( "MinimumScale" , typeof ( short ) ) ,
150154 ( "IsConcurrencyType" , typeof ( bool ) ) , ( "IsLiteralSupported" , typeof ( bool ) ) ,
151155 ( "LiteralPrefix" , typeof ( string ) ) , ( "LiteralSuffix" , typeof ( string ) ) ) ;
152- case "Restrictions " :
156+ case "RESTRICTIONS " :
153157 return CreateSchemaTable ( collectionName ,
154158 ( "CollectionName" , typeof ( string ) ) , ( "RestrictionName" , typeof ( string ) ) ,
155159 ( "RestrictionDefault" , typeof ( string ) ) , ( "RestrictionNumber" , typeof ( int ) ) ) ;
156- case "ReservedWords " :
160+ case "RESERVEDWORDS " :
157161 return CreateSchemaTable ( collectionName , ( "ReservedWord" , typeof ( string ) ) ) ;
158162 default :
159163 throw new ArgumentException ( $ "The schema collection '{ collectionName } ' is not supported.", nameof ( collectionName ) ) ;
0 commit comments