https://bugs.documentfoundation.org/show_bug.cgi?id=161144
Bug ID: 161144 Summary: Confused columns with same name but in different tables Product: LibreOffice Version: unspecified Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: medium Component: Base Assignee: libreoffice-bugs@lists.freedesktop.org Reporter: hoss...@libreoffice.org This is a spin-off of the "tdf#67664 Query wizard in need of love" (problem #2). There are shortcomings in the Query Wizard implementation, and one of them is the confusion between columns that have the same name in different tables. Steps to Reproduce: To reproduce this problem, you have to create two tables: "Table1", with the field name "a" (also add a primary key) "Table2", with the field name "a" (also add a primary key) First open LibreOffice, then choose "Base Database" from the "start screen", and then select the defaults, and save the result as your desired name. Then, choose "Create Table in Design View...", and add a field name "a". Use "close" on the toolbar, save changes, and accept "Table1" as the name. When you get the warning about lack of primary key, accept the solution by pressing "Yes". Then do the same for creating a table named "Table2" with the same field name "a". After that, go to the "Queries" icon in the main Base page, and select "Use Wizard to Create Query...". In "1. Field selection", Add two 'a' fields from "Table1" and "Table 2" to the "Fields in the Query" using ">" button. In "2. Sorting order", pick "Table1.a" and "Table2.a" for "Sort by", and "Then by". Accept and move to the last page, and press "Finish". You will get this error message: The data content could not be loaded. at /home/buildslave/source/libo-core/connectivity/source/commontools/dbtools.cxx:746 firebird_sdbc error: *Dynamic SQL Error *SQL error code = -204 *Ambiguous field name between an alias and an alias in the select list with name *a caused by 'isc_dsql_prepare' at /home/buildslave/source/libo-core/connectivity/source/drivers/firebird/Util.cxx:69 If you try again and choose to "Modify Query" in the last page, "8. Overview", you will see overlaps. Also, in the overview page, you can see this, which shows the confusion: Sorting order: a (ASC), a (ASC) The goal here is to fix this issue by using the table name when using the query in Query Wizard, and distinguish the similar names from different tables. The problem is not be limited to "Sorting order". Therefore, any solution should take care of all the possible usages of the similar field names in pages from 1 to 8 of the query wizard, and test extensively to make sure that the issue is resolved by the fix. -- You are receiving this mail because: You are the assignee for the bug.