sqlite3 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -3
- data/CHANGELOG.rdoc +12 -0
- data/ext/sqlite3/database.c +7 -3
- data/ext/sqlite3/extconf.rb +5 -5
- data/ext/sqlite3/statement.c +2 -2
- data/lib/sqlite3/version.rb +3 -3
- data/test/test_integration_resultset.rb +0 -17
- data/test/test_statement.rb +0 -5
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff35addc187325a243e752d17c9f38ac54ea4a5b8a48c4809c4dd91692f1f94d
|
4
|
+
data.tar.gz: c9c22fc4b4a091197b12ae09c13d199c2fcd5f8c836944bf04f50be919d32f8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 68c1c1233ff73049b7c1ff1e0bbeec883bc90228182bd090564ff4df2b9f37fe92e4e9333a374306ba7fcdd10b0b2f914c4116dff0c34ef5c2e964f9342de986
|
7
|
+
data.tar.gz: 698263b49e7efa9a3c06220d71e617657fdf31b8e8097a9e2278b5ca3a5fbbb3468b2492fa51670345a3756b4760169d2b79681fac523144166f99253f1e40f3
|
data/.travis.yml
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
sudo: false
|
2
1
|
language: ruby
|
3
2
|
cache: bundler
|
4
3
|
before_install:
|
5
|
-
- gem update --system
|
6
|
-
- gem install bundler
|
4
|
+
- gem update --system 2.7.7
|
5
|
+
- gem install bundler -v 1.16.2
|
7
6
|
addons:
|
8
7
|
apt:
|
9
8
|
packages:
|
@@ -26,6 +25,8 @@ rvm:
|
|
26
25
|
- 2.3
|
27
26
|
- 2.4
|
28
27
|
- 2.5
|
28
|
+
- 2.6
|
29
|
+
- 2.7
|
29
30
|
- ruby-head
|
30
31
|
matrix:
|
31
32
|
allow_failures:
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
=== 1.4.2
|
2
|
+
|
3
|
+
* Travis: Drop unused setting "sudo: false"
|
4
|
+
* The taint mechanism will be deprecated in Ruby 2.7
|
5
|
+
* Fix Ruby 2.7 rb_check_safe_obj warnings
|
6
|
+
* Update travis config
|
7
|
+
|
8
|
+
=== 1.4.1
|
9
|
+
|
10
|
+
* Don't mandate dl functions for the extention build
|
11
|
+
* bumping version
|
12
|
+
|
1
13
|
=== 1.4.0
|
2
14
|
|
3
15
|
* Enhancements
|
data/ext/sqlite3/database.c
CHANGED
@@ -40,11 +40,13 @@ static VALUE rb_sqlite3_open_v2(VALUE self, VALUE file, VALUE mode, VALUE zvfs)
|
|
40
40
|
|
41
41
|
Data_Get_Struct(self, sqlite3Ruby, ctx);
|
42
42
|
|
43
|
+
#if defined TAINTING_SUPPORT
|
43
44
|
#if defined StringValueCStr
|
44
45
|
StringValuePtr(file);
|
45
46
|
rb_check_safe_obj(file);
|
46
47
|
#else
|
47
48
|
Check_SafeStr(file);
|
49
|
+
#endif
|
48
50
|
#endif
|
49
51
|
|
50
52
|
status = sqlite3_open_v2(
|
@@ -213,16 +215,16 @@ VALUE sqlite3val2rb(sqlite3_value * val)
|
|
213
215
|
return rb_float_new(sqlite3_value_double(val));
|
214
216
|
break;
|
215
217
|
case SQLITE_TEXT:
|
216
|
-
return
|
218
|
+
return rb_str_new2((const char *)sqlite3_value_text(val));
|
217
219
|
break;
|
218
220
|
case SQLITE_BLOB: {
|
219
221
|
/* Sqlite warns calling sqlite3_value_bytes may invalidate pointer from sqlite3_value_blob,
|
220
222
|
so we explicitly get the length before getting blob pointer.
|
221
|
-
Note that rb_str_new
|
223
|
+
Note that rb_str_new apparently create string with ASCII-8BIT (BINARY) encoding,
|
222
224
|
which is what we want, as blobs are binary
|
223
225
|
*/
|
224
226
|
int len = sqlite3_value_bytes(val);
|
225
|
-
return
|
227
|
+
return rb_str_new((const char *)sqlite3_value_blob(val), len);
|
226
228
|
break;
|
227
229
|
}
|
228
230
|
case SQLITE_NULL:
|
@@ -761,11 +763,13 @@ static VALUE rb_sqlite3_open16(VALUE self, VALUE file)
|
|
761
763
|
|
762
764
|
Data_Get_Struct(self, sqlite3Ruby, ctx);
|
763
765
|
|
766
|
+
#if defined TAINTING_SUPPORT
|
764
767
|
#if defined StringValueCStr
|
765
768
|
StringValuePtr(file);
|
766
769
|
rb_check_safe_obj(file);
|
767
770
|
#else
|
768
771
|
Check_SafeStr(file);
|
772
|
+
#endif
|
769
773
|
#endif
|
770
774
|
|
771
775
|
status = sqlite3_open16(utf16_string_value_ptr(file), &ctx->db);
|
data/ext/sqlite3/extconf.rb
CHANGED
@@ -47,6 +47,10 @@ if RbConfig::CONFIG["host_os"] =~ /mswin/
|
|
47
47
|
$CFLAGS << ' -W3'
|
48
48
|
end
|
49
49
|
|
50
|
+
if RUBY_VERSION < '2.7'
|
51
|
+
$CFLAGS << ' -DTAINTING_SUPPORT'
|
52
|
+
end
|
53
|
+
|
50
54
|
def asplode missing
|
51
55
|
if RUBY_PLATFORM =~ /mingw|mswin/
|
52
56
|
abort "#{missing} is missing. Install SQLite3 from " +
|
@@ -64,11 +68,7 @@ end
|
|
64
68
|
asplode('sqlite3.h') unless find_header 'sqlite3.h'
|
65
69
|
find_library 'pthread', 'pthread_create' # 1.8 support. *shrug*
|
66
70
|
|
67
|
-
have_library 'dl'
|
68
|
-
|
69
|
-
%w{ dlopen dlclose dlsym }.each do |func|
|
70
|
-
abort "missing function #{func}" unless have_func(func)
|
71
|
-
end
|
71
|
+
have_library 'dl' # for static builds
|
72
72
|
|
73
73
|
if with_config('sqlcipher')
|
74
74
|
asplode('sqlcipher') unless find_library 'sqlcipher', 'sqlite3_libversion_number'
|
data/ext/sqlite3/statement.c
CHANGED
@@ -151,7 +151,7 @@ static VALUE step(VALUE self)
|
|
151
151
|
break;
|
152
152
|
case SQLITE_TEXT:
|
153
153
|
{
|
154
|
-
VALUE str =
|
154
|
+
VALUE str = rb_str_new(
|
155
155
|
(const char *)sqlite3_column_text(stmt, i),
|
156
156
|
(long)sqlite3_column_bytes(stmt, i)
|
157
157
|
);
|
@@ -163,7 +163,7 @@ static VALUE step(VALUE self)
|
|
163
163
|
break;
|
164
164
|
case SQLITE_BLOB:
|
165
165
|
{
|
166
|
-
VALUE str =
|
166
|
+
VALUE str = rb_str_new(
|
167
167
|
(const char *)sqlite3_column_blob(stmt, i),
|
168
168
|
(long)sqlite3_column_bytes(stmt, i)
|
169
169
|
);
|
data/lib/sqlite3/version.rb
CHANGED
@@ -105,23 +105,6 @@ class TC_ResultSet < SQLite3::TestCase
|
|
105
105
|
assert_equal hash[1], "foo"
|
106
106
|
end
|
107
107
|
|
108
|
-
def test_tainted_results_as_hash
|
109
|
-
@db.results_as_hash = true
|
110
|
-
@result.reset( 1 )
|
111
|
-
row = @result.next
|
112
|
-
row.each do |_, v|
|
113
|
-
assert(v.tainted?) if String === v
|
114
|
-
end
|
115
|
-
end
|
116
|
-
|
117
|
-
def test_tainted_row_values
|
118
|
-
@result.reset( 1 )
|
119
|
-
row = @result.next
|
120
|
-
row.each do |v|
|
121
|
-
assert(v.tainted?) if String === v
|
122
|
-
end
|
123
|
-
end
|
124
|
-
|
125
108
|
def test_each
|
126
109
|
called = 0
|
127
110
|
@result.reset( 1, 2 )
|
data/test/test_statement.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-
|
13
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '5.
|
21
|
+
version: '5.13'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '5.
|
28
|
+
version: '5.13'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake-compiler
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,14 +122,14 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '3.
|
125
|
+
version: '3.20'
|
126
126
|
type: :development
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '3.
|
132
|
+
version: '3.20'
|
133
133
|
description: |-
|
134
134
|
This module allows Ruby programs to interface with the SQLite3
|
135
135
|
database engine (http://www.sqlite.org). You must have the
|
@@ -237,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: 1.3.5
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.0.
|
240
|
+
rubygems_version: 3.0.3
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: This module allows Ruby programs to interface with the SQLite3 database engine
|