From 832d95984c1eadc651a0b7ebd3c313401faa2296 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Mon, 21 Jan 2013 15:04:27 +0100 Subject: [PATCH] IFNULL-like mechanism now works on SQLite 2 too --- lib/core/agent.py | 5 +++-- xml/queries.xml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core/agent.py b/lib/core/agent.py index b8c060335..30df3ccb7 100644 --- a/lib/core/agent.py +++ b/lib/core/agent.py @@ -331,10 +331,11 @@ class Agent(object): rootQuery = queries[Backend.getIdentifiedDbms()] if field.startswith("(CASE") or field.startswith("(IIF") or\ - conf.noCast or Backend.isDbms(DBMS.SQLITE) and not isDBMSVersionAtLeast('3'): + conf.noCast: nulledCastedField = field else: - nulledCastedField = rootQuery.cast.query % field + if not (Backend.isDbms(DBMS.SQLITE) and not isDBMSVersionAtLeast('3')): + nulledCastedField = rootQuery.cast.query % field if Backend.getIdentifiedDbms() in (DBMS.ACCESS,): nulledCastedField = rootQuery.isnull.query % (nulledCastedField, nulledCastedField) else: diff --git a/xml/queries.xml b/xml/queries.xml index 254242824..cb8b8c431 100644 --- a/xml/queries.xml +++ b/xml/queries.xml @@ -296,7 +296,7 @@ - +