Skip to content

Nested queries don't work #154

@mo-seph

Description

@mo-seph

Query: {"item":{"name":"stuff"},"typeof":"auction"}

Result - 500 internal server error

Trace:
root DEBUG 2014-05-01 15:04:25,432 ObjectStoreQuery init
root DEBUG 2014-05-01 15:04:25,432 ObjectStoreQuery to_sql, q: {u'item': {u'name': u'stuff'}, u'typeof': u'auction'}, predicate_filter: None
root DEBUG 2014-05-01 15:04:25,433 ObjectStoreQuery process_predicates: {u'item': {u'name': u'stuff'}, u'typeof': u'auction'}
root DEBUG 2014-05-01 15:04:25,433 ObjectStoreQuery process_predicates: {u'name': u'stuff'}
root DEBUG 2014-05-01 15:04:25,433 ObjectStoreQuery to_sql, sql: WITH theselect AS (((SELECT j_triples_2.subject_uuid FROM wb_latest_vers AS j_latest_2 JOIN wb_triples j_triples_2 ON j_triples_2.id_triple = j_latest_2.triple JOIN wb_strings j_predicate_2 ON j_predicate_2.uuid = j_triples_2.predicate_uuid JOIN wb_objects j_objects_2 ON j_objects_2.id_object = j_triples_2.object JOIN wb_strings j_object_2 ON j_object_2.uuid = j_objects_2.obj_value_uuid WHERE j_predicate_2.string = %s AND j_object_2.string = %s) INTERSECT (SELECT j_triples_3.subject_uuid FROM wb_latest_vers AS j_latest_3 JOIN wb_triples j_triples_3 ON j_triples_3.id_triple = j_latest_3.triple JOIN wb_strings j_predicate_3 ON j_predicate_3.uuid = j_triples_3.predicate_uuid JOIN wb_objects j_objects_3 ON j_objects_3.id_object = j_triples_3.object JOIN wb_strings j_object_3 ON j_object_3.uuid = j_objects_3.obj_value_uuid WHERE j_predicate_3.string = %s AND j_object_3.string = %s))) SELECT wb_latest_vers.triple_order, j_subject.string AS subject,
j_predicate.string AS predicate, j_object.string AS obj_value,
wb_objects.obj_type, wb_objects.obj_lang, wb_objects.obj_datatype,
j_subject.uuid AS subject_uuid, j_subject.chunk AS subject_chunk
FROM wb_latest_vers
JOIN wb_triples ON wb_triples.id_triple = wb_latest_vers.triple
JOIN wb_objects ON wb_objects.id_object = wb_triples.object
JOIN wb_strings j_subject ON j_subject.uuid = wb_triples.subject_uuid
JOIN wb_strings j_predicate ON j_predicate.uuid = wb_triples.predicate_uuid
JOIN wb_strings j_object ON j_object.uuid = wb_objects.obj_value_uuid
JOIN theselect ON theselect.subject_uuid = j_subject.uuid

      ORDER BY wb_latest_vers.triple_order, j_object.uuid, j_object.chunk;
    , params: [u'item', 'ALL(((SELECT j_triples_1.subject_uuid FROM wb_latest_vers AS j_latest_1  JOIN wb_triples j_triples_1 ON j_triples_1.id_triple = j_latest_1.triple JOIN wb_strings j_predicate_1 ON j_predicate_1.uuid = j_triples_1.predicate_uuid JOIN wb_objects j_objects_1 ON j_objects_1.id_object = j_triples_1.object JOIN wb_strings j_object_1 ON j_object_1.uuid = j_objects_1.obj_value_uuid WHERE j_predicate_1.string = %s AND j_object_1.string = %s)))', u'name', 'stuff', u'typeof', 'auction']

root DEBUG 2014-05-01 15:04:25,434 indx_pg2: returning existing pool for db: ix_indxtest, user: ix_indxtest_rw
root DEBUG 2014-05-01 15:04:25,434 Objectstore query, conn_cb
root DEBUG 2014-05-01 15:04:25,434 IndxConnectionPool runQuery, args: ('WITH theselect AS (((SELECT j_triples_2.subject_uuid FROM wb_latest_vers AS j_latest_2 JOIN wb_triples j_triples_2 ON j_triples_2.id_triple = j_latest_2.triple JOIN wb_strings j_predicate_2 ON j_predicate_2.uuid = j_triples_2.predicate_uuid JOIN wb_objects j_objects_2 ON j_objects_2.id_object = j_triples_2.object JOIN wb_strings j_object_2 ON j_object_2.uuid = j_objects_2.obj_value_uuid WHERE j_predicate_2.string = %s AND j_object_2.string = %s) INTERSECT (SELECT j_triples_3.subject_uuid FROM wb_latest_vers AS j_latest_3 JOIN wb_triples j_triples_3 ON j_triples_3.id_triple = j_latest_3.triple JOIN wb_strings j_predicate_3 ON j_predicate_3.uuid = j_triples_3.predicate_uuid JOIN wb_objects j_objects_3 ON j_objects_3.id_object = j_triples_3.object JOIN wb_strings j_object_3 ON j_object_3.uuid = j_objects_3.obj_value_uuid WHERE j_predicate_3.string = %s AND j_object_3.string = %s))) SELECT wb_latest_vers.triple_order, j_subject.string AS subject, \n j_predicate.string AS predicate, j_object.string AS obj_value, \n wb_objects.obj_type, wb_objects.obj_lang, wb_objects.obj_datatype, \n j_subject.uuid AS subject_uuid, j_subject.chunk AS subject_chunk\n FROM wb_latest_vers\n JOIN wb_triples ON wb_triples.id_triple = wb_latest_vers.triple\n JOIN wb_objects ON wb_objects.id_object = wb_triples.object\n JOIN wb_strings j_subject ON j_subject.uuid = wb_triples.subject_uuid\n JOIN wb_strings j_predicate ON j_predicate.uuid = wb_triples.predicate_uuid\n JOIN wb_strings j_object ON j_object.uuid = wb_objects.obj_value_uuid\n JOIN theselect ON theselect.subject_uuid = j_subject.uuid\n \n ORDER BY wb_latest_vers.triple_order, j_object.uuid, j_object.chunk;\n ', [u'item', 'ALL(((SELECT j_triples_1.subject_uuid FROM wb_latest_vers AS j_latest_1 JOIN wb_triples j_triples_1 ON j_triples_1.id_triple = j_latest_1.triple JOIN wb_strings j_predicate_1 ON j_predicate_1.uuid = j_triples_1.predicate_uuid JOIN wb_objects j_objects_1 ON j_objects_1.id_object = j_triples_1.object JOIN wb_strings j_object_1 ON j_object_1.uuid = j_objects_1.obj_value_uuid WHERE j_predicate_1.string = %s AND j_object_1.string = %s)))', u'name', 'stuff', u'typeof', 'auction']), kwargs: {}
CONN DEBUG 2014-05-01 15:04:25,443 REQ:4460953184 TOKEN:80ae0e82-d139-11e3-a23f-28cfe914080b BoxHandler Exception trying to add to query: not all arguments converted during string formatting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions