From d7efa5dc002f717941f6f35bb70280a7d1b4c9f7 Mon Sep 17 00:00:00 2001 From: wu-leilei Date: Mon, 24 Oct 2022 15:25:08 +0800 Subject: [PATCH] Fix compatibility with SQLite 3.37.0+ --- ....4.2-Fix-sqlite-3.37.0-compatibility.patch | 62 +++++++++++++++++++ rubygem-sqlite3.spec | 7 ++- 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 rubygem-sqlite3-1.4.2-Fix-sqlite-3.37.0-compatibility.patch diff --git a/rubygem-sqlite3-1.4.2-Fix-sqlite-3.37.0-compatibility.patch b/rubygem-sqlite3-1.4.2-Fix-sqlite-3.37.0-compatibility.patch new file mode 100644 index 0000000..ae330d8 --- /dev/null +++ b/rubygem-sqlite3-1.4.2-Fix-sqlite-3.37.0-compatibility.patch @@ -0,0 +1,62 @@ +From 5173d19aa7042daed4f20a2e6367f83b28687fbf Mon Sep 17 00:00:00 2001 +From: Orgad Shaneh +Date: Wed, 8 Dec 2021 10:31:34 +0200 +Subject: [PATCH] Fix unit tests + +--- + test/test_database.rb | 4 ++-- + test/test_integration.rb | 4 ++-- + test/test_integration_resultset.rb | 2 +- + 3 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/test/test_database.rb b/test/test_database.rb +index fe44b59..cd59852 100644 +--- a/test/test_database.rb ++++ b/test/test_database.rb +@@ -284,7 +284,7 @@ def test_table_info + "name" => "a", + "pk" => 1, + "notnull" => 0, +- "type" => "integer", ++ "type" => "INTEGER", + "dflt_value" => nil, + "cid" => 0 + }, +@@ -292,7 +292,7 @@ def test_table_info + "name" => "b", + "pk" => 0, + "notnull" => 0, +- "type" => "text", ++ "type" => "TEXT", + "dflt_value" => nil, + "cid" => 1 + }] +diff --git a/test/test_integration.rb b/test/test_integration.rb +index d5ea3a5..641d9eb 100644 +--- a/test/test_integration.rb ++++ b/test/test_integration.rb +@@ -36,9 +36,9 @@ def test_table_info_without_defaults_for_version_3_3_8_and_higher + @db.transaction do + @db.execute "create table no_defaults_test ( a integer default 1, b integer )" + data = @db.table_info( "no_defaults_test" ) +- assert_equal({"name" => "a", "type" => "integer", "dflt_value" => "1", "notnull" => 0, "cid" => 0, "pk" => 0}, ++ assert_equal({"name" => "a", "type" => "INTEGER", "dflt_value" => "1", "notnull" => 0, "cid" => 0, "pk" => 0}, + data[0]) +- assert_equal({"name" => "b", "type" => "integer", "dflt_value" => nil, "notnull" => 0, "cid" => 1, "pk" => 0}, ++ assert_equal({"name" => "b", "type" => "INTEGER", "dflt_value" => nil, "notnull" => 0, "cid" => 1, "pk" => 0}, + data[1]) + end + end +diff --git a/test/test_integration_resultset.rb b/test/test_integration_resultset.rb +index ad89c2e..0ea1d58 100644 +--- a/test/test_integration_resultset.rb ++++ b/test/test_integration_resultset.rb +@@ -118,7 +118,7 @@ def test_enumerable + end + + def test_types +- assert_equal [ "integer", "text" ], @result.types ++ assert_equal [ "INTEGER", "TEXT" ], @result.types + end + + def test_columns diff --git a/rubygem-sqlite3.spec b/rubygem-sqlite3.spec index eb6fc06..b3d05e5 100644 --- a/rubygem-sqlite3.spec +++ b/rubygem-sqlite3.spec @@ -1,11 +1,12 @@ %global gem_name sqlite3 Name: rubygem-%{gem_name} Version: 1.4.2 -Release: 1 +Release: 2 Summary: Allows Ruby scripts to interface with a SQLite3 database License: BSD URL: https://github.com/sparklemotion/sqlite3-ruby Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem +Patch0: rubygem-sqlite3-1.4.2-Fix-sqlite-3.37.0-compatibility.patch BuildRequires: ruby(release) rubygems-devel ruby-devel sqlite-devel rubygem(minitest) >= 5.0.0 BuildRequires: gcc %description @@ -22,6 +23,7 @@ Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} +%patch0 -p1 %build gem build ../%{gem_name}-%{version}.gemspec @@ -65,6 +67,9 @@ popd %{gem_instdir}/test %changelog +* Wed Oct 12 2033 wulei wulei80@h-partners.com - 1.4.2-2 +- Fix compatibility with SQLite 3.37.0+ + * Thu Mar 03 2022 jiangxinyu - 1.4.2-1 - update to 1.4.2 -- Gitee