sqlite3 1.6.2-arm64-darwin → 1.6.3-arm64-darwin

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4c9cd9ff9d89ff9500d1c15f90d997b6545d6ba1b3969eeaaa2b624bb19dbc21
4
- data.tar.gz: 0e61abf440c7f22cf77b63d0bcb3c78189843175874957cefd13b2224f499951
3
+ metadata.gz: 79621caa21e115b9d0561e96d56610b5cbbcc1fef6889a0bb4bd4a892ede7f31
4
+ data.tar.gz: c934858d0dba9dd2fd90dbcb2f4c80df1960282b7e3f400c5f88bbc5e3dad482
5
5
  SHA512:
6
- metadata.gz: 33926c6fa99632aabe011e12aa4948eac174cb57361f43ac989699016198a50a9baf3561e5e85e9c77d7cee9d1165caa42569ea8de4179b9ac447db29761741a
7
- data.tar.gz: 3b537df5a92475a7264a601188c50119e5af172179046a4556d22ff732885777087dd34c8d46632855f2c214a10327abde919fd59b7fc64481a6f1d8028aa079
6
+ metadata.gz: 7454ab6742196efb9b47b529f1d74e234e033d661169acf55ff097d8d821973b4d7e4bd5205cff916781c1df83b39358dbf14aaf1e1ac8b560483130ce9320b0
7
+ data.tar.gz: 7515f053cfd11cfb6c1b709cea53d3053d911ced55da5295bd96a6a46c0290bc081977235f7303d6cabe9fb61bab551d95de5ba366eb08113fd49f6fe7dcfd5c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # sqlite3-ruby Changelog
2
2
 
3
+ ## 1.6.3 / 2023-05-16
4
+
5
+ ### Dependencies
6
+
7
+ Vendored sqlite is updated to [v3.42.0](https://sqlite.org/releaselog/3_42_0.html).
8
+
9
+ From the release announcement:
10
+
11
+ > This is a regular enhancement release. The main new features are:
12
+ > * SQLite will now parse and understand JSON5, though it is careful to generate only pure, canonical JSON.
13
+ > * The secure-delete option has been added to the FTS5 extension.
14
+
15
+
3
16
  ## 1.6.2 / 2023-03-27
4
17
 
5
18
  ### Dependencies
data/Gemfile CHANGED
@@ -1,3 +1,11 @@
1
1
  source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
+
5
+ gem("minitest", "~> 5.15")
6
+ gem("rake-compiler", "~> 1.2.0")
7
+ gem("rake-compiler-dock", "1.3.0")
8
+ gem("rdoc", ">= 4.0", "< 7")
9
+ gem("psych", "~> 4.0") # psych 5 doesn't build on some CI platforms yet
10
+
11
+ gem("ruby_memcheck") if Gem::Platform.local.os == "linux"
data/dependencies.yml CHANGED
@@ -2,13 +2,13 @@
2
2
  :sqlite3:
3
3
  # checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
4
4
  #
5
- # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3410200.tar.gz
6
- # 1ebb5539dd6fde9a0f89e8ab765af0b9f02010fc6baf6985b54781a38c00020a ports/archives/sqlite-autoconf-3410200.tar.gz
5
+ # $ sha3sum -a 256 ports/archives/sqlite-autoconf-3420000.tar.gz
6
+ # 643898e9fcc8f6069bcd47b0e6057221c1ed17bbee57da20d2752c79d91274e8 ports/archives/sqlite-autoconf-3420000.tar.gz
7
7
  #
8
- # $ sha256sum ports/archives/sqlite-autoconf-3410200.tar.gz
9
- # e98c100dd1da4e30fa460761dab7c0b91a50b785e167f8c57acc46514fae9499 ports/archives/sqlite-autoconf-3410200.tar.gz
8
+ # $ sha256sum ports/archives/sqlite-autoconf-3420000.tar.gz
9
+ # 7abcfd161c6e2742ca5c6c0895d1f853c940f203304a0b49da4e1eca5d088ca6 ports/archives/sqlite-autoconf-3420000.tar.gz
10
10
  #
11
- :version: "3.41.2"
11
+ :version: "3.42.0"
12
12
  :files:
13
- - :url: "https://sqlite.org/2023/sqlite-autoconf-3410200.tar.gz"
14
- :sha256: "e98c100dd1da4e30fa460761dab7c0b91a50b785e167f8c57acc46514fae9499"
13
+ - :url: "https://sqlite.org/2023/sqlite-autoconf-3420000.tar.gz"
14
+ :sha256: "7abcfd161c6e2742ca5c6c0895d1f853c940f203304a0b49da4e1eca5d088ca6"
Binary file
Binary file
Binary file
Binary file
@@ -1,11 +1,11 @@
1
1
  module SQLite3
2
2
 
3
- VERSION = "1.6.2"
3
+ VERSION = "1.6.3"
4
4
 
5
5
  module VersionProxy
6
6
  MAJOR = 1
7
7
  MINOR = 6
8
- TINY = 2
8
+ TINY = 3
9
9
  BUILD = nil
10
10
 
11
11
  STRING = [ MAJOR, MINOR, TINY, BUILD ].compact.join( "." )
@@ -11,6 +11,10 @@ module SQLite3
11
11
  super
12
12
  end
13
13
 
14
+ def teardown
15
+ @db.close unless @db.closed?
16
+ end
17
+
14
18
  def test_segv
15
19
  assert_raises { SQLite3::Database.new 1 }
16
20
  end
@@ -54,6 +58,7 @@ module SQLite3
54
58
  assert_equal pn.realdirpath.to_s, File.realdirpath(db.filename)
55
59
  ensure
56
60
  tf.close! if tf
61
+ db.close if db
57
62
  end
58
63
 
59
64
 
@@ -189,6 +194,8 @@ module SQLite3
189
194
  def test_new
190
195
  db = SQLite3::Database.new(':memory:')
191
196
  assert db
197
+ ensure
198
+ db.close if db
192
199
  end
193
200
 
194
201
  def test_new_yields_self
@@ -210,6 +217,8 @@ module SQLite3
210
217
  :utf16 => true)
