@@ -945,6 +945,24 @@ public void GetMySqlDateTime(string columnName)
945
945
}
946
946
}
947
947
948
+ [ Fact ]
949
+ public void Geometry ( )
950
+ {
951
+ DoQuery ( "geometry" , "Geometry" , "GEOMETRY" , new object [ ]
952
+ {
953
+ null ,
954
+ 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 } ,
955
+ 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 }
956
+ } ,
957
+ #if ! BASELINE
958
+ GetBytes
959
+ #else
960
+ // NOTE: Connector/NET returns 'null' for NULL so simulate an exception for the tests
961
+ x => x . IsDBNull ( 0 ) ? throw new GetValueWhenNullException ( ) : x . GetValue ( 0 )
962
+ #endif
963
+ ) ;
964
+ }
965
+
948
966
#if ! NETCOREAPP1_1_2
949
967
[ Theory ]
950
968
[ InlineData ( "Bit1" , "datatypes_bits" , MySqlDbType . Bit , 1 , typeof ( ulong ) , "N" , 0 , 0 ) ]
@@ -1000,6 +1018,7 @@ public void GetMySqlDateTime(string columnName)
1000
1018
[ InlineData ( "Timestamp" , "datatypes_times" , MySqlDbType . Timestamp , 26 , typeof ( DateTime ) , "N" , 0 , 6 ) ]
1001
1019
[ InlineData ( "Time" , "datatypes_times" , MySqlDbType . Time , 17 , typeof ( TimeSpan ) , "N" , 0 , 6 ) ]
1002
1020
[ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , 4 , typeof ( int ) , "N" , 0 , 0 ) ]
1021
+ [ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , int . MaxValue , typeof ( byte [ ] ) , "LN" , 0 , 0 ) ]
1003
1022
public void GetSchemaTable ( string column , string table , MySqlDbType mySqlDbType , int columnSize , Type dataType , string flags , int precision , int scale ) =>
1004
1023
DoGetSchemaTable ( column , table , mySqlDbType , columnSize , dataType , flags , precision , scale ) ;
1005
1024
@@ -1123,6 +1142,7 @@ private void DoGetSchemaTable(string column, string table, MySqlDbType mySqlDbTy
1123
1142
[ InlineData ( "Timestamp" , "datatypes_times" , MySqlDbType . Timestamp , "TIMESTAMP" , 26 , typeof ( DateTime ) , "N" , - 1 , 6 ) ]
1124
1143
[ InlineData ( "Time" , "datatypes_times" , MySqlDbType . Time , "TIME" , 17 , typeof ( TimeSpan ) , "N" , - 1 , 6 ) ]
1125
1144
[ InlineData ( "Year" , "datatypes_times" , MySqlDbType . Year , "YEAR" , 4 , typeof ( int ) , "N" , - 1 , 0 ) ]
1145
+ [ InlineData ( "Geometry" , "datatypes_geometry" , MySqlDbType . Geometry , "GEOMETRY" , int . MaxValue , typeof ( byte [ ] ) , "LN" , - 1 , 0 ) ]
1126
1146
public void GetColumnSchema ( string column , string table , MySqlDbType mySqlDbType , string dataTypeName , int columnSize , Type dataType , string flags , int precision , int scale )
1127
1147
{
1128
1148
if ( table == "datatypes_json_core" && ! AppConfig . SupportsJson )
0 commit comments