sqlite3 1.5.0.rc1-x86_64-linux → 1.5.0.rc2-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -1
- data/ext/sqlite3/database.c +2 -2
- data/ext/sqlite3/extconf.rb +105 -12
- data/ext/sqlite3/sqlite3_ruby.h +5 -2
- data/lib/sqlite3/2.6/sqlite3_native.so +0 -0
- data/lib/sqlite3/2.7/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.0/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.1/sqlite3_native.so +0 -0
- data/lib/sqlite3/version.rb +2 -2
- data/test/test_database.rb +7 -0
- data/test/test_sqlite3.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 99a755fd4792cb1514dca7cda5001ed97e97b92d9950fc8faea2a57e676ec4f7
|
4
|
+
data.tar.gz: 9e5819cf3f66397fe43804d60c64a2cce96e4235364f56cd2e61807aa9994037
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ed80737479cd656ae33f8a0722799764750209e8d7ce3e140b78fddd1e2cded24ddd02098487c0c6ad99e702322ce90379ead49e4b065d65f1e952d77da5fc
|
7
|
+
data.tar.gz: c644ee9e6956a0defdebb72639b8bf7fab485826ef6eb8527a3f996e376ec373ceb97104879273a794ded04702315d2edacb46f9dcef055d166fa76245da48b7
|
data/CHANGELOG.md
CHANGED
@@ -23,7 +23,7 @@ See [the README](https://github.com/sparklemotion/sqlite3-ruby#native-gems-recom
|
|
23
23
|
|
24
24
|
#### More consistent developer experience
|
25
25
|
|
26
|
-
Both the native (precompiled) gems and the vanilla "ruby platform" (source) gem include sqlite v3.39.
|
26
|
+
Both the native (precompiled) gems and the vanilla "ruby platform" (source) gem include sqlite v3.39.2 by default.
|
27
27
|
|
28
28
|
Defaulting to a consistent version of sqlite across all systems means that your development environment behaves exactly like your production environment, and you have access to the latest and greatest features of sqlite.
|
29
29
|
|
@@ -36,6 +36,7 @@ You can opt-out of the packaged version of sqlite (and use your system-installed
|
|
36
36
|
|
37
37
|
* TruffleRuby is supported.
|
38
38
|
* Apple Silicon is supported (M1, arm64-darwin).
|
39
|
+
* vcpkg system libraries supported. [#332] (Thanks, @MSP-Greg!)
|
39
40
|
|
40
41
|
|
41
42
|
### Added
|
@@ -43,6 +44,11 @@ You can opt-out of the packaged version of sqlite (and use your system-installed
|
|
43
44
|
* `SQLite3::SQLITE_LOADED_VERSION` contains the version string of the sqlite3 library that is dynamically loaded (compare to `SQLite3::SQLITE_VERSION` which is the version at compile-time).
|
44
45
|
|
45
46
|
|
47
|
+
### Fixed
|
48
|
+
|
49
|
+
* `SQLite3::Database#load_extensions` now raises a `TypeError` unless a String is passed as the file path. Previously it was possible to pass a non-string and cause a segfault. [#339]
|
50
|
+
|
51
|
+
|
46
52
|
## 1.4.4 / 2022-06-14
|
47
53
|
|
48
54
|
### Fixes
|
data/ext/sqlite3/database.c
CHANGED
@@ -31,7 +31,7 @@ static char *
|
|
31
31
|
utf16_string_value_ptr(VALUE str)
|
32
32
|
{
|
33
33
|
StringValue(str);
|
34
|
-
rb_str_buf_cat(str, "\x00",
|
34
|
+
rb_str_buf_cat(str, "\x00\x00", 2L);
|
35
35
|
return RSTRING_PTR(str);
|
36
36
|
}
|
37
37
|
|
@@ -603,7 +603,7 @@ static VALUE load_extension(VALUE self, VALUE file)
|
|
603
603
|
Data_Get_Struct(self, sqlite3Ruby, ctx);
|
604
604
|
REQUIRE_OPEN_DB(ctx);
|
605
605
|
|
606
|
-
status = sqlite3_load_extension(ctx->db,
|
606
|
+
status = sqlite3_load_extension(ctx->db, StringValuePtr(file), 0, &errMsg);
|
607
607
|
if (status != SQLITE_OK)
|
608
608
|
{
|
609
609
|
errexp = rb_exc_new2(rb_eRuntimeError, errMsg);
|
data/ext/sqlite3/extconf.rb
CHANGED
@@ -36,19 +36,26 @@ module Sqlite3
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def sqlcipher?
|
39
|
-
with_config("sqlcipher")
|
39
|
+
with_config("sqlcipher") ||
|
40
|
+
with_config("sqlcipher-dir") ||
|
41
|
+
with_config("sqlcipher-include") ||
|
42
|
+
with_config("sqlcipher-lib")
|
40
43
|
end
|
41
44
|
|
42
45
|
def configure_system_libraries
|
43
46
|
pkg_config(libname)
|
44
|
-
|
47
|
+
append_cppflags("-DUSING_SQLCIPHER") if sqlcipher?
|
45
48
|
end
|
46
49
|
|
47
50
|
def configure_packaged_libraries
|
48
51
|
minimal_recipe.tap do |recipe|
|
49
52
|
recipe.configure_options += ["--enable-shared=no", "--enable-static=yes"]
|
50
53
|
ENV.to_h.tap do |env|
|
51
|
-
|
54
|
+
additional_cflags = [
|
55
|
+
"-fPIC", # needed for linking the static library into a shared library
|
56
|
+
"-O2", # see https://github.com/sparklemotion/sqlite3-ruby/issues/335 for some benchmarks
|
57
|
+
]
|
58
|
+
env["CFLAGS"] = [env["CFLAGS"], additional_cflags].flatten.join(" ")
|
52
59
|
recipe.configure_options += env.select { |k,v| ENV_ALLOWLIST.include?(k) }
|
53
60
|
.map { |key, value| "#{key}=#{value.strip}" }
|
54
61
|
end
|
@@ -72,10 +79,17 @@ module Sqlite3
|
|
72
79
|
|
73
80
|
def configure_extension
|
74
81
|
if Gem::Requirement.new("< 2.7").satisfied_by?(Gem::Version.new(RUBY_VERSION))
|
75
|
-
|
82
|
+
append_cppflags("-DTAINTING_SUPPORT")
|
83
|
+
end
|
84
|
+
|
85
|
+
if find_header("sqlite3.h")
|
86
|
+
# noop
|
87
|
+
elsif sqlcipher? && find_header("sqlcipher/sqlite3.h")
|
88
|
+
append_cppflags("-DUSING_SQLCIPHER_INC_SUBDIR")
|
89
|
+
else
|
90
|
+
abort_could_not_find("sqlite3.h")
|
76
91
|
end
|
77
92
|
|
78
|
-
abort_could_not_find("sqlite3.h") unless find_header("sqlite3.h")
|
79
93
|
abort_could_not_find(libname) unless find_library(libname, "sqlite3_libversion_number", "sqlite3.h")
|
80
94
|
|
81
95
|
# Functions defined in 1.9 but not 1.8
|
@@ -121,16 +135,16 @@ module Sqlite3
|
|
121
135
|
sqlite3: {
|
122
136
|
# checksum verified by first checking the published sha3(256) checksum:
|
123
137
|
#
|
124
|
-
#
|
125
|
-
#
|
138
|
+
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-3390200.tar.gz
|
139
|
+
# b195891eb32305481e61c6718b8cc3b090685b613c4824a076c63166a46c5bee ports/archives/sqlite-autoconf-3390200.tar.gz
|
126
140
|
#
|
127
|
-
#
|
128
|
-
#
|
141
|
+
# $ sha256sum ports/archives/sqlite-autoconf-3390200.tar.gz
|
142
|
+
# 852be8a6183a17ba47cee0bbff7400b7aa5affd283bf3beefc34fcd088a239de ports/archives/sqlite-autoconf-3390200.tar.gz
|
129
143
|
#
|
130
|
-
version: "3.39.
|
144
|
+
version: "3.39.2",
|
131
145
|
files: [{
|
132
|
-
url: "https://www.sqlite.org/2022/sqlite-autoconf-
|
133
|
-
sha256: "
|
146
|
+
url: "https://www.sqlite.org/2022/sqlite-autoconf-3390200.tar.gz",
|
147
|
+
sha256: "852be8a6183a17ba47cee0bbff7400b7aa5affd283bf3beefc34fcd088a239de",
|
134
148
|
}],
|
135
149
|
}
|
136
150
|
}
|
@@ -147,10 +161,89 @@ module Sqlite3
|
|
147
161
|
def download
|
148
162
|
minimal_recipe.download
|
149
163
|
end
|
164
|
+
|
165
|
+
def print_help
|
166
|
+
print(<<~TEXT)
|
167
|
+
USAGE: ruby #{$PROGRAM_NAME} [options]
|
168
|
+
|
169
|
+
Flags that are always valid:
|
170
|
+
|
171
|
+
--disable-system-libraries
|
172
|
+
Use the packaged libraries, and ignore the system libraries.
|
173
|
+
(This is the default behavior.)
|
174
|
+
|
175
|
+
--enable-system-libraries
|
176
|
+
Use system libraries instead of building and using the packaged libraries.
|
177
|
+
|
178
|
+
--with-sqlcipher
|
179
|
+
Use libsqlcipher instead of libsqlite3.
|
180
|
+
(Implies `--enable-system-libraries`.)
|
181
|
+
|
182
|
+
--help
|
183
|
+
Display this message.
|
184
|
+
|
185
|
+
|
186
|
+
Flags only used when using system libraries:
|
187
|
+
|
188
|
+
General (applying to all system libraries):
|
189
|
+
|
190
|
+
--with-opt-dir=DIRECTORY
|
191
|
+
Look for headers and libraries in DIRECTORY.
|
192
|
+
|
193
|
+
--with-opt-lib=DIRECTORY
|
194
|
+
Look for libraries in DIRECTORY.
|
195
|
+
|
196
|
+
--with-opt-include=DIRECTORY
|
197
|
+
Look for headers in DIRECTORY.
|
198
|
+
|
199
|
+
Related to sqlcipher:
|
200
|
+
|
201
|
+
--with-sqlcipher-dir=DIRECTORY
|
202
|
+
Look for sqlcipher headers and library in DIRECTORY.
|
203
|
+
(Implies `--with-sqlcipher` and `--enable-system-libraries`.)
|
204
|
+
|
205
|
+
--with-sqlcipher-lib=DIRECTORY
|
206
|
+
Look for sqlcipher library in DIRECTORY.
|
207
|
+
(Implies `--with-sqlcipher` and `--enable-system-libraries`.)
|
208
|
+
|
209
|
+
--with-sqlcipher-include=DIRECTORY
|
210
|
+
Look for sqlcipher headers in DIRECTORY.
|
211
|
+
(Implies `--with-sqlcipher` and `--enable-system-libraries`.)
|
212
|
+
|
213
|
+
|
214
|
+
Flags only used when building and using the packaged libraries:
|
215
|
+
|
216
|
+
--enable-cross-build
|
217
|
+
Enable cross-build mode. (You probably do not want to set this manually.)
|
218
|
+
|
219
|
+
|
220
|
+
Environment variables used for compiling the C extension:
|
221
|
+
|
222
|
+
CC
|
223
|
+
Use this path to invoke the compiler instead of `RbConfig::CONFIG['CC']`
|
224
|
+
|
225
|
+
|
226
|
+
Environment variables passed through to the compilation of packaged libraries:
|
227
|
+
|
228
|
+
CC
|
229
|
+
CPPFLAGS
|
230
|
+
CFLAGS
|
231
|
+
LDFLAGS
|
232
|
+
LIBS
|
233
|
+
LT_SYS_LIBRARY_PATH
|
234
|
+
CPP
|
235
|
+
|
236
|
+
TEXT
|
237
|
+
end
|
150
238
|
end
|
151
239
|
end
|
152
240
|
end
|
153
241
|
|
242
|
+
if arg_config("--help")
|
243
|
+
Sqlite3::ExtConf.print_help
|
244
|
+
exit!(0)
|
245
|
+
end
|
246
|
+
|
154
247
|
if arg_config("--download-dependencies")
|
155
248
|
Sqlite3::ExtConf.download
|
156
249
|
exit!(0)
|
data/ext/sqlite3/sqlite3_ruby.h
CHANGED
@@ -21,8 +21,11 @@
|
|
21
21
|
#define SQLITE3_UTF8_STR_NEW2(_obj) \
|
22
22
|
(rb_enc_associate_index(rb_str_new2(_obj), rb_utf8_encindex()))
|
23
23
|
|
24
|
-
|
25
|
-
#include <sqlite3.h>
|
24
|
+
#ifdef USING_SQLCIPHER_INC_SUBDIR
|
25
|
+
# include <sqlcipher/sqlite3.h>
|
26
|
+
#else
|
27
|
+
# include <sqlite3.h>
|
28
|
+
#endif
|
26
29
|
|
27
30
|
#ifndef HAVE_TYPE_SQLITE3_INT64
|
28
31
|
typedef sqlite_int64 sqlite3_int64;
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/sqlite3/version.rb
CHANGED
data/test/test_database.rb
CHANGED
@@ -534,5 +534,12 @@ module SQLite3
|
|
534
534
|
end
|
535
535
|
assert_includes error.message, "no such column: nope"
|
536
536
|
end
|
537
|
+
|
538
|
+
def test_load_extension_with_nonstring_argument
|
539
|
+
db = SQLite3::Database.new(':memory:')
|
540
|
+
skip("extensions are not enabled") unless db.respond_to?(:load_extension)
|
541
|
+
assert_raises(TypeError) { db.load_extension(1) }
|
542
|
+
assert_raises(TypeError) { db.load_extension(Pathname.new("foo.so")) }
|
543
|
+
end
|
537
544
|
end
|
538
545
|
end
|
data/test/test_sqlite3.rb
CHANGED
@@ -19,7 +19,12 @@ module SQLite3
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def test_version_strings
|
22
|
+
skip if SQLite3::VERSION.include?("test") # see set-version-to-timestamp rake task
|
22
23
|
assert_equal(SQLite3::VERSION, SQLite3::VersionProxy::STRING)
|
23
24
|
end
|
25
|
+
|
26
|
+
def test_compiled_version_and_loaded_version
|
27
|
+
assert_equal(SQLite3::SQLITE_VERSION, SQLite3::SQLITE_LOADED_VERSION)
|
28
|
+
end
|
24
29
|
end
|
25
30
|
end
|
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.5.0.
|
4
|
+
version: 1.5.0.rc2
|
5
5
|
platform: x86_64-linux
|
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: 2022-
|
13
|
+
date: 2022-08-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|