Apache OpenOffice (AOO) Bugzilla – Issue 97096
Alias names in MySQL queries ignored in Base unless function applied in SQL
Last modified: 2017-05-20 10:24:17 UTC
N.B. I have selected "none" for the subcomponent field of this issue because I do not know what the only other option "SRB", means. Link a MySQL database to OO Base using JDBC (Sun). Open a MySQL view (regarded as a table by Base): aliases are ignored unless a function is used in the SQL for that field. This prevents systematic naming of query outputs in the context of that query; e.g. may wish to have two "Name" fields from different tables and to disambiguate them using aliases. The aliases are always correctly shown in the "edit" view of the query in Base. They are only ignored when the query is executed and its output displayed. The behaviour is inherited when the db is used to do mail merge in OO Text. Tests performed: - queries dropped and recreated: no effect. - CONCAT function applied: alias no longer ignored by Base.
I have a problem which I suspect has the same root cause as this one. There was a tightening up of the mysql-connector behaviour as decribed here: http://bugs.mysql.com/bug.php?id=40256 In my case the result of a query including aliases malfunctioned, producing wrong data in the wrong columns. The work-around was to append: ?useOldAliasMetadataBehavior=true to the name of the database in the 'Database Properties' dialog. Please can you make the neccessary changes to the openoffice code.
I think from the reports we have at https://bugzilla.redhat.com/show_bug.cgi?id=523879 that we can "confirm" this at least.
fs->oj: Can reproduce this: Executing the query SELECT `ID` AS `ID_V`, `name` AS `name_V` FROM `testdb`.`names` gives me two columns named "ID" and "name", that is, the aliases are completely ignored. I don't think we should *always* append the "useOldAliasMetadataBehavior=true" parameter to the connection URL. Finally, the change in Connector/J was made for a reason ... I somehow doubt that the new behavior is "compliant", though https://bugzilla.redhat.com/show_bug.cgi?id=523879 cites a piece of documentation which claims this. Anyway, I think we should introduce another driver setting which controls this behavior, and is supported by our MySQL/JDBC driver only.
changing platform to "All"
Fixed in cws dba33d. No new setting necessary for MySQL
Please verify. Thanks.
verified in CWS dba33d find more information about this CWS, like when it is available in the master builds, in EIS, the Environment Information System: http://eis.services.openoffice.org/EIS2/cws.ShowCWS?Path=DEV300%2Fdba33d