@@ -415,6 +415,12 @@ func (t timeTest) run(dbt *DBTest, dbtype, tlayout string, mode timeMode) {
415
415
if str == t .s {
416
416
return
417
417
}
418
+ if mode .Binary () && dbtype == "DATETIME" && len (str ) == 26 && str [:19 ] == t .s {
419
+ // a fix mainly for TravisCI:
420
+ // accept full microsecond resolution in result for DATETIME columns
421
+ // where the binary protocol was used
422
+ return
423
+ }
418
424
dbt .Errorf ("%s [%s] to string: expected %q, got %q" ,
419
425
dbtype , mode ,
420
426
t .s , str ,
@@ -534,13 +540,6 @@ func TestDateTime(t *testing.T) {
534
540
rows .Scan (& allowsZero )
535
541
rows .Close ()
536
542
}
537
- // Fix for TravisCI with its "special" MySQL version
538
- var datetimeAutofracs bool
539
- rows , err = dbt .db .Query (`SELECT length(concat('',cast(? as DATETIME))) != 19` , "2011-11-20 21:27:37" )
540
- if err == nil {
541
- rows .Scan (& datetimeAutofracs )
542
- rows .Close ()
543
- }
544
543
for _ , setups := range testcases {
545
544
if t := setups .dbtype ; ! withFrac && t [len (t )- 1 :] == ")" {
546
545
// skip fractional second tests if unsupported by server
@@ -561,9 +560,6 @@ func TestDateTime(t *testing.T) {
561
560
// skip disallowed 0000-00-00 date
562
561
continue
563
562
}
564
- if datetimeAutofracs && setups .dbtype == "DATETIME" && setup .t != t0 {
565
- continue
566
- }
567
563
setup .run (dbt , setups .dbtype , setups .tlayout , textString )
568
564
setup .run (dbt , setups .dbtype , setups .tlayout , binaryString )
569
565
if allowBinTime {
0 commit comments