aviaryan / Clipjump

:clipboard: Clipboard Manager for Windows, built in AutoHotkey
http://clipjump.sourceforge.net/
384 stars 62 forks source link

SQLite class error #139

Open CollinChaffin opened 7 years ago

CollinChaffin commented 7 years ago

Issue

Cause

Fix

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