Hi, all,

i have a library which makes very heavy use of sqlite3 and sqlite3_trace().
All is running fine and well, but recently, for one particular query, i
started noticing that it gets traced twice: once with its bound values
expanded and once in its raw form (without bound values), but the second
form gets traced with a '-- ' comment prefix which is nowhere to be found
in my code. For example, this is a single step over one query:

SQL TRACE #765: SELECT (max(event.mtime)-2440587.5)*86400 FROM mlink, event
WHERE mlink.mid=event.objid   AND mlink.fid=3202   AND +mlink.mid IN ok;
SQL TRACE #767: -- SELECT (max(event.mtime)-2440587.5)*86400 FROM mlink,
event WHERE mlink.mid=event.objid   AND mlink.fid=?   AND +mlink.mid IN ok;


Notice that the second copy has a '-- ' prefix and 'mlink.fid=?' instead of
'mlink.fid=3202'.

i have not seen this tracing duplication happening for any other query, and
several of them use bound parameters (so that is not the trigger).

Using sqlite3 amalgamation:

2014-01-31 11:50:20 21ce9e3a53aed62fbe075b0dbed9faa00218aadc


This is not a problem/bug, per se, just a bit curious and i'd like to
understand why it happens for this particular query and not for any of the
(very many) others.

The code which triggers this case is here:

http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/artifact/8654ca39c00836eb4099462bb1deceafc52b74f3?ln=1060-1097

note that there's a lot of abstraction happening there (the sqlite3 APIs
are not seen directly), but there's nothing magical happening there which
can account for the "--" duplicates.

:-?

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to