Unexpected consequence of syntax error

Started by sybersitizen, April 20, 2025, 07:43:30 PM

Previous topic - Next topic

sybersitizen

I have on a few occasions accidentally entered illegal syntax in the Search box. Sometimes (but apparently not always?) that causes IMatch to immediately report Severe Database Problems. After running a diagnosis twice, IMatch then reports that things are okay.

The latest example of this occurred when I searched my entire database for 'car NOT cartoon' as a test rather than the correct 'car AND NOT cartoon'.

I can of course avoid the issue by not making such mistakes, but I wonder if this is something that could happen to others who accidentally enter bad syntax.

Below are just the last handful of entries in the log, which I saved right after seeing the warning:

04.20 10:22:47+    0 [043C] 05  I>     Adding dictionary 'C:\ProgramData\photools.com\IMatch6\dictionaries\en_US.dic'
04.20 10:22:47+    0 [043C] 05  M>  <  0 PTHunspell::ParseDictionaryFolder
04.20 10:25:22+154797 [28A4] 00  E> 'near "(": syntax error' [100] for: SELECT DISTINCT c.oid, group_concat(c.tdata,' ') as gval FROM 'scopefiles.tag_cache' c INNER JOIN md_tag t ON t.oid = c.tag_oid   GROUP BY c.oid HAVING ((TRIMDC(gval) LIKE '%car%' ESCAPE '~') NOT (TRIMDC(gval) LIKE '%cartoon%' ESCAPE '~'))   'V:\develop\IMatch5\src\imsq\IMSQLite.cpp(1328)'
04.20 10:25:22+    0 [28A4] 00  E> Critical database error: 4 syntax error' [100]  'V:\develop\IMatch5\src\imsq\IMSQLite.cpp(3906)'
04.20 10:25:22+   15 [28A4] 01  W> 'near "(": syntax error' [21]  'V:\develop\IMatch5\src\imsq\IMSQLite.cpp(3485)'
04.20 10:25:22+    0 [28A4] 01  W> SELECT DISTINCT c.oid, group_concat(c.tdata,' ') as gval FROM 'scopefiles.tag_cache' c INNER JOIN md_tag t ON t.oid = c.tag_oid   GROUP BY c.oid HAVING ((TRIMDC(gval) LIKE '%car%' ESCAPE '~') NOT (TRIMDC(gval) LIKE '%cartoon%' ESCAPE '~'))   'V:\develop\IMatch5\src\imsq\IMSQLite.cpp(3486)'
04.20 10:25:22+    0 [28A4] 02  I> FWFind: 15ms for 0 results.
04.20 10:25:26+ 3954 [09C0] 00  E> <<ENGINE WARNING/PANIC>>: major:80 minor:1 d1:0 d2:0 s1:'' s2:''  'V:\develop\IMatch5\src\IMEngine\IMEngine5.cpp(1455)'
04.20 10:25:26+    0 [09C0] 00  E> The database file has been physically damaged. Replace from backup immediately.  'V:\develop\IMatch5\src\IMEngine\IMEngine5.cpp(1456)'



Mario

Probably just a database error message which accidentally gets promoted to critical. I'll have a look.

Mario

This was caused by an incorrect comparison of the error message returned by the database system.
I have fixed this for the next release.

Running a database diagnosis fixes the non-existing problem.

sybersitizen

Quote from: Mario on April 21, 2025, 09:50:33 AMThis was caused by an incorrect comparison of the error message returned by the database system.
I have fixed this for the next release.

Great, I assumed it should not be causing any real damage.

QuoteRunning a database diagnosis fixes the non-existing problem.

Yep, that's what I've been doing to fix it.