211
218
  end
212
219
  assert db
220
+ ensure
221
+ db.close if db
213
222
  end
214
223
 
215
224
  def test_close
@@ -243,6 +252,8 @@ module SQLite3
243
252
  db = SQLite3::Database.new(':memory:')
244
253
  stmt = db.prepare('select "hello world"')
245
254
  assert_instance_of(SQLite3::Statement, stmt)
255
+ ensure
256
+ stmt.close if stmt
246
257
  end
247
258
 
248
259
  def test_block_prepare_does_not_double_close
@@ -459,15 +470,19 @@ module SQLite3
459
470
  end
460
471
 
461
472
  def test_authorizer_ok
473
+ statements = []
474
+
462
475
  @db.authorizer = Class.new {
463
476
  def call action, a, b, c, d; true end
464
477
  }.new
465
- @db.prepare("select 'fooooo'")
478
+ statements << @db.prepare("select 'fooooo'")
466
479
 
467
480
  @db.authorizer = Class.new {
468
481
  def call action, a, b, c, d; 0 end
469
482
  }.new
470
- @db.prepare("select 'fooooo'")
483
+ statements << @db.prepare("select 'fooooo'")
484
+ ensure
485
+ statements.each(&:close)
471
486
  end
472
487
 
473
488
  def test_authorizer_ignore
@@ -476,6 +491,8 @@ module SQLite3
476
491
  }.new
477
492
  stmt = @db.prepare("select 'fooooo'")
478
493
  assert_nil stmt.step
494
+ ensure
495
+ stmt.close if stmt
479
496
  end
480
497
 
481
498
  def test_authorizer_fail
@@ -496,14 +513,18 @@ module SQLite3
496
513
  end
497
514
 
498
515
  @db.authorizer = nil
