Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLite class error #139

Open
CollinChaffin opened this issue Apr 9, 2017 · 0 comments
Open

SQLite class error #139

CollinChaffin opened this issue Apr 9, 2017 · 0 comments

Comments

@CollinChaffin
Copy link

Issue

  • Any upgrade to SQLite engine fails because of an error in the version check routine

Cause

  • Class SQLiteDB.ahk (line 286):
If (SubStr(RegExReplace(This.Base.Version, "\."), 1, 2) < This.Base._MinVersion) {  ...DIE  }

Fix

  • Correct the test to allow for double-digit minor versions

Line 286 test converts This.Base (which is this string "3.11") removing the periods with regex (which is now this string "311") and the error is it then applies a substring (with ",1,2"). The number 2 is the key in the end that last conversion turns the base version string into ("31"). When it was v3.6, converting to "36" or "37" was fine but no longer applies. Also, the reason in my debugging below the 2nd msgbox is correct is, it simply echo's out the entire unconverted This.Base before the truncation.

For those wanting to apply the fix themselves, change line 286 to this:

 If (SubStr(RegExReplace(This.Base.Version, "\."), 1, 3) < This.Base._MinVersion) {

And you will be able to upgrade your SQLite3.dll to the latest version. As development continues, this will become critical to take advantage of newer SQLite3 features/optimizations.

Background / Additional Details

I did see the request for someone to transition future development of clipjuimp, and as single dad of two babies time is somewhat of a comoddity right now, but as much as I love ClipJump I'm considering throwing my hat into the ring.

With that said, regardless, I've already been doing some unofficial work just to work on some of these open SQLite issues (I have another open for some time that hasn't gotten any traction), and just came across this new issue.

My thought was that code check must not be taking into account double-digits because it was distributed with 3.9.2 and as shown above I was correct. It couldn't have been anything but an oversight since at the time of distribution, it was about to roll to 3.10 anyway (which is obviously now has).

Additional Testing

The first double-digit version I had handy to test with was 3.11. Drop in a later version of SQLite3.dll and execute to receive the above error.

I then added a quick code test above it to give me a debug output msgbox of what that regex replace comes up with on line 288, I insert:

MsgBox, 16, SQLite ERROR, % "Regex replace = " (SubStr(RegExReplace(This.Base.Version, "\."), 1, 2))

And I received back:
http://i.imgur.com/d4KCULU.png

Followed by the built-in error (note this DOES not convert the version number incorrectly):
http://i.imgur.com/Tztb2bp.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant