@@ -600,21 +600,59 @@ public void InsertLargeBlobSync(string column, int size)
600
600
601
601
#if ! NETCOREAPP1_1_2
602
602
[ Theory ]
603
+ [ InlineData ( "Bit1" , "datatypes_bits" , 1 , typeof ( ulong ) , false , false , true , 0 , 0 ) ]
604
+ [ InlineData ( "Bit32" , "datatypes_bits" , 32 , typeof ( ulong ) , false , false , true , 0 , 0 ) ]
605
+ [ InlineData ( "Bit64" , "datatypes_bits" , 64 , typeof ( ulong ) , false , false , true , 0 , 0 ) ]
606
+ [ InlineData ( "Binary" , "datatypes_blobs" , 100 , typeof ( byte [ ] ) , false , false , true , 0 , 0 ) ]
607
+ [ InlineData ( "VarBinary" , "datatypes_blobs" , 100 , typeof ( byte [ ] ) , false , false , true , 0 , 0 ) ]
608
+ [ InlineData ( "TinyBlob" , "datatypes_blobs" , 255 , typeof ( byte [ ] ) , false , false , true , 0 , 0 ) ]
609
+ [ InlineData ( "Blob" , "datatypes_blobs" , 65535 , typeof ( byte [ ] ) , true , false , true , 0 , 0 ) ]
610
+ [ InlineData ( "MediumBlob" , "datatypes_blobs" , 16777215 , typeof ( byte [ ] ) , true , false , true , 0 , 0 ) ]
611
+ [ InlineData ( "LongBlob" , "datatypes_blobs" , int . MaxValue , typeof ( byte [ ] ) , true , false , true , 0 , 0 ) ]
612
+ [ InlineData ( "guidbin" , "datatypes_blobs" , 16 , typeof ( byte [ ] ) , false , false , true , 0 , 0 ) ]
603
613
[ InlineData ( "rowid" , "datatypes_bools" , 11 , typeof ( int ) , false , true , false , 0 , 0 ) ]
604
614
[ InlineData ( "Boolean" , "datatypes_bools" , 1 , typeof ( bool ) , false , false , true , 0 , 0 ) ]
615
+ [ InlineData ( "TinyInt1" , "datatypes_bools" , 1 , typeof ( bool ) , false , false , true , 0 , 0 ) ]
616
+ [ InlineData ( "size" , "datatypes_enums" , 7 , typeof ( string ) , false , false , true , 0 , 0 ) ]
617
+ [ InlineData ( "color" , "datatypes_enums" , 6 , typeof ( string ) , false , false , false , 0 , 0 ) ]
618
+ [ InlineData ( "char38" , "datatypes_guids" , 38 , typeof ( string ) , false , false , true , 0 , 0 ) ]
619
+ [ InlineData ( "char38bin" , "datatypes_guids" , 38 , typeof ( string ) , false , false , true , 0 , 0 ) ]
620
+ [ InlineData ( "text" , "datatypes_guids" , 65535 , typeof ( string ) , true , false , true , 0 , 0 ) ]
621
+ [ InlineData ( "blob" , "datatypes_guids" , 65535 , typeof ( byte [ ] ) , true , false , true , 0 , 0 ) ]
605
622
[ InlineData ( "SByte" , "datatypes_integers" , 4 , typeof ( sbyte ) , false , false , true , 0 , 0 ) ]
623
+ [ InlineData ( "Byte" , "datatypes_integers" , 3 , typeof ( byte ) , false , false , true , 0 , 0 ) ]
606
624
[ InlineData ( "Int16" , "datatypes_integers" , 6 , typeof ( short ) , false , false , true , 0 , 0 ) ]
607
625
[ InlineData ( "UInt16" , "datatypes_integers" , 5 , typeof ( ushort ) , false , false , true , 0 , 0 ) ]
626
+ [ InlineData ( "Int24" , "datatypes_integers" , 9 , typeof ( int ) , false , false , true , 0 , 0 ) ]
627
+ [ InlineData ( "UInt24" , "datatypes_integers" , 8 , typeof ( uint ) , false , false , true , 0 , 0 ) ]
628
+ [ InlineData ( "Int32" , "datatypes_integers" , 11 , typeof ( int ) , false , false , true , 0 , 0 ) ]
629
+ [ InlineData ( "UInt32" , "datatypes_integers" , 10 , typeof ( uint ) , false , false , true , 0 , 0 ) ]
630
+ [ InlineData ( "Int64" , "datatypes_integers" , 20 , typeof ( long ) , false , false , true , 0 , 0 ) ]
631
+ [ InlineData ( "UInt64" , "datatypes_integers" , 20 , typeof ( ulong ) , false , false , true , 0 , 0 ) ]
632
+ [ InlineData ( "value" , "datatypes_json_core" , int . MaxValue , typeof ( string ) , true , false , true , 0 , 0 ) ]
633
+ [ InlineData ( "Single" , "datatypes_reals" , 12 , typeof ( float ) , false , false , true , 0 , 31 ) ]
608
634
[ InlineData ( "Double" , "datatypes_reals" , 22 , typeof ( double ) , false , false , true , 0 , 31 ) ]
635
+ [ InlineData ( "SmallDecimal" , "datatypes_reals" , 7 , typeof ( decimal ) , false , false , true , 5 , 2 ) ]
609
636
[ InlineData ( "MediumDecimal" , "datatypes_reals" , 30 , typeof ( decimal ) , false , false , true , 28 , 8 ) ]
637
+ [ InlineData ( "BigDecimal" , "datatypes_reals" , 52 , typeof ( decimal ) , false , false , true , 50 , 30 ) ]
638
+ [ InlineData ( "value" , "datatypes_set" , 12 , typeof ( string ) , false , false , true , 0 , 0 ) ]
610
639
[ InlineData ( "utf8" , "datatypes_strings" , 300 , typeof ( string ) , false , false , true , 0 , 0 ) ]
640
+ [ InlineData ( "utf8bin" , "datatypes_strings" , 300 , typeof ( string ) , false , false , true , 0 , 0 ) ]
641
+ [ InlineData ( "latin1" , "datatypes_strings" , 300 , typeof ( string ) , false , false , true , 0 , 0 ) ]
642
+ [ InlineData ( "latin1bin" , "datatypes_strings" , 300 , typeof ( string ) , false , false , true , 0 , 0 ) ]
643
+ [ InlineData ( "cp1251" , "datatypes_strings" , 300 , typeof ( string ) , false , false , true , 0 , 0 ) ]
611
644
[ InlineData ( "guid" , "datatypes_strings" , 36 , typeof ( Guid ) , false , false , true , 0 , 0 ) ]
612
645
[ InlineData ( "guidbin" , "datatypes_strings" , 36 , typeof ( Guid ) , false , false , true , 0 , 0 ) ]
613
- [ InlineData ( "Blob" , "datatypes_blobs" , 65535 , typeof ( byte [ ] ) , true , false , true , 0 , 0 ) ]
614
646
[ InlineData ( "Date" , "datatypes_times" , 10 , typeof ( DateTime ) , false , false , true , 0 , 0 ) ]
647
+ [ InlineData ( "DateTime" , "datatypes_times" , 26 , typeof ( DateTime ) , false , false , true , 0 , 6 ) ]
648
+ [ InlineData ( "Timestamp" , "datatypes_times" , 26 , typeof ( DateTime ) , false , false , true , 0 , 6 ) ]
615
649
[ InlineData ( "Time" , "datatypes_times" , 17 , typeof ( TimeSpan ) , false , false , true , 0 , 6 ) ]
650
+ [ InlineData ( "Year" , "datatypes_times" , 4 , typeof ( int ) , false , false , true , 0 , 0 ) ]
616
651
public void GetSchemaTable ( string column , string table , int columnSize , Type dataType , bool isLong , bool isKey , bool allowDbNull , int precision , int scale )
617
652
{
653
+ if ( table == "datatypes_json_core" && ! AppConfig . SupportsJson )
654
+ return ;
655
+
618
656
using ( var command = m_database . Connection . CreateCommand ( ) )
619
657
{
620
658
command . CommandText = $ "select `{ column } ` from `{ table } `;";
@@ -633,12 +671,16 @@ public void GetSchemaTable(string column, string table, int columnSize, Type dat
633
671
Assert . Equal ( dataType , schema [ "DataType" ] ) ;
634
672
#if BASELINE
635
673
// https://bugs.mysql.com/bug.php?id=87868
636
- if ( dataType != typeof ( byte [ ] ) && dataType != typeof ( Guid ) )
674
+ if ( ! column . EndsWith ( "blob" , StringComparison . OrdinalIgnoreCase ) && column != "text" && dataType != typeof ( Guid ) && columnSize != int . MaxValue )
637
675
Assert . Equal ( columnSize , schema [ "ColumnSize" ] ) ;
638
676
#else
639
677
Assert . Equal ( columnSize , schema [ "ColumnSize" ] ) ;
640
678
#endif
679
+ #if BASELINE
680
+ Assert . Equal ( isLong && columnSize != int . MaxValue , schema [ "IsLong" ] ) ;
681
+ #else
641
682
Assert . Equal ( isLong , schema [ "IsLong" ] ) ;
683
+ #endif
642
684
Assert . Equal ( isKey , schema [ "IsKey" ] ) ;
643
685
Assert . Equal ( allowDbNull , schema [ "AllowDBNull" ] ) ;
644
686
Assert . Equal ( precision , schema [ "NumericPrecision" ] ) ;
0 commit comments