499
- @db.prepare("select 'fooooo'")
516
+ s = @db.prepare("select 'fooooo'")
517
+ ensure
518
+ s.close if s
500
519
  end
501
520
 
502
521
  def test_close_with_open_statements
503
- @db.prepare("select 'foo'")
522
+ s = @db.prepare("select 'foo'")
504
523
  assert_raises(SQLite3::BusyException) do
505
524
  @db.close
506
525
  end
526
+ ensure
527
+ s.close if s
507
528
  end
508
529
 
509
530
  def test_execute_with_empty_bind_params
@@ -511,7 +532,10 @@ module SQLite3
511
532
  end
512
533
 
513
534
  def test_query_with_named_bind_params
514
- assert_equal [['foo']], @db.query("select :n", {'n' => 'foo'}).to_a
535
+ resultset = @db.query("select :n", {'n' => 'foo'})
536
+ assert_equal [['foo']], resultset.to_a
537
+ ensure
538
+ resultset.close if resultset
515
539
  end
516
540
 
517
541
  def test_execute_with_named_bind_params
@@ -2,8 +2,6 @@ require 'helper'
2
2
 
3
3
  module SQLite3
4
4
  class TestDeprecated < SQLite3::TestCase
5
- attr_reader :db
6
-
7
5
  def setup
8
6
  super
9
7
  @warn_before = $-w
@@ -15,10 +13,13 @@ module SQLite3
15
13
  def teardown
16
14
  super
17
15
  $-w = @warn_before
16
+ @db.close
18
17
  end
19
18
 
20
19
  def test_query_with_many_bind_params_not_nil
21
- assert_equal [[1, 2]], db.query('select ?, ?', 1, 2).to_a
20
+ rs = @db.query('select ?, ?', 1, 2)
21
+ assert_equal [[1, 2]], rs.to_a
22
+ rs.close
22
23
  end
23
24
 
24
25
  def test_execute_with_many_bind_params_not_nil
@@ -26,11 +27,15 @@ module SQLite3
26
27
  end
27
28
 
28
29
  def test_query_with_many_bind_params
29
- assert_equal [[nil, 1]], @db.query("select ?, ?", nil, 1).to_a
30
+ rs = @db.query("select ?, ?", nil, 1)
31
+ assert_equal [[nil, 1]], rs.to_a
32
+ rs.close
30
33
  end
31
34
 
32
35
  def test_query_with_nil_bind_params
33
- assert_equal [['foo']], @db.query("select 'foo'", nil).to_a
36
+ rs = @db.query("select 'foo'", nil)
37
+ assert_equal [['foo']], rs.to_a
38
+ rs.close
34
39
  end
35
40
 
36
41
  def test_execute_with_many_bind_params
@@ -11,6 +11,10 @@ module SQLite3
11
11
  @db.execute(@create);
12
12
  end
13
13
 
14
+ def teardown
15
+ @db.close
16
+ end
17
+
14
18
  def test_select_encoding_on_utf_16
15
19
  str = "foo"
16
20
  utf16 = ([1].pack("I") == [1].pack("N")) ? "UTF-16BE" : "UTF-16LE"
@@ -24,6 +28,7 @@ module SQLite3
24
28
  assert_equal 1, stmt.to_a.length
25
29
  stmt.reset!
26
30
  end
31
+ stmt.close
27
32
  end
28
33
 
29
34
  def test_insert_encoding
@@ -39,6 +44,7 @@ module SQLite3
39
44
  stmt.to_a
40
45
  stmt.reset!
41
46
  end
47
+ stmt.close
42
48
 
43
49
  db.execute('select data from ex').flatten.each do |s|
44
50
  assert_equal str, s
@@ -55,6 +61,7 @@ module SQLite3
55
61
  stmt = @db.prepare('insert into ex(data) values (?)')
56
62
  stmt.bind_param 1, str
57
63
  stmt.step
64
+ stmt.close
58
65
 
59
66
  Encoding.default_internal = 'EUC-JP'
60
67
  string = @db.execute('select data from ex').first.first
