Closed ray1729 closed 12 years ago
Please include the generated SQL in your issue report
This is the generated SQL:
(SELECT DISTINCT gene.*,gene_stable_id.stable_id
FROM gene
JOIN gene_stable_id USING(gene_id)
JOIN seq_region ON (gene.seq_region_id = seq_region.seq_region_id)
JOIN coord_system ON ((coord_system.coord_system_id = seq_region.coord_system_id) AND (coord_system.species_id = 1))
JOIN object_xref ON ((object_xref.ensembl_id = gene.gene_id) AND (object_xref.ensembl_object_type = Gene))
JOIN xref ON (xref.xref_id = object_xref.xref_id)
JOIN external_synonym ON (external_synonym.xref_id = object_xref.xref_id)
WHERE (gene.is_current = 1) AND (external_synonym.synonym = Cbx1))
UNION
(SELECT DISTINCT gene.*,gene_stable_id.stable_id
FROM gene
JOIN gene_stable_id USING(gene_id)
JOIN seq_region ON (gene.seq_region_id = seq_region.seq_region_id)
JOIN coord_system ON ((coord_system.coord_system_id = seq_region.coord_system_id) AND (coord_system.species_id = 1))
JOIN object_xref ON ((object_xref.ensembl_id = gene.gene_id) AND (object_xref.ensembl_object_type = ?))
JOIN xref ON (xref.xref_id = object_xref.xref_id)
WHERE (gene.is_current = ?) AND ((xref.dbprimary_acc = ?) OR (xref.display_label = ?)))
Hi,
Just wondering if you had any insights into this problem, or if there's another forum where I might get some help?
Ray.
Hi,
Its a complex issue and Im struggeling to find out whats wrong with the generated SQL statement. I'll let you know once I know.
In the meantime you could try either posting on the Clojure Google Group or visit #clojureql on irc.freenode.net, but Im afraid that Im your best bet right now and unfortunately Im a bit busy :(
Lau
Hi Lau,
Thank you for looking into the problem. I can put this project on hold for a while - really it was just an excuse to play with clojureql, which looks like a really nice way to interact with relational databases. Do let me know if I can do anything to help, but I still consider myself a beginner so debugging such complex problems is probably beyond my reach.
Ray.
Hi Lau,
I'm facing a similar problem with the placeholders using union, refer to issue #93 with sql example. Is there a work around this bug?
Ariel
Duplicates of this bug are #91 and #93
Fixed in HEAD
I'm getting this exception when trying to execute a query against MySQL:
This is triggered by the query:
I'm not sure if this is a bug or due to my (mis)use of union - if the latter, please point me in the right direction. The complete code is here: https://github.com/ray1729/Bio-Ensembl/blob/master/src/ray1729/bio/ensembl/core.clj. It's querying a public database so you should be able to reproduce the problem.