@@ -965,17 +965,24 @@ public void GetMySqlDateTime(string columnName)
965965 }
966966 }
967967
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 , 0 , 0 , 0 , 0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 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 52 , 64 } ) ]
977+ public void QueryGeometry ( string columnName , string dataTypeName , byte [ ] expected )
970978 {
971979 var geometryData = new byte [ ] [ ]
972980 {
973981 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 ,
976983 } ;
977984
978- DoQuery ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . ToArray ( ) ,
985+ DoQuery ( "geometry" , columnName , dataTypeName , geometryData . ToArray ( ) ,
979986#if ! BASELINE
980987 GetBytes
981988#else
@@ -984,7 +991,7 @@ public void QueryGeometry()
984991#endif
985992 ) ;
986993
987- DoQuery < GetGeometryWhenNullException > ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
994+ DoQuery < GetGeometryWhenNullException > ( "geometry" , columnName , dataTypeName , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
988995 reader => reader . GetMySqlGeometry ( 0 ) ,
989996 matchesDefaultType : false ,
990997#if BASELINE
@@ -1071,6 +1078,13 @@ private static object CreateGeometry(byte[] data)
10711078 [ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , 4 , typeof ( int ) , "N" , 0 , 0 ) ]
10721079#endif
10731080 [ 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 ) ]
10741088 public void GetSchemaTable ( string column , string table , MySqlDbType mySqlDbType , int columnSize , Type dataType , string flags , int precision , int scale ) =>
10751089 DoGetSchemaTable ( column , table , mySqlDbType , columnSize , dataType , flags , precision , scale ) ;
10761090
@@ -1241,6 +1255,13 @@ public void GetSchemaTableAfterNextResult()
12411255 [ InlineData ( "Time" , "datatypes_times" , MySqlDbType . Time , "TIME" , 17 , typeof ( TimeSpan ) , "N" , - 1 , 6 ) ]
12421256 [ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , "YEAR" , 4 , typeof ( int ) , "N" , - 1 , 0 ) ]
12431257 [ 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 ) ]
12441265 public void GetColumnSchema ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , int columnSize , Type dataType , string flags , int precision , int scale )
12451266 {
12461267 if ( table == "datatypes_json_core" && ! AppConfig . SupportsJson )
@@ -1333,6 +1354,13 @@ public void GetColumnSchema(string column, string table, MySqlDbType mySqlDbType
13331354#if ! BASELINE
13341355 [ InlineData ( "value" , "datatypes_json_core" , MySqlDbType . JSON , "JSON" , typeof ( string ) , 4 , "[]" ) ]
13351356 [ 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 ) ]
13361364#endif
13371365 public void StoredProcedureOutParameter ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , Type dataType , int rowid , object expectedValue )
13381366 {
0 commit comments