Recent

Author Topic: SQLite3 FS4 recently started throwing error  (Read 2980 times)

KarenT

  • Full Member
  • ***
  • Posts: 120
SQLite3 FS4 recently started throwing error
« on: August 11, 2018, 11:55:59 pm »
Ubuntu 16.04, Lazarus 1.8.2, SQLite 3.11 (everything up to date)

Hi All,
This text search used to work just fine until about a month back and only now do I have some spare time to figure it out.

I mostly get "error database table is locked" and have checked the SQLite pages and the two reasons they give for this crash do not apply. I included "dm.sqlFind.Closed"  before the call but it made no difference.

I sometimes get an error "vtable constructor failed: tFind" which I think is the real underlying issue as when stepping through, it crashes at the ExecSQL line.

Any thoughts? I am using the following code

Code: Pascal  [Select][+][-]
  1. const fldsEmails = ' fldActive, fldFrom, fldTo ';
  2.  
  3. sqlStr:='CREATE VIRTUAL TABLE IF NOT EXISTS tFind USING FTS4('+fldsEmails+');';
  4. dm.sqlFind.SQL.Text:=sqlStr;
  5. dm.sqlFind.ExecSQL;
  6.  

Thaddy

  • Hero Member
  • *****
  • Posts: 14201
  • Probably until I exterminate Putin.
Re: SQLite3 FS4 recently started throwing error
« Reply #1 on: August 12, 2018, 07:37:22 am »
What is your SQLite version? Is it equal or higher than 3.7.15? Are you using any concurrency? Or a shared cache?
There was a known bug in SQlite prior to 3.7.15 that causes this, but that was fixed almost 6 years ago.
Specialize a type, not a var.

KarenT

  • Full Member
  • ***
  • Posts: 120
Re: SQLite3 FS4 recently started throwing error
« Reply #2 on: August 12, 2018, 05:25:49 pm »
What is your SQLite version? Is it equal or higher than 3.7.15?
Are you using any concurrency?
Or a shared cache?
There was a known bug in SQlite prior to 3.7.15 that causes this, but that was fixed almost 6 years ago.

$ sqlite3 --version
$ 3.11.0 2016-02-15 17:29:24
Nope.
Nope.

Other than Ubuntu updates and upgrades, nothing has changed and no matter what I try I cannot get it to work again. It started throwing the error on a program that was compiled probably 8-months before starting to toss this error. So it is not a recent change I might have made that causes the issue.

According to everything I have found so far, "update" and "upgrade" should be keeping the SQLite version up to to date on Ubuntu, but in Terminal I get
$ sqlite3 --version
$ 3.11.0 2016-02-15 17:29:24

And, the SQLite website is showing
  "SQLite Release 3.24.0 On 2018-06-04"

What do I need to do to get the latest version on
Ubuntu
Lazarus
FPC
SQLDBLaz?

Thanks


 

TinyPortal © 2005-2018