autopkgtest: Invalid DATETIME test fails with mysql >= 8.0.24

Bug #1942476 reported by Paride Legovini
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ruby Mysql2
Fix Released
Unknown
ruby-mysql2 (Ubuntu)
Fix Released
Undecided
Paride Legovini
Focal
Fix Committed
Undecided
Unassigned
Hirsute
Won't Fix
Undecided
Unassigned

Bug Description

[Impact]

The test suite is failing when running against MySQL >= 8.0.24 with:

---------------------------------------------

Failures:

  1) Mysql2::Result row data type mapping should raise an error given an invalid DATETIME
     Failure/Error:
       expect { @client.query("SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime").each }.to \
         raise_error(Mysql2::Error, "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00")

       expected Mysql2::Error with "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" but nothing was raised
     # ./spec/mysql2/result_spec.rb:321:in `block (3 levels) in <top (required)>'

  2) Mysql2::Statement row data type mapping should raise an error given an invalid DATETIME
     Failure/Error:
       expect { @client.query("SELECT CAST('1972-00-27 00:00:00' AS DATETIME) as bad_datetime").each }.to \
         raise_error(Mysql2::Error, "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00")

       expected Mysql2::Error with "Invalid date in field 'bad_datetime': 1972-00-27 00:00:00" but nothing was raised
     # ./spec/mysql2/statement_spec.rb:478:in `block (3 levels) in <top (required)>'

---------------------------------------------

This regression was introduced by the following uploads:

    mysql-8.0 (8.0.25-0ubuntu0.20.04.1) focal-security;
    mysql-8.0 (8.0.25-0ubuntu0.21.04.1) hirsute-security;

According to the MySQL release notes (https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-24.html):

    Using CAST() on a DATE or DATETIME value in an INSERT statement
    raised a warning for "0000-00-00" and "2000-02-31", but not for
    "2000-01-00" or "2000-00-01". Now a warning is shown in each of
    these cases also.

but the ruby-mysql2 tests rely on the old behavior.

This is preventing Focal and Hirsute SRUs from migrating when they trigger a ruby-mysql2 autopkgtest run.

[Test Plan]

Once the autopkgtest pass the fix can be considered verified.

[Where problems could occur]

The SRU only touches test code, so this upload won't change the behavior of the package in any user visible way.

As this is a test fix I'm tagging this bug as block-proposed.

[Development Fix]

Already fixed by the security team by disabling the bad test.

I reported the bug upstream, so it's likely that one of the next upstream releases will ship with a fix, and we'll then be able to drop the delta.

This is not a bug in Debian *yet* because Debian still ships mysql-8.0 8.0.23, the latest version with the old behavior.

[Stable Fix]

What it's being proposed here it the same fix uploaded to the devel release (Impish) by the security team, with no changes.

Related branches

Paride Legovini (paride)
Changed in ruby-mysql2 (Ubuntu):
status: New → Triaged
Changed in ruby-mysql2 (Ubuntu Focal):
status: New → Triaged
Changed in ruby-mysql2 (Ubuntu Hirsute):
status: New → Triaged
Revision history for this message
Paride Legovini (paride) wrote :

This regression was introduced by the following upload:

  mysql-8.0 (8.0.25-0ubuntu0.20.04.1) focal-security;

which was not subject to the stricter SRU migration checks and was then copied into focal-updates.

Paride Legovini (paride)
affects: mysql-server → ruby-mysql2
Revision history for this message
Paride Legovini (paride) wrote :

Fix Released in Impish by 0.5.2-1ubuntu4.

Changed in ruby-mysql2 (Ubuntu):
status: Triaged → Fix Released
tags: added: block-proposed-focal block-proposed-hirsute
Paride Legovini (paride)
Changed in ruby-mysql2 (Ubuntu Focal):
assignee: nobody → Paride Legovini (paride)
Changed in ruby-mysql2 (Ubuntu Hirsute):
assignee: nobody → Paride Legovini (paride)
Paride Legovini (paride)
description: updated
description: updated
Paride Legovini (paride)
description: updated
Paride Legovini (paride)
Changed in ruby-mysql2 (Ubuntu Focal):
status: Triaged → In Progress
Changed in ruby-mysql2 (Ubuntu Hirsute):
status: Triaged → In Progress
Changed in ruby-mysql2:
status: Unknown → New
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Paride, or anyone else affected,

Accepted ruby-mysql2 into hirsute-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ruby-mysql2/0.5.2-1ubuntu3.21.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-hirsute to verification-done-hirsute. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-hirsute. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in ruby-mysql2 (Ubuntu Hirsute):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-hirsute
Changed in ruby-mysql2 (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed-focal
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Paride, or anyone else affected,

Accepted ruby-mysql2 into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/ruby-mysql2/0.5.2-1ubuntu3.20.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
Paride Legovini (paride) wrote :

Verified via local autopkgtest run against the -proposed package.

tags: added: verification-done verification-done-focal verification-done-hirsute
removed: verification-needed verification-needed-focal verification-needed-hirsute
Paride Legovini (paride)
Changed in ruby-mysql2 (Ubuntu):
assignee: nobody → Paride Legovini (paride)
Changed in ruby-mysql2 (Ubuntu Focal):
assignee: Paride Legovini (paride) → nobody
Changed in ruby-mysql2 (Ubuntu Hirsute):
assignee: Paride Legovini (paride) → nobody
Changed in ruby-mysql2:
status: New → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

The Hirsute Hippo has reached End of Life, so this bug will not be fixed for that release.

Changed in ruby-mysql2 (Ubuntu Hirsute):
status: Fix Committed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.