@@ -969,17 +969,24 @@ public void GetMySqlDateTime(string columnName)
969
969
}
970
970
}
971
971
972
- [ Fact ]
973
- public void QueryGeometry ( )
972
+ [ Theory ]
973
+ [ InlineData ( "Geometry" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 } ) ]
974
+ [ InlineData ( "Point" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 } ) ]
975
+ [ InlineData ( "LineString" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 2 , 0 , 0 , 0 , 3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 64 } ) ]
976
+ [ InlineData ( "Polygon" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 3 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ) ]
977
+ [ InlineData ( "MultiPoint" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 4 , 0 , 0 , 0 , 3 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 64 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 8 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 8 , 64 } ) ]
978
+ [ InlineData ( "MultiLineString" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 5 , 0 , 0 , 0 , 2 , 0 , 0 , 0 , 1 , 2 , 0 , 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 36 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 36 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 52 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 52 , 64 , 1 , 2 , 0 , 0 , 0 , 2 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 46 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 46 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 62 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 46 , 64 } ) ]
979
+ [ InlineData ( "MultiPolygon" , "GEOMETRY" , new byte [ ] { 0 , 0 , 0 , 0 , 1 , 6 , 0 , 0 , 0 , 2 , 0 , 0 , 0 , 1 , 3 , 0 , 0 , 0 , 1 , 0 , 0 , 0 , 5 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 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 0 , 0 , 0 , 52 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 52 , 64 } ) ]
981
+ public void QueryGeometry ( string columnName , string dataTypeName , byte [ ] expected )
974
982
{
975
983
var geometryData = new byte [ ] [ ]
976
984
{
977
985
null ,
978
- new byte [ ] { 0 , 0 , 0 , 0 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 } ,
979
- new byte [ ] { 0 , 0 , 0 , 0 , 1 , 2 , 0 , 0 , 0 , 3 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 240 , 63 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 64 }
986
+ expected ,
980
987
} ;
981
988
982
- DoQuery ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . ToArray ( ) ,
989
+ DoQuery ( "geometry" , columnName , dataTypeName , geometryData . ToArray ( ) ,
983
990
#if ! BASELINE
984
991
GetBytes
985
992
#else
@@ -988,7 +995,7 @@ public void QueryGeometry()
988
995
#endif
989
996
) ;
990
997
991
- DoQuery < GetGeometryWhenNullException > ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
998
+ DoQuery < GetGeometryWhenNullException > ( "geometry" , columnName , dataTypeName , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
992
999
reader => reader . GetMySqlGeometry ( 0 ) ,
993
1000
matchesDefaultType : false ,
994
1001
#if BASELINE
@@ -1075,6 +1082,13 @@ private static object CreateGeometry(byte[] data)
1075
1082
[ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , 4 , typeof ( int ) , "N" , 0 , 0 ) ]
1076
1083
#endif
1077
1084
[ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1085
+ [ InlineData ( "Point" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1086
+ [ InlineData ( "LineString" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1087
+ [ InlineData ( "Polygon" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1088
+ [ InlineData ( "MultiPoint" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1089
+ [ InlineData ( "MultiLineString" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1090
+ [ InlineData ( "MultiPolygon" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1091
+ [ InlineData ( "GeometryCollection" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1078
1092
public void GetSchemaTable ( string column , string table , MySqlDbType mySqlDbType , int columnSize , Type dataType , string flags , int precision , int scale ) =>
1079
1093
DoGetSchemaTable ( column , table , mySqlDbType , columnSize , dataType , flags , precision , scale ) ;
1080
1094
@@ -1245,6 +1259,13 @@ public void GetSchemaTableAfterNextResult()
1245
1259
[ InlineData ( "Time" , "datatypes_times" , MySqlDbType . Time , "TIME" , 17 , typeof ( TimeSpan ) , "N" , - 1 , 6 ) ]
1246
1260
[ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , "YEAR" , 4 , typeof ( int ) , "N" , - 1 , 0 ) ]
1247
1261
[ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1262
+ [ InlineData ( "Point" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1263
+ [ InlineData ( "LineString" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1264
+ [ InlineData ( "Polygon" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1265
+ [ InlineData ( "MultiPoint" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1266
+ [ InlineData ( "MultiLineString" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1267
+ [ InlineData ( "MultiPolygon" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1268
+ [ InlineData ( "GeometryCollection" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1248
1269
public void GetColumnSchema ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , int columnSize , Type dataType , string flags , int precision , int scale )
1249
1270
{
1250
1271
if ( table == "datatypes_json_core" && ! AppConfig . SupportsJson )
@@ -1337,6 +1358,13 @@ public void GetColumnSchema(string column, string table, MySqlDbType mySqlDbType
1337
1358
#if ! BASELINE
1338
1359
[ InlineData ( "value" , "datatypes_json_core" , MySqlDbType . JSON , "JSON" , typeof ( string ) , 4 , "[]" ) ]
1339
1360
[ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , typeof ( byte [ ] ) , 2 , null ) ]
1361
+ [ InlineData ( "Point" , "datatypes_geometry" , MySqlDbType . Geometry , "POINT" , typeof ( byte [ ] ) , 2 , null ) ]
1362
+ [ InlineData ( "LineString" , "datatypes_geometry" , MySqlDbType . Geometry , "LINESTRING" , typeof ( byte [ ] ) , 2 , null ) ]
1363
+ [ InlineData ( "Polygon" , "datatypes_geometry" , MySqlDbType . Geometry , "POLYGON" , typeof ( byte [ ] ) , 2 , null ) ]
1364
+ [ InlineData ( "MultiPoint" , "datatypes_geometry" , MySqlDbType . Geometry , "MULTIPOINT" , typeof ( byte [ ] ) , 2 , null ) ]
1365
+ [ InlineData ( "MultiLineString" , "datatypes_geometry" , MySqlDbType . Geometry , "MULTILINESTRING" , typeof ( byte [ ] ) , 2 , null ) ]
1366
+ [ InlineData ( "MultiPolygon" , "datatypes_geometry" , MySqlDbType . Geometry , "MULTIPOLYGON" , typeof ( byte [ ] ) , 2 , null ) ]
1367
+ [ InlineData ( "GeometryCollection" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRYCOLLECTION" , typeof ( byte [ ] ) , 2 , null ) ]
1340
1368
#endif
1341
1369
public void StoredProcedureOutParameter ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , Type dataType , int rowid , object expectedValue )
1342
1370
{
0 commit comments