Merge ~lvoytek/ubuntu/+source/ruby-mysql2:restore-datetime-query-test into ubuntu/+source/ruby-mysql2:ubuntu/devel

Proposed by Lena Voytek
Status: Merged
Approved by: Robie Basak
Approved revision: 5326b5e43052f5e0e8e31fdb785a88267aaee2af
Merge reported by: Robie Basak
Merged at revision: 5326b5e43052f5e0e8e31fdb785a88267aaee2af
Proposed branch: ~lvoytek/ubuntu/+source/ruby-mysql2:restore-datetime-query-test
Merge into: ubuntu/+source/ruby-mysql2:ubuntu/devel
Diff against target: 68 lines (+8/-38)
3 files modified
debian/changelog (+8/-0)
debian/patches/series (+0/-1)
dev/null (+0/-37)
Reviewer Review Type Date Requested Status
Robie Basak Approve
Canonical Server Pending
Review via email: mp+423401@code.launchpad.net

Description of the change

Removed a patch added to combat a deprication to DateTime and Time queries in 8.0.28. Now that Mysql is at 8.0.29 the correct functionality has been restored. From the release notes:

A prepared and executed query like 'SELECT ?' with a DATE, TIME, DATETIME, or TIMESTAMP as the bound argument could return the wrong column type. The issue is fixed by restoring the previous logic that reprepared such queries to give each dynamic parameter its literal value.

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) :
review: Approve
Revision history for this message
Robie Basak (racb) wrote :

Uploaded

Revision history for this message
Robie Basak (racb) wrote :

Sorry it looks like I failed to upload this with rich history. It's in as f38ac0008439cb19d36adc00d3ca15f2d01f1e49, so marking Merged.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

This could've been a sync, isn't it? :(

Revision history for this message
Robie Basak (racb) wrote :

I did look and there did seem to be considerable other delta. Maybe that could be synced but I'd leave that to our separate merge workflow/schedule since otherwise there'd have to be lots of duplicate analysis every time we need to fix something in a package that already has a delta.

If it can be synced then that isn't precluded by this fix.

Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

If the work on src:mysql is going to be in Debian as well, I am sure this can be sync'd. I am the maintainer of ruby-mysql2 on the Debian side and I'd welcome this change.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 9ba329a..881dd16 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,11 @@
6+ruby-mysql2 (0.5.3-3ubuntu5) kinetic; urgency=medium
7+
8+ * remove d/p/adjust-test-acc-to-mysql-8.0.28-change.patch: correct
9+ functionality was restored to Time and DateTime query's with 'SELECT ?' in
10+ mysql 8.0.29
11+
12+ -- Lena Voytek <lena.voytek@canonical.com> Wed, 25 May 2022 14:28:23 -0700
13+
14 ruby-mysql2 (0.5.3-3ubuntu4) jammy; urgency=medium
15
16 * d/p/adjust-test-acc-to-mysql-8.0.28-change.patch:
17diff --git a/debian/patches/adjust-test-acc-to-mysql-8.0.28-change.patch b/debian/patches/adjust-test-acc-to-mysql-8.0.28-change.patch
18deleted file mode 100644
19index c1dea77..0000000
20--- a/debian/patches/adjust-test-acc-to-mysql-8.0.28-change.patch
21+++ /dev/null
22@@ -1,37 +0,0 @@
23-Description: Adjust tests according to mysql-8.0/8.0.28
24- behavioral change. MySQL now returns a String instead
25- of a DateTime object when called with "SELECT ? AS a"
26- and a parameter of MYSQL_TYPE_DATETIME.
27-Author: Utkarsh Gupta <utkarsh@ubuntu.com>
28-Origin: vendor
29-Bug: https://github.com/brianmario/mysql2/issues/1243
30-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/mysql-8.0/+bug/1961617
31-Forwarded: https://github.com/brianmario/mysql2/issues/1243
32-Last-Update: 2022-02-23
33-
34---- a/spec/mysql2/statement_spec.rb
35-+++ b/spec/mysql2/statement_spec.rb
36-@@ -1,4 +1,5 @@
37- require './spec/spec_helper.rb'
38-+require 'time'
39-
40- RSpec.describe Mysql2::Statement do
41- before :each do
42-@@ -165,7 +166,7 @@
43- statement = @client.prepare('SELECT ? AS a')
44- result = statement.execute(now)
45- # microseconds is six digits after the decimal, but only test on 5 significant figures
46-- expect(result.first['a'].strftime('%F %T.%5N %z')).to eql(now.strftime('%F %T.%5N %z'))
47-+ expect(Time.parse(result.first['a']).strftime('%F %T.%5N %z')).to eql(now.strftime('%F %T.%5N %z'))
48- end
49-
50- it "should prepare DateTime values with microseconds" do
51-@@ -173,7 +174,7 @@
52- statement = @client.prepare('SELECT ? AS a')
53- result = statement.execute(now)
54- # microseconds is six digits after the decimal, but only test on 5 significant figures
55-- expect(result.first['a'].strftime('%F %T.%5N %z')).to eql(now.strftime('%F %T.%5N %z'))
56-+ expect(Time.parse(result.first['a']).strftime('%F %T.%5N %z')).to eql(now.strftime('%F %T.%5N %z'))
57- end
58-
59- it "should tell us about the fields" do
60diff --git a/debian/patches/series b/debian/patches/series
61index b9702e0..11094cb 100644
62--- a/debian/patches/series
63+++ b/debian/patches/series
64@@ -7,4 +7,3 @@ mysql-8.0.patch
65 skip-more-tests.patch
66 fix-configuration.patch
67 skip-test-that-depends-on-server.patch
68-adjust-test-acc-to-mysql-8.0.28-change.patch

Subscribers

People subscribed via source and target branches