<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - Firebird: Alias in a query will give "CASE" as column name in a form, if a field with same name existed"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=133823">133823</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Firebird: Alias in a query will give "CASE" as column name in a form, if a field with same name existed
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.4.4.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Base
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>robert@familiegrosskopf.de
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="http://bugs.documentfoundation.org/attachment.cgi?id=161809" name="attach_161809" title="Test the two forms. Press the button: different column names will be shown with the same SQL-code.">attachment 161809</a> <a href="http://bugs.documentfoundation.org/attachment.cgi?id=161809&action=edit" title="Test the two forms. Press the button: different column names will be shown with the same SQL-code.">[details]</a></span>
Test the two forms. Press the button: different column names will be shown with
the same SQL-code.

Open the attached database.
Open the form "form_query" and press the button.
Column names of the query the form depends of are shown.
But there is one column "CASE", which isn't part of the query.

Now close the form and open the form with the same SQL code. The code is
direcly connected to the form, not through a query.
Press the button and you could see the column names. 
This column names are the same as shown in the query.

This is the query:
SELECT "ID", "forename", "sex" "s_short", CASE WHEN "sex" = 'm' THEN 'Mister'
ELSE 'Miss' END "sex" FROM "table1"

The bug only appears if there is a field, which is defined in the table with
the same name as another field gets for alias. Table contains "sex", which is
changed by alias to "s_short" and then another field appears with alias "sex".
The bug appears with queries, but not with SQL-code, which is set directly in
the form.

Might be related to
<a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Firebird: querys with column alias can not find with basic function findcolumn"
   href="show_bug.cgi?id=132924">https://bugs.documentfoundation.org/show_bug.cgi?id=132924</a></pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>