[Libreoffice-bugs] [Bug 118492] New: (Correct) SQL-Query (wrongly) returns 0 (null) Values in specific Column. DBMS: PostgreSQL

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sun Jul 1 18:31:15 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=118492

            Bug ID: 118492
           Summary: (Correct) SQL-Query (wrongly) returns 0 (null) Values
                    in specific Column. DBMS: PostgreSQL
           Product: LibreOffice
           Version: 6.0.3.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Base
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: randmusr0 at gmail.com

Description:
Context: I'm working on setting up an anamnesis database for a medical
institution. My test-database needs to display certain disorders/diseases in
one table and associated risk situations in another. 

Relevant Tables (if needed I can provide a graph of the database-design): 

- hämo_erkrankung: id(int), lokalisation(int), person(int), zeitpunkt(date)
[eng: time of occurence] 
FK: person -> person.id
lokalisation -> lokalisation.id
(one individual disease/disorder per row)

- situation: id(int), situation(varchar)
(one (risk-)situation per row)

- situation_p: id(int), hämo(int), situation(int)
FK: hämo -> hämo_erkrankung.id
situation -> situation.id
(n risk situations for one disease / disorder referenced by "hämo")

Problem: I wanted to create a Query displaying the actual situation associated
with a disease/disorder rather than the foreign key, using this SQL-Command: 

SELECT "SP"."id", "SP"."hämo", "S"."situation" 
FROM "situation_p" "SP", "situation" "S" 
WHERE "SP"."situation" = "S"."id"

The desired result table is returned in Postgres (using the Terminal). However,
in Base the "S"."situation" column returns '0' in every row instead of the
referenced Varchar-Value from the situation table.

Since the Query works for the DBMS I cannot see that there is anything I can do
to make it work in Base. Therefore this might be a Base issue. Please let me
know if you think there is anything I did wrong.

Steps to Reproduce:
1. Use PostgreSQL as the DBMS
2. Create the tables and relationships (s. Description-section), add Data
3. Create the Query and run it (s. Description-section)

Actual Results:
Result-table using Base (see Description-section for Query) 
[id, hämo, situation]
(1, 1, 0)
(2, 1, 0)
(3, 2, 0)
(4, 3, 0) 
(.......)

Expected Results:
Result-table directly using PostgreSQL 
[id, hämo, situation]
(1, 1, Körperliche Anstrengung)
(2, 1, Tamoxifen plus)
(3, 2, spontan)
(4, 3, Operation)
(.............)


Reproducible: Always


User Profile Reset: No



Additional Info:

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180701/610fb873/attachment.html>


More information about the Libreoffice-bugs mailing list