@@ -73,6 +80,7 @@ module SQLite3
73
80
  stmt = @db.prepare('insert into foo(data) values (?)')
74
81
  stmt.bind_param(1, SQLite3::Blob.new(str))
75
82
  stmt.step
83
+ stmt.close
76
84
 
77
85
  string = @db.execute('select data from foo').first.first
78
86
  assert_equal Encoding.find('ASCII-8BIT'), string.encoding
@@ -85,6 +93,7 @@ module SQLite3
85
93
  stmt = @db.prepare('insert into foo(data) values (?)')
86
94
  stmt.bind_param(1, str.dup.force_encoding("ASCII-8BIT"))
87
95
  stmt.step
96
+ stmt.close
88
97
 
89
98
  string = @db.execute('select data from foo').first.first
90
99
  assert_equal Encoding.find('ASCII-8BIT'), string.encoding
@@ -97,6 +106,7 @@ module SQLite3
97
106
  stmt = @db.prepare('insert into foo(data) values (?)')
98
107
  stmt.bind_param(1, SQLite3::Blob.new(str))
99
108
  stmt.step
109
+ stmt.close
100
110
 
101
111
  string = @db.execute('select data from foo').first.first
102
112
  assert_equal Encoding.find('ASCII-8BIT'), string.encoding
@@ -2,29 +2,38 @@ require 'helper'
2
2
 
3
3
  module SQLite3
4
4
  class TestResultSet < SQLite3::TestCase
5
+ def setup
6
+ @db = SQLite3::Database.new ':memory:'
7
+ super
8
+ end
9
+
10
+ def teardown
11
+ super
12
+ @db.close
13
+ end
14
+
5
15
  def test_each_hash
6
- db = SQLite3::Database.new ':memory:'
7
- db.execute "create table foo ( a integer primary key, b text )"
16
+ @db.execute "create table foo ( a integer primary key, b text )"
8
17
  list = ('a'..'z').to_a
9
18
  list.each do |t|
10
- db.execute "insert into foo (b) values (\"#{t}\")"
19
+ @db.execute "insert into foo (b) values (\"#{t}\")"
11
20
  end
12
21
 
13
- rs = db.prepare('select * from foo').execute
22
+ rs = @db.prepare('select * from foo').execute
14
23
  rs.each_hash do |hash|
15
24
  assert_equal list[hash['a'] - 1], hash['b']
16
25
  end
26
+ rs.close
17
27
  end
18
28
 
19
29
  def test_next_hash
20
- db = SQLite3::Database.new ':memory:'
21
- db.execute "create table foo ( a integer primary key, b text )"
30
+ @db.execute "create table foo ( a integer primary key, b text )"
22
31
  list = ('a'..'z').to_a
23
32
  list.each do |t|
24
- db.execute "insert into foo (b) values (\"#{t}\")"
33
+ @db.execute "insert into foo (b) values (\"#{t}\")"
25
34
  end
26
35
 
27
- rs = db.prepare('select * from foo').execute
36
+ rs = @db.prepare('select * from foo').execute
28
37
  rows = []
29
38
  while row = rs.next_hash
30
39
  rows << row
@@ -32,6 +41,7 @@ module SQLite3
32
41
  rows.each do |hash|
33
42
  assert_equal list[hash['a'] - 1], hash['b']
34
43
  end
44
+ rs.close
35
45
  end
36
46
  end
37
47
  end
@@ -7,6 +7,11 @@ module SQLite3
7
7
  @stmt = SQLite3::Statement.new(@db, "select 'foo'")
8
8
  end
9
9
 
10
+ def teardown
11
+ @stmt.close if !@stmt.closed?
12
+ @db.close
13
+ end
14
+
10
15
  def test_double_close_does_not_segv
11
16
  @db.execute 'CREATE TABLE "things" ("number" float NOT NULL)'
12
17
 
@@ -35,6 +40,8 @@ module SQLite3
35
40
  # Older versions of SQLite return:
36
41
  # column *column_name* is not unique
37
42
  assert_match(/(column(s)? .* (is|are) not unique|UNIQUE constraint failed: .*)/, exception.message)
43
+
44
+ stmt.close
38
45
  end
39
46
 
40
47
  ###
@@ -46,6 +53,7 @@ module SQLite3
46
53
  if stmt.respond_to?(:database_name)
47
54
  assert_equal 'main', stmt.database_name(0)
48
55
  end
56
+ stmt.close
49
57
  end
50
58
 
51
59
  def test_prepare_blob
@@ -77,6 +85,7 @@ module SQLite3
77
85
  def test_new_with_remainder
78
86
  stmt = SQLite3::Statement.new(@db, "select 'foo';bar")
79
87
  assert_equal 'bar', stmt.remainder
88
+ stmt.close
80
89
  end
81
90
 
82
91
  def test_empty_remainder
@@ -101,6 +110,7 @@ module SQLite3
101
110
  result = nil
102
111
  stmt.each { |x| result = x }
103
112
  assert_equal ['hello'], result
113
+ stmt.close
104
114
  end
105
115
 
106
116
  def test_bind_param_int
@@ -109,6 +119,7 @@ module SQLite3
109
119
  result = nil
110
120
  stmt.each { |x| result = x }
111
121
  assert_equal [10], result
122
+ stmt.close
112
123
  end
113
124
 
114
125
  def test_bind_nil
@@ -117,6 +128,7 @@ module SQLite3
117
128
  result = nil
118
129
  stmt.each { |x| result = x }
119
130
  assert_equal [nil], result
131
+ stmt.close
120
132
  end
121
133
 
122
134
  def test_bind_blob
@@ -125,6 +137,7 @@ module SQLite3
125
137
  stmt.bind_param(1, SQLite3::Blob.new('hello'))
126
138
  stmt.execute
127
139
  row = @db.execute('select * from foo')
140
+ stmt.close
128
141
 
129
142
  assert_equal ['hello'], row.first
130
143
  assert_equal ['blob'], row.first.types
@@ -136,6 +149,7 @@ module SQLite3
136
149
  result = nil
137
150
  stmt.each { |x| result = x }
138
151
  assert_equal [2 ** 31], result
152
+ stmt.close
139
153
  end
140
154
 
141
155
  def test_bind_double
@@ -144,6 +158,7 @@ module SQLite3
144
158
  result = nil
145
159
  stmt.each { |x| result = x }
146
160
  assert_equal [2.2], result
161
+ stmt.close
147
162
  end
148
163
 
149
164
  def test_named_bind
@@ -152,6 +167,7 @@ module SQLite3
152
167
  result = nil
153
168
  stmt.each { |x| result = x }
154
169
  assert_equal ['hello'], result
170
+ stmt.close
155
171
  end
156
172
 
157
173
  def test_named_bind_no_colon
@@ -160,6 +176,7 @@ module SQLite3
160
176
  result = nil
161
177
  stmt.each { |x| result = x }
162
178
  assert_equal ['hello'], result
179
+ stmt.close
163
180
  end
164
181
 
165
182
  def test_named_bind_symbol
@@ -168,6 +185,7 @@ module SQLite3
168
185
  result = nil
169
186
  stmt.each { |x| result = x }
170
187
  assert_equal ['hello'], result
188
+ stmt.close
171
189
  end
172
190
 
173
191
  def test_named_bind_not_found
@@ -175,6 +193,7 @@ module SQLite3
175
193
  assert_raises(SQLite3::Exception) do
176
194
  stmt.bind_param('bar', 'hello')
177
195
  end
196
+ stmt.close
178
197
  end
179
198
 
180
199
  def test_each
@@ -225,16 +244,19 @@ module SQLite3
225
244
  def test_bind_parameter_count
226
245
  stmt = SQLite3::Statement.new(@db, "select ?, ?, ?")
227
246
  assert_equal 3, stmt.bind_parameter_count
247
+ stmt.close
228
248
  end
