Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Attached patch fixes fdo#45453, which breaks datasheet display of all
queries/tables (with more than twice the number of rows than fit on
screen), if the database system does not properly support boolean
types.

The original bug report is about Firebird SQL.

Please apply to libreoffice-3-5.

I suppose all hope is lost for 3.5.0...


Thanks!

-- 
Lionel
From f96a392d2ee541cbaac6517b1e4f75a49f9f49f2 Mon Sep 17 00:00:00 2001
From: Lionel Elie Mamane <lionel@mamane.lu>
Date: Tue, 31 Jan 2012 21:32:55 +0100
Subject: [PATCH] fdo#45453: use integers rather than booleans

for always-true and always-false tests.
Some databases have poor or no support for booleans.
---
 dbaccess/source/core/api/KeySet.cxx |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index a7d9abe..1903110 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -228,8 +228,8 @@ namespace
     void appendOneKeyColumnClause( const ::rtl::OUString &tblName, const ::rtl::OUString &colName, 
::rtl::OUStringBuffer &o_buf )
     {
         static ::rtl::OUString s_sDot(RTL_CONSTASCII_USTRINGPARAM("."));
-        static ::rtl::OUString s_sParam0(RTL_CONSTASCII_USTRINGPARAM(" ( TRUE = ? AND "));
-        static ::rtl::OUString s_sParam1(RTL_CONSTASCII_USTRINGPARAM(" = ? OR TRUE = ? AND "));
+        static ::rtl::OUString s_sParam0(RTL_CONSTASCII_USTRINGPARAM(" ( 1 = ? AND "));
+        static ::rtl::OUString s_sParam1(RTL_CONSTASCII_USTRINGPARAM(" = ? OR 1 = ? AND "));
         static ::rtl::OUString s_sParam2(RTL_CONSTASCII_USTRINGPARAM(" IS NULL ) "));
         o_buf.append(s_sParam0);
         o_buf.append(tblName);
@@ -247,16 +247,16 @@ void OKeySet::setOneKeyColumnParameter( sal_Int32 &nPos, const Reference< 
XParam
 {
     if ( _rValue.isNull() )
     {
-        _xParameter->setBoolean( nPos++, false );
+        _xParameter->setByte( nPos++, 0 );
         // We do the full call so that the right sqlType is passed to setNull
         setParameter( nPos++, _xParameter, _rValue, _nType, _nScale );
-        _xParameter->setBoolean( nPos++, true );
+        _xParameter->setByte( nPos++, 1 );
     }
     else
     {
-        _xParameter->setBoolean( nPos++, true );
+        _xParameter->setByte( nPos++, 1 );
         setParameter( nPos++, _xParameter, _rValue, _nType, _nScale );
-        _xParameter->setBoolean( nPos++, false );
+        _xParameter->setByte( nPos++, 0 );
     }
 }
 
-- 
1.7.7.3


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.