@@ -969,17 +969,24 @@ public void GetMySqlDateTime(string columnName)
969969 }
970970 }
971971
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 , 0 , 0 , 0 , 0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 , 64 , 0 , 0 , 0 , 0 , 0 , 0 , 52 , 64 } ) ]
981+ public void QueryGeometry ( string columnName , string dataTypeName , byte [ ] expected )
974982 {
975983 var geometryData = new byte [ ] [ ]
976984 {
977985 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 ,
980987 } ;
981988
982- DoQuery ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . ToArray ( ) ,
989+ DoQuery ( "geometry" , columnName , dataTypeName , geometryData . ToArray ( ) ,
983990#if ! BASELINE
984991 GetBytes
985992#else
@@ -988,7 +995,7 @@ public void QueryGeometry()
988995#endif
989996 ) ;
990997
991- DoQuery < GetGeometryWhenNullException > ( "geometry" , "Geometry" , "GEOMETRY" , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
998+ DoQuery < GetGeometryWhenNullException > ( "geometry" , columnName , dataTypeName , geometryData . Select ( CreateGeometry ) . ToArray ( ) ,
992999 reader => reader . GetMySqlGeometry ( 0 ) ,
9931000 matchesDefaultType : false ,
9941001#if BASELINE
@@ -1075,6 +1082,13 @@ private static object CreateGeometry(byte[] data)
10751082 [ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , 4 , typeof ( int ) , "N" , 0 , 0 ) ]
10761083#endif
10771084 [ 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 ) ]
10781092 public void GetSchemaTable ( string column , string table , MySqlDbType mySqlDbType , int columnSize , Type dataType , string flags , int precision , int scale ) =>
10791093 DoGetSchemaTable ( column , table , mySqlDbType , columnSize , dataType , flags , precision , scale ) ;
10801094
@@ -1245,6 +1259,13 @@ public void GetSchemaTableAfterNextResult()
12451259 [ InlineData ( "Time" , "datatypes_times" , MySqlDbType . Time , "TIME" , 17 , typeof ( TimeSpan ) , "N" , - 1 , 6 ) ]
12461260 [ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , "YEAR" , 4 , typeof ( int ) , "N" , - 1 , 0 ) ]
12471261 [ 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 ) ]
12481269 public void GetColumnSchema ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , int columnSize , Type dataType , string flags , int precision , int scale )
12491270 {
12501271 if ( table == "datatypes_json_core" && ! AppConfig . SupportsJson )
@@ -1337,6 +1358,13 @@ public void GetColumnSchema(string column, string table, MySqlDbType mySqlDbType
13371358#if ! BASELINE
13381359 [ InlineData ( "value" , "datatypes_json_core" , MySqlDbType . JSON , "JSON" , typeof ( string ) , 4 , "[]" ) ]
13391360 [ 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 ) ]
13401368#endif
13411369 public void StoredProcedureOutParameter ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , Type dataType , int rowid , object expectedValue )
13421370 {
0 commit comments