Von: "Richard Hipp" <d...@sqlite.org> Gesendet: 30.08.2011 16:30:28 An: sqlite-users@sqlite.org Betreff: [sqlite] Bug in using overloaded functions for virtual tables?
>On Tue, Aug 30, 2011 at 10:01 AM, <sqlite-users-boun...@sqlite.org> wrote: > >> The attached message matched the sqlite-users mailing list's content >> filtering rules and was prevented from being forwarded on to the list >> membership. >> ---------- Forwarded message ---------- >> From: fbu...@web.de >> To: sqlite-users@sqlite.org >> Date: Tue, 30 Aug 2011 16:01:24 +0200 (CEST) >> Subject: Bug in using overloaded functions for virtual tables? >> >> SELECT DISTINCT offsets(pages) FROM pages; >> -or- >> SELECT offsets(pages),count(*) FROM pages GROUP BY 1 >> >> => error message: unable to use function offsets in the requested context >> >> Is this is a bug or a restriction, which is not documented? If this is a >> restriction it should be considered as a feature request to allow using >> virtual table functions in queries with the DISTINCT keyword or the GROUP BY >> clause. Otherwise the bug should be fixed :-) >> > >The offsets() function of FTS4 gives you the locations in each record of >where your matching search terms are located. But you didn't specify any >search terms - there is no MATCH operator in the WHERE clause. So what >where you hoping to get back with these queries? > >-- >D. Richard Hipp I had some troubles to send my mail to the list and somehow the first part of my mail got lost, when you inserted into the list, so here it is: >I have problems with using overloaded functions which are defined for virtual >tables in queries, which includes the DISTINCT keyword or the GROUP BY clause. > >Steps to reproduce (only an example) with SQLite 3.7.7 (FTS4 needs to be >enabled): > >CREATE VIRTUAL TABLE pages USING fts4(title, body); >INSERT INTO pages(docid, title, body) VALUES(53, 'Home Page', 'SQLite is a >software...'); >INSERT INTO pages(title, body) VALUES('Download', 'All SQLite source code...'); So, the problem is not related to using the offset() function of FTS4, it was only meant as an easy example to reproduce the problem, which I have, when I define a function for an own implementation of a virtual table by using sqlite3_overload_function and xFindFunction in the same way as offset() is implemented for FTS4. ___________________________________________________________ Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die Toolbar eingebaut! http://produkte.web.de/go/toolbar _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users