<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>146818</bug_id>
          
          <creation_ts>2007-06-15 12:16:25 +0000</creation_ts>
          <short_desc>Error when multiplying, dividing, subtracting or adding two Floating Point fields</short_desc>
          <delta_ts>2008-01-10 17:42:59 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>KEXI</product>
          <component>Queries</component>
          <version>1.1.3 (KOffice 1.6.3)</version>
          <rep_platform>Ubuntu</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>r.c.drew</reporter>
          <assigned_to name="Jarosław Staniek">staniek</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>531649</commentid>
    <comment_count>0</comment_count>
    <who name="">r.c.drew</who>
    <bug_when>2007-06-15 12:16:25 +0000</bug_when>
    <thetext>Version:           1.1.3 (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
OS:                Linux

In the following: FP = Floating Point, Int = Integer
If you set up a query to multiply FP x Int, result is FP.  This works fine.
However, the result for FP x Int gives a square with a question mark inside.
Whether the FP number is single or double precision, the same problem occurs.
This has been confirmed by Jarosław Staniek (current project maintainer) who asked me to file the bug.
The same problem exists when adding, subtracting or dividing two FP numbers.
Clearly, Kexi has great potential, and much great work has been done, but it is unusable as a database if any FP numbers are involved!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>531650</commentid>
    <comment_count>1</comment_count>
    <who name="">r.c.drew</who>
    <bug_when>2007-06-15 12:28:38 +0000</bug_when>
    <thetext>Sorry, I made a typo: I should have written &quot;However, the result for FP x FP gives a square with a question mark inside&quot;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>569832</commentid>
    <comment_count>2</comment_count>
    <who name="Jarosław Staniek">staniek</who>
    <bug_when>2008-01-10 17:41:01 +0000</bug_when>
    <thetext>SVN commit 759457 by staniek:

KexiDB

fix the bug #146818: handling expressions containing 
binary operators like *, /, -, + where both arguments are of 
floating-point type (with single or double precision). 
Previously the result was marked as boolean, now it is 
floating-point.

CCMAIL:146818-done@bugs.kde.org
CCMAIL:kexi@kde.org



 M  +2 -6      expression.cpp  


--- branches/koffice/1.6/koffice/kexi/kexidb/expression.cpp #759456:759457
@@ -400,14 +400,10 @@
 	if (ltInt &amp;&amp; rtInt)
 		return KexiDB::maximumForIntegerTypes(lt, rt);
 
-	if (Field::isFPNumericType(lt) &amp;&amp; rtInt)
+	if (Field::isFPNumericType(lt) &amp;&amp; (rtInt || lt==rt))
 		return lt;
-	if (Field::isFPNumericType(rt) &amp;&amp; ltInt)
+	if (Field::isFPNumericType(rt) &amp;&amp; (ltInt || lt==rt))
 		return rt;
-	if ((lt==Field::Double || lt==Field::Float) &amp;&amp; rtInt)
-		return lt;
-	if ((rt==Field::Double || rt==Field::Float) &amp;&amp; ltInt)
-		return rt;
 
 	return Field::Boolean;
 }
</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>