[Tracker] Parser stack overflow



Somewhere in my program I have a query like this:

    return Glib::ustring::compose(
        "SELECT ?camera ?exposure ?fn ?focal ?iso ?metering ?white"
        "WHERE {"
        "  ?photo nie:isStoredAs '%1' ."
        "  OPTIONAL { ?photo nmm:camera ?camera . }"
        "  OPTIONAL { ?photo nmm:exposureTime ?exposure . }"
        "  OPTIONAL { ?photo nmm:fnumber ?fn . }"
        "  OPTIONAL { ?photo nmm:focalLength ?focal . }"
        "  OPTIONAL { ?photo nmm:isoSpeed ?iso . }"
        "  OPTIONAL { ?photo nmm:meteringMode ?metering . }"
        "  OPTIONAL { ?photo nmm:whiteBalance ?white . }"
        "}",
        uri_);

This causing "parser stack overflow" to be reported in
~/.local/share/tracker/tracker-store.log:

24 Dec 2009, 21:53:47: Tracker-Critical **: Unable to prepare query
'SELECT "camera_u", CAST ("exposure_u" AS TEXT), CAST ("fn_u" AS
TEXT), CAST ("focal_u" AS TEXT), CAST ("iso_u" AS TEXT), (SELECT Uri
FROM "rdfs:Resource" WHERE ID = "metering_u"), (SELECT Uri FROM
"rdfs:Resource" WHERE ID = "white_u") FROM (SELECT * FROM (SELECT
t14_g."white_u", t13_g."photo_u", t13_g."metering_u", t13_g."iso_u",
t13_g."fn_u", t13_g."camera_u", t13_g."focal_u", t13_g."exposure_u"
FROM (SELECT * FROM (SELECT t12_g."metering_u", t11_g."photo_u",
t11_g."iso_u", t11_g."camera_u", t11_g."exposure_u", t11_g."focal_u",
t11_g."fn_u" FROM (SELECT * FROM (SELECT t10_g."iso_u",
t9_g."photo_u", t9_g."camera_u", t9_g."exposure_u", t9_g."focal_u",
t9_g."fn_u" FROM (SELECT * FROM (SELECT t8_g."focal_u",
t7_g."photo_u", t7_g."camera_u", t7_g."exposure_u", t7_g."fn_u" FROM
(SELECT * FROM (SELECT t6_g."fn_u", t5_g."photo_u", t5_g."camera_u",
t5_g."exposure_u" FROM (SELECT * FROM (SELECT t4_g."exposure_u",
t3_g."photo_u", t3_g."camera_u" FROM (SELECT * FROM (SELECT
t2_g."camera_u", t1_g."photo_u" FROM (SELECT
"nie:InformationElement1"."ID" AS "photo_u" FROM
"nie:InformationElement" AS "nie:InformationElement1" WHERE
"nie:InformationElement1"."nie:isStoredAs" = (SELECT ID FROM
"rdfs:Resource" WHERE Uri = ?)) AS t1_g LEFT JOIN (SELECT
"nmm:Photo2"."ID" AS "photo_u", "nmm:Photo2"."nmm:camera" AS
"camera_u" FROM "nmm:Photo" AS "nmm:Photo2" WHERE "camera_u" IS NOT
NULL) AS t2_g ON t1_g."photo_u" = t2_g."photo_u")) AS t3_g LEFT JOIN
(SELECT "nmm:Photo3"."ID" AS "photo_u",
"nmm:Photo3"."nmm:exposureTime" AS "exposure_u" FROM "nmm:Photo" AS
"nmm:Photo3" WHERE "exposure_u" IS NOT NULL) AS t4_g ON t3_g."photo_u"
= t4_g."photo_u")) AS t5_g LEFT JOIN (SELECT "nmm:Photo4"."ID" AS
"photo_u", "nmm:Photo4"."nmm:fnumber" AS "fn_u" FROM "nmm:Photo" AS
"nmm:Photo4" WHERE "fn_u" IS NOT NULL) AS t6_g ON t5_g."photo_u" =
t6_g."photo_u")) AS t7_g LEFT JOIN (SELECT "nmm:Photo5"."ID" AS
"photo_u", "nmm:Photo5"."nmm:focalLength" AS "focal_u" FROM
"nmm:Photo" AS "nmm:Photo5" WHERE "focal_u" IS NOT NULL) AS t8_g ON
t7_g."photo_u" = t8_g."photo_u")) AS t9_g LEFT JOIN (SELECT
"nmm:Photo6"."ID" AS "photo_u", "nmm:Photo6"."nmm:isoSpeed" AS "iso_u"
FROM "nmm:Photo" AS "nmm:Photo6" WHERE "iso_u" IS NOT NULL) AS t10_g
ON t9_g."photo_u" = t10_g."photo_u")) AS t11_g LEFT JOIN (SELECT
"nmm:Photo7"."ID" AS "photo_u", "nmm:Photo7"."nmm:meteringMode" AS
"metering_u" FROM "nmm:Photo" AS "nmm:Photo7" WHERE "metering_u" IS
NOT NULL) AS t12_g ON t11_g."photo_u" = t12_g."photo_u")) AS t13_g
LEFT JOIN (SELECT "rdfs:Resource_nao:hasTag8"."ID" AS "photo_u",
"rdfs:Resource_nao:hasTag8"."nao:hasTag" AS "white_u" FROM
"rdfs:Resource_nao:hasTag" AS "rdfs:Resource_nao:hasTag8") AS t14_g ON
t13_g."photo_u" = t14_g."photo_u"))': parser stack overflow

It is the last OPTIONAL clause that is causing the problem.

Cheers,
Debarshi
-- 
One reason that life is complex is that it has a real part and an
imaginary part.
    -- Andrew Koenig



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]