File tree 2 files changed +14
-4
lines changed 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 410
410
end
411
411
412
412
it "should raise an error given an invalid DATETIME" do
413
- expect { @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . each } . to \
414
- raise_error ( Mysql2 ::Error , "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" )
413
+ if @client . info [ :version ] < "8.0"
414
+ expect { @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . each } . to \
415
+ raise_error ( Mysql2 ::Error , "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" )
416
+ else
417
+ expect ( @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . to_a . first ) . to \
418
+ eql ( "bad_datetime" => nil )
419
+ end
415
420
end
416
421
417
422
context "string encoding for ENUM values" do
Original file line number Diff line number Diff line change @@ -482,8 +482,13 @@ def stmt_count
482
482
end
483
483
484
484
it "should raise an error given an invalid DATETIME" do
485
- expect { @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . each } . to \
486
- raise_error ( Mysql2 ::Error , "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" )
485
+ if @client . info [ :version ] < "8.0"
486
+ expect { @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . each } . to \
487
+ raise_error ( Mysql2 ::Error , "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" )
488
+ else
489
+ expect ( @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . to_a . first ) . to \
490
+ eql ( "bad_datetime" => nil )
491
+ end
487
492
end
488
493
489
494
context "string encoding for ENUM values" do
You can’t perform that action at this time.
0 commit comments