Closed Ben3eeE closed 3 months ago
In version 5.82.0 when connecting with sqlite3 the connection string was unescaped and this was changed here: https://github.com/jeremyevans/sequel/commit/f1377af8312d33559867f218277dd4f2913c45e2#diff-8e4b522a718d9c729869dad14f50bafcac64665ef51504eea33e79e71ee42ae4
This makes connecting with a URI like sqlite://app%2Fdata%2Ftest.db create a file called app%2Fdata%2Ftest.db instead of a file called test.db in the app/data folder.
sqlite://app%2Fdata%2Ftest.db
app%2Fdata%2Ftest.db
test.db
app/data
This way of connecting is used in the wild by gemstash: https://github.com/rubygems/gemstash/blob/e0e1b4b920ac29b9f777e0cd0b9325e3d73f5259/lib/gemstash/env.rb#L132
Not sure if this was an unintentional change here or if gemstash should be changed to stop doing this.
require 'sequel' require 'cgi' Sequel.connect("sqlite://#{CGI.escape("app/data/test.db")}")
No response
3.3.4
5.83.0
Thanks for the report. This wasn't intended, and it is a regression, so I'll fix it and release 5.83.1.
I've released 5.83.1 with this fix.
Complete Description of Issue
In version 5.82.0 when connecting with sqlite3 the connection string was unescaped and this was changed here: https://github.com/jeremyevans/sequel/commit/f1377af8312d33559867f218277dd4f2913c45e2#diff-8e4b522a718d9c729869dad14f50bafcac64665ef51504eea33e79e71ee42ae4
This makes connecting with a URI like
sqlite://app%2Fdata%2Ftest.db
create a file calledapp%2Fdata%2Ftest.db
instead of a file calledtest.db
in theapp/data
folder.This way of connecting is used in the wild by gemstash: https://github.com/rubygems/gemstash/blob/e0e1b4b920ac29b9f777e0cd0b9325e3d73f5259/lib/gemstash/env.rb#L132
Not sure if this was an unintentional change here or if gemstash should be changed to stop doing this.
Simplest Possible Self-Contained Example Showing the Bug
Full Backtrace of Exception (if any)
No response
SQL Log (if any)
No response
Ruby Version
3.3.4
Sequel Version
5.83.0