Bug 69554 - EDITING: Optionsfield in forms don't work with 1/0 connected to a boolean field, works only with true/false
Summary: EDITING: Optionsfield in forms don't work with 1/0 connected to a boolean fie...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.1.0.0.beta1
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2013-09-19 05:47 UTC by Robert Großkopf
Modified: 2015-12-15 11:03 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Database with two forms: One is connected to boolean field with 1/0, the other with true/false (20.72 KB, application/vnd.oasis.opendocument.base)
2013-09-19 05:47 UTC, Robert Großkopf
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Großkopf 2013-09-19 05:47:46 UTC
Created attachment 86119 [details]
Database with two forms: One is connected to boolean field with 1/0, the other with true/false

In a form an optionsfield is connected to a boolean field of a table. The attachment shows this boolean field as "Swimmer".
"Yes" is connected to '1', "No" is connected to '0'.
The values aren't shown any more since 4.1.0.0beta1.
Since this version you have to change the options to 'true' and 'false'.

If you start a query and want to select the "Swimmer", the following works:
SELECT "Name", "Swimmer" FROM "Table" WHERE "Swimmer" = 1
This works in the GUI and also, when the query is started in direct SQL-mode. So this is only a bug of the options-field.
Comment 1 Robert Großkopf 2013-09-19 05:54:05 UTC
This bug has been confirmed in the German OOo-Base-forum:
http://de.openoffice.info/viewtopic.php?f=8&t=62371&p=235530#p235516
Comment 2 Matthew Francis 2014-12-06 07:21:24 UTC
Results from bibisect-43all:
 a7e54955e9f49e8b59dfd8c4533785a680b1796c is the first bad commit
commit a7e54955e9f49e8b59dfd8c4533785a680b1796c
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Wed Oct 16 11:07:50 2013 +0000

    source-hash-5da10275a7475efdbfd9de14ea58cf8f4c6c1582
    
    commit 5da10275a7475efdbfd9de14ea58cf8f4c6c1582
    Author:     Stephan Bergmann <sbergman@redhat.com>
    AuthorDate: Fri Mar 1 17:09:45 2013 +0100
    Commit:     Stephan Bergmann <sbergman@redhat.com>
    CommitDate: Fri Mar 1 17:18:29 2013 +0100
    
        Related rhbz#915743: Abort UCB call from SvtMatchContext_Impl::Stop
    
        ...as otherwise the SvtMatchContext_Impl thread can continue to run for
        arbitrarily long, and the other thread calling Stop() and join() will block.
    
        However, especially the WebDAV UCP does not properly support aborting commands,
        see 260afe56fd6b2f34de8290f3cdb7d1df5b88f8a8 " neon commands cannot be aborted",
        so this is not yet enough to actually fix rhbz#915743 "thread deadlock/slow
        join in insert->hyperlink in impress."
    
        Change-Id: I0da899f824763e1b3d19bb5b38d906feb690b623

# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# bad: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect bad e02439a3d6297a1f5334fa558ddec5ef4212c574
# good: [8f4aeaad2f65d656328a451154142bb82efa4327] source-hash-1885266f274575327cdeee9852945a3e91f32f15
git bisect good 8f4aeaad2f65d656328a451154142bb82efa4327
# good: [9995fae0d8a24ce31bcb5e9cd0459b69cfbf7a02] source-hash-8600bc24bbc9029e92bea6102bff2921bc10b33e
git bisect good 9995fae0d8a24ce31bcb5e9cd0459b69cfbf7a02
# bad: [8ad82bc1416a07501651e8d96fe268e47d3931d3] source-hash-13821254f88d2c5488fba9fe6393dcf4ae810db4
git bisect bad 8ad82bc1416a07501651e8d96fe268e47d3931d3
# bad: [238338bc4111eb82429ea47384d4012bcd7cdc3e] source-hash-b6ba04639b9922f6717f79ac4be215e09691d7a9
git bisect bad 238338bc4111eb82429ea47384d4012bcd7cdc3e
# bad: [89dc8a802d1625e0efd88ba0fb720b22be87f3f0] source-hash-da03bb1ee6a69d2f4fef4c3ca0adc0ba9588bd19
git bisect bad 89dc8a802d1625e0efd88ba0fb720b22be87f3f0
# bad: [fe956dc63cc7ed1831f0e7e9e7253ea4d8c99549] source-hash-b15f095293c6127ecaef2f0fa3a1683e72392835
git bisect bad fe956dc63cc7ed1831f0e7e9e7253ea4d8c99549
# good: [cd762eb968ba8783f726b67d9d70b0a76f4eb55d] source-hash-c9562064740baed3a9978723c5fe77b44a13a7aa
git bisect good cd762eb968ba8783f726b67d9d70b0a76f4eb55d
# bad: [a7e54955e9f49e8b59dfd8c4533785a680b1796c] source-hash-5da10275a7475efdbfd9de14ea58cf8f4c6c1582
git bisect bad a7e54955e9f49e8b59dfd8c4533785a680b1796c
# good: [5e90d936616ff95724eaa3e3a0a7c7a9747e9b44] source-hash-ba446dd58a4ad324d242afcd5b28d3b4dff5a881
git bisect good 5e90d936616ff95724eaa3e3a0a7c7a9747e9b44
# first bad commit: [a7e54955e9f49e8b59dfd8c4533785a680b1796c] source-hash-5da10275a7475efdbfd9de14ea58cf8f4c6c1582
Comment 3 Alex Thurgood 2015-01-03 17:39:14 UTC
Adding self to CC if not already on
Comment 4 Matthew Francis 2015-01-09 13:02:47 UTC
The behaviour changed as of the below commit

Adding Cc: to d.ostrovsky@gmx.de and lionel@mamane.lu; Could you possibly have a look at this one - was the change in the behaviour of the attached database intended? Thanks


commit 2bd856e643ef526c1283475c19cd355f7ef840f4
Author: David Ostrovsky <david@ostrovsky.org>
Date:   Mon Feb 4 11:12:57 2013 +0100

    ORowSetValue: clean up sign/unsigned union member
    
    Also switch BOOLEAN constructor from sal_Bool to bool.
[...]
    For authorship/copyright purposes, this patch is a cooperation between
     Lionel Elie Mamane <lionel@mamane.lu>
    and
     David Ostrovsky <david@ostrovsky.org>
Comment 5 Lionel Elie Mamane 2015-01-09 15:32:26 UTC
(In reply to Matthew Francis from comment #4)
> The behaviour changed as of the below commit
> 
> was the change in the behaviour of the attached
> database intended? Thanks
> 
> 
> commit 2bd856e643ef526c1283475c19cd355f7ef840f4
> Author: David Ostrovsky <david@ostrovsky.org>
> Date:   Mon Feb 4 11:12:57 2013 +0100
> 
>     ORowSetValue: clean up sign/unsigned union member
>     
>     Also switch BOOLEAN constructor from sal_Bool to bool.
> [...]
>     For authorship/copyright purposes, this patch is a cooperation between
>      Lionel Elie Mamane <lionel@mamane.lu>
>     and
>      David Ostrovsky <david@ostrovsky.org>

The change of behaviour was not intended per se in this commit, but it was noticed (in the context of checkboxes, see https://wiki.documentfoundation.org/ReleaseNotes/4.2#Base ) and it was kept since it corresponds to the SQL-standard way: a boolean is either true or false, and has nothing to do with any integer values (although an *explicit* cast can be added)...

(In reply to robert from comment #0)
> If you start a query and want to select the "Swimmer", the following works:
> SELECT "Name", "Swimmer" FROM "Table" WHERE "Swimmer" = 1

This is a deviation from the standard (or let's say an extension) by HSQLDB and undoubtedly others. I very much prefer that LibreOffice not rely on it, and "in exchange" works with databases that adhere more strictly to the SQL standard (such as e.g. PostgreSQL). I'm sorry for the incompatible behaviour change, but it is going in the right direction.

You'll notice that even in 4.0, if you go to Tools / SQL, enable

  Show output of "select" statements

and then execute
  SELECT * FROM "Table"

the boolean field shows as "true" or "false", not as "1" or "0".
Comment 6 Robinson Tryon (qubit) 2015-12-15 11:03:16 UTC
Migrating Whiteboard tags to Keywords: (bibisected)
[NinjaEdit]