@@ -965,17 +965,24 @@ public void GetMySqlDateTime(string columnName)
965
965
}
966
966
}
967
967
968
- [ Fact ]
969
- public void QueryGeometry ( )
968
+ [ Theory ]
969
+ [ 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 } ) ]
970
+ [ 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 } ) ]
971
+ [ 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 } ) ]
972
+ [ 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 } ) ]
973
+ [ 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 } ) ]
974
+ [ 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 } ) ]
975
+ [ 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 } ) ]
977
+ public void QueryGeometry ( string columnName , string dataTypeName , byte [ ] expected )
970
978
{
971
979
var geometryData = new byte [ ] [ ]
972
980
{
973
981
null ,
974
- 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
- 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 }
982
+ expected ,
976
983
} ;
977
984
978
- DoQuery ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . ToArray ( ) ,
985
+ DoQuery ( "geometry" , columnName , dataTypeName , geometryData . ToArray ( ) ,
979
986
#if ! BASELINE
980
987
GetBytes
981
988
#else
@@ -984,7 +991,7 @@ public void QueryGeometry()
984
991
#endif
985
992
) ;
986
993
987
- DoQuery < GetGeometryWhenNullException > ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
994
+ DoQuery < GetGeometryWhenNullException > ( "geometry" , columnName , dataTypeName , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
988
995
reader => reader . GetMySqlGeometry ( 0 ) ,
989
996
matchesDefaultType : false ,
990
997
#if BASELINE
@@ -1071,6 +1078,13 @@ private static object CreateGeometry(byte[] data)
1071
1078
[ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , 4 , typeof ( int ) , "N" , 0 , 0 ) ]
1072
1079
#endif
1073
1080
[ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1081
+ [ InlineData ( "Point" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1082
+ [ InlineData ( "LineString" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1083
+ [ InlineData ( "Polygon" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1084
+ [ InlineData ( "MultiPoint" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1085
+ [ InlineData ( "MultiLineString" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1086
+ [ InlineData ( "MultiPolygon" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1087
+ [ InlineData ( "GeometryCollection" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1074
1088
public void GetSchemaTable ( string column , string table , MySqlDbType mySqlDbType , int columnSize , Type dataType , string flags , int precision , int scale ) =>
1075
1089
DoGetSchemaTable ( column , table , mySqlDbType , columnSize , dataType , flags , precision , scale ) ;
1076
1090
@@ -1241,6 +1255,13 @@ public void GetSchemaTableAfterNextResult()
1241
1255
[ InlineData ( "Time" , "datatypes_times" , MySqlDbType . Time , "TIME" , 17 , typeof ( TimeSpan ) , "N" , - 1 , 6 ) ]
1242
1256
[ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , "YEAR" , 4 , typeof ( int ) , "N" , - 1 , 0 ) ]
1243
1257
[ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1258
+ [ InlineData ( "Point" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1259
+ [ InlineData ( "LineString" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1260
+ [ InlineData ( "Polygon" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1261
+ [ InlineData ( "MultiPoint" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1262
+ [ InlineData ( "MultiLineString" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1263
+ [ InlineData ( "MultiPolygon" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1264
+ [ InlineData ( "GeometryCollection" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1244
1265
public void GetColumnSchema ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , int columnSize , Type dataType , string flags , int precision , int scale )
1245
1266
{
1246
1267
if ( table == "datatypes_json_core" && ! AppConfig . SupportsJson )
@@ -1333,6 +1354,13 @@ public void GetColumnSchema(string column, string table, MySqlDbType mySqlDbType
1333
1354
#if ! BASELINE
1334
1355
[ InlineData ( "value" , "datatypes_json_core" , MySqlDbType . JSON , "JSON" , typeof ( string ) , 4 , "[]" ) ]
1335
1356
[ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , typeof ( byte [ ] ) , 2 , null ) ]
1357
+ [ InlineData ( "Point" , "datatypes_geometry" , MySqlDbType . Geometry , "POINT" , typeof ( byte [ ] ) , 2 , null ) ]
1358
+ [ InlineData ( "LineString" , "datatypes_geometry" , MySqlDbType . Geometry , "LINESTRING" , typeof ( byte [ ] ) , 2 , null ) ]
1359
+ [ InlineData ( "Polygon" , "datatypes_geometry" , MySqlDbType . Geometry , "POLYGON" , typeof ( byte [ ] ) , 2 , null ) ]
1360
+ [ InlineData ( "MultiPoint" , "datatypes_geometry" , MySqlDbType . Geometry , "MULTIPOINT" , typeof ( byte [ ] ) , 2 , null ) ]
1361
+ [ InlineData ( "MultiLineString" , "datatypes_geometry" , MySqlDbType . Geometry , "MULTILINESTRING" , typeof ( byte [ ] ) , 2 , null ) ]
1362
+ [ InlineData ( "MultiPolygon" , "datatypes_geometry" , MySqlDbType . Geometry , "MULTIPOLYGON" , typeof ( byte [ ] ) , 2 , null ) ]
1363
+ [ InlineData ( "GeometryCollection" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRYCOLLECTION" , typeof ( byte [ ] ) , 2 , null ) ]
1336
1364
#endif
1337
1365
public void StoredProcedureOutParameter ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , Type dataType , int rowid , object expectedValue )
1338
1366
{
0 commit comments