#1 2016-01-26 16:03:19

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

ORM "like"operator doesn't work in latest version

looks like regression?

Before this works as expected:

/root/?sql=select+RowID,*+from+ZV+where+status=0+and%20ename+like+'Heinz%20Buder'

Now it comes exception in SynSQLite3.pas

in function TSQLRequest.Prepare(DB: TSQLite3DB; const SQL: RawUTF8): integer;


But without like it works:
/root/?sql=select+RowID,*+from+ZV+where+status=0+and%20ename+=+'Heinz%20Buder'

Offline

#2 2016-01-26 16:38:14

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: ORM "like"operator doesn't work in latest version

What is the exception error message?
What is the executed SQL statement?

I just run SynDBExplorer on the SQLite3 database generated by TestSQL3.exe and the following requests work as expected.

  select * from ADest where signature like '%1'
  select * from ADest where signature like '%URI%'

Offline

#3 2016-01-26 17:52:17

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: ORM "like"operator doesn't work in latest version

The error message is:
SQL logic error or missing database

The sql is:
select * from ZV where ename like '%Heinz%'

Last edited by danielkuettner (2016-01-26 17:57:22)

Offline

#4 2016-01-26 17:58:42

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: ORM "like"operator doesn't work in latest version

Does it work when you execute it with SynDBExplorer?

Offline

#5 2016-01-26 18:12:33

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: ORM "like"operator doesn't work in latest version

It's an external firebird table. ORM goes over virtual sqlite table. I've never used SynDBExplorer. Can I simulate this behavior with it?

If I declare the plain sql in line 1270 (function TSQLRestServerDB.GetMainList), this exception will be raised.

I come to vt_BestIndex, there the exit in line 1224 will called (invalid parameter) and the result stays on SQLITE_ERROR.

Before updating mORMot all works fine.

(I have XE6).

Offline

#6 2016-01-26 18:41:24

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: ORM "like"operator doesn't work in latest version

Perhaps my sqlite version is to old for mORMot? But I have obj files from svn from today?

With dynamic sqlite dll ((3.8.5) it works, but I used static. How can I check the version of statical sqlite?

Last edited by danielkuettner (2016-01-26 19:25:48)

Offline

#7 2016-01-26 19:30:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: ORM "like"operator doesn't work in latest version

Offline

#8 2016-01-27 09:52:15

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: ORM "like"operator doesn't work in latest version

SynSQLite3Static will now identify at application started if the linked sqlite3.obj is outdated, according to source code expectations:
- it would display a PITA error popup under Windows, and log in the exe folder for all platforms;
- it would help reduce unexpected compatibility issues, and ensure best performance and features set, as occurred with you.

See http://synopse.info/fossil/info/830afc50b7

Offline

#9 2016-01-27 10:03:02

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: ORM "like"operator doesn't work in latest version

Right now I've tested with sqlite3.dll 3.10.2: -->exception with like operator as stated in this post

With older sqlite3.dll 3.8.5 all works well.

Static linked version was too new, not outdated.

Offline

#10 2016-01-27 11:35:36

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: ORM "like"operator doesn't work in latest version

Perhaps it is something which changed at Sqlite3 level, and broke our code.
I guess this is a regression introduced by http://www.sqlite.org/src/info/277a5b4027d4c2ca in SQLite3 3.10.0.

Please try http://synopse.info/fossil/info/f1e05f9b88

Offline

#11 2016-01-27 17:30:47

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: ORM "like"operator doesn't work in latest version

I'll test it as soon as my internet connection (Telekom) is available again.
Thanks for your support.

Last edited by danielkuettner (2016-01-27 17:33:22)

Offline

#12 2016-01-27 18:04:41

danielkuettner
Member
From: Germany
Registered: 2014-08-06
Posts: 330

Re: ORM "like"operator doesn't work in latest version

With last fix all works!
Thanks a lot.

Offline

Board footer

Powered by FluxBB