Page MenuHomePhabricator

ArticleFeedbackv5 query issue with SQLite
Closed, ResolvedPublic

Description

SQLite doesn't have boolean type, so the following query fails:

SELECT af_id,af_net_helpfulness,af_relevance_sort,rating.aa_response_boolean AS yes_no FROM aft_article_feedback LEFT JOIN aft_article_answer "rating" ON ((rating.aa_feedback_id = af_id) AND rating.aa_field_id IN ('-1','1','16') ) LEFT JOIN aft_article_answer "comment" ON ((comment.aa_feedback_id = af_id) AND comment.aa_field_id IN ('-1','2','17') ) INNER JOIN page ON ((page_id = af_page_id)) INNER JOIN watchlist ON (wl_user = '1' AND (wl_namespace = page_namespace) AND (wl_title = page_title)) WHERE (af_is_deleted IS FALSE) AND (af_oversight_count = 0) AND (af_is_hidden IS FALSE) AND af_form_id IN ('1','6') ORDER BY af_id DESC LIMIT 2

Function: ArticleFeedbackv5Fetch::run
Database error: "1: no such column: FALSE".


Version: unspecified
Severity: major

Details

Reference
bz43381

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:04 AM
bzimport added a project: ArticleFeedbackv5.
bzimport set Reference to bz43381.

Related URL: https://gerrit.wikimedia.org/r/64063 (Gerrit Change I63bc076651ca0f52d61fcac32cc6b3be48940632)

I had misinterpreted this report.
It is about the old schema. The problem was not about 'boolean' datatype being used in the creation of the array, which will be understood by SQLite (http://www.sqlite.org/datatype3.html#affinity)
The problem was that the queries used to use TRUE/FALSE keywords, which don't exist.

These are no longer present.

https://gerrit.wikimedia.org/r/64063 (Gerrit Change I63bc076651ca0f52d61fcac32cc6b3be48940632) | change ABANDONED [by Matthias Mullie]