File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 415415 end
416416
417417 it "should raise an error given an invalid DATETIME" do
418- expect { @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . each } . to \
419- raise_error ( Mysql2 ::Error , "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" )
418+ if @client . info [ :version ] < "8.0"
419+ expect { @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . each } . to \
420+ raise_error ( Mysql2 ::Error , "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" )
421+ else
422+ expect ( @client . query ( "SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime" ) . to_a . first ) . to \
423+ eql ( "bad_datetime" => nil )
424+ end
420425 end
421426
422427 context "string encoding for ENUM values" do
Original file line number Diff line number Diff line change @@ -482,8 +482,13 @@ def stmt_count
482482 end
483483
484484 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
487492 end
488493
489494 context "string encoding for ENUM values" do
You can’t perform that action at this time.
0 commit comments