229
249
 
230
250
  def test_execute_with_varargs
231
251
  stmt = @db.prepare('select ?, ?')
232
252
  assert_equal [[nil, nil]], stmt.execute(nil, nil).to_a
253
+ stmt.close
233
254
  end
234
255
 
235
256
  def test_execute_with_hash
236
257
  stmt = @db.prepare('select :n, :h')
237
258
  assert_equal [[10, nil]], stmt.execute('n' => 10, 'h' => nil).to_a
259
+ stmt.close
238
260
  end
239
261
 
240
262
  def test_with_error
@@ -244,6 +266,7 @@ module SQLite3
244
266
  stmt.execute('employee-1') rescue SQLite3::ConstraintException
245
267
  stmt.reset!
246
268
  assert stmt.execute('employee-2')
269
+ stmt.close
247
270
  end
248
271
 
249
272
  def test_clear_bindings!
@@ -258,6 +281,8 @@ module SQLite3
258
281
  while x = stmt.step
259
282
  assert_equal [nil, nil], x
260
283
  end
284
+
285
+ stmt.close
261
286
  end
262
287
  end
263
288
  end
@@ -8,6 +8,10 @@ module SQLite3
8
8
  "CREATE TABLE items (id integer PRIMARY KEY, number integer)")
9
9
  end
10
10
 
11
+ def teardown
12
+ @db.close
13
+ end
14
+
11
15
  def test_execute_insert
12
16
  ps = @db.prepare("INSERT INTO items (number) VALUES (:n)")
13
17
  ps.execute('n'=>10)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sqlite3
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.2
4
+ version: 1.6.3
5
5
  platform: arm64-darwin
6
6
  authors:
7
7
  - Jamis Buck
@@ -10,84 +10,8 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2023-03-27 00:00:00.000000000 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: minitest
17
- requirement: !ruby/object:Gem::Requirement
18
- requirements:
19
- - - "~>"
20
- - !ruby/object:Gem::Version
21
- version: '5.15'
22
- type: :development
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
25
- requirements:
26
- - - "~>"
27
- - !ruby/object:Gem::Version
28
- version: '5.15'
29
- - !ruby/object:Gem::Dependency
30
- name: rake-compiler
31
- requirement: !ruby/object:Gem::Requirement
32
- requirements:
33
- - - "~>"
34
- - !ruby/object:Gem::Version
35
- version: 1.2.0
36
- type: :development
37
- prerelease: false
38
- version_requirements: !ruby/object:Gem::Requirement
39
- requirements:
40
- - - "~>"
41
- - !ruby/object:Gem::Version
42
- version: 1.2.0
43
- - !ruby/object:Gem::Dependency
44
- name: rake-compiler-dock
45
- requirement: !ruby/object:Gem::Requirement
46
- requirements:
47
- - - '='
48
- - !ruby/object:Gem::Version
49
- version: 1.3.0
50
- type: :development
51
- prerelease: false
52
- version_requirements: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - '='
55
- - !ruby/object:Gem::Version
56
- version: 1.3.0
57
- - !ruby/object:Gem::Dependency
58
- name: rdoc
59
- requirement: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '4.0'
64
- - - "<"
65
- - !ruby/object:Gem::Version
66
- version: '7'
67
- type: :development
68
- prerelease: false
69
- version_requirements: !ruby/object:Gem::Requirement
70
- requirements:
71
- - - ">="
72
- - !ruby/object:Gem::Version
73
- version: '4.0'
74
- - - "<"
75
- - !ruby/object:Gem::Version
76
- version: '7'
77
- - !ruby/object:Gem::Dependency
78
- name: psych
79
- requirement: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '4.0'
84
- type: :development
85
- prerelease: false
86
- version_requirements: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '4.0'
13
+ date: 2023-05-16 00:00:00.000000000 Z
14
+ dependencies: []
91
15
  description: |-
92
16
  This module allows Ruby programs to interface with the SQLite3
93
17
  database engine (http://www.sqlite.org). You must have the