cubicweb #1368787 Database backend incoherency with boolean attributes [rejected]
I noted behaviour differences between postgresql/sqlite database backends. The following RQL will be correctly interpreted by postgres backend unlike sqlite one. PostgreSQL>>> rql('Any C WHERE C is Conference, C reg_open False') <resultset 'Any C WHERE C is Conference, C reg_open False' (4 rows): [869] (('Conference',)) [867] (('Conference',)) [3973] (('Conference',)) [868] (('Conference',))> >>> rql('Any C WHERE C is Conference, C reg_open "False"') <resultset 'Any C WHERE C is Conference, C reg_open "False"' (4 rows): [869] (('Conference',)) [867] (('Conference',)) [3973] (('Conference',)) [868] (('Conference',))> => last rql is accepted without complaint SQLite>>> self.execute('Any C WHERE C is Conference, C reg_open True') <resultset Any C WHERE C is Conference, C reg_open True (1 rows)> >>> self.execute('Any C WHERE C is Conference, C reg_open "True"') <empty resultset Any C WHERE C is Conference, C reg_open "True"> => last rql is accepted but return nothing ProblemWe don't want allow double quote form in the grammar for boolean field. Thus, we should raise an exception in these previous cases to avoid confusion. | |
priority | minor |
---|---|
type | bug |
done in | <not specified> |
load | 0.000 |
load left | 0.000 |
closed by | <not specified> |
Comments
-
2011/01/21 10:38, written by sthenault
add commentthe rql type resolve doesn't consider constant types by design, and imo we don't want to change this simply to catch such programmer error