Issue 97096 - Alias names in MySQL queries ignored in Base unless function applied in SQL
Summary: Alias names in MySQL queries ignored in Base unless function applied in SQL
Alias: None
Product: Base
Classification: Application
Component: code (show other issues)
Version: OOO300m9
Hardware: PC All
: P3 Trivial with 2 votes (vote)
Target Milestone: OOo 3.3
Assignee: marc.neumann
QA Contact: issues@dba
Depends on:
Blocks: 97765
  Show dependency tree
Reported: 2008-12-10 12:54 UTC by atpat
Modified: 2017-05-20 10:24 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Note You need to log in before you can comment on or make changes to this issue.
Description atpat 2008-12-10 12:54:38 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.
Comment 1 brh 2009-01-12 10:51:07 UTC
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:

In my case the result of a query including aliases malfunctioned, producing wrong data in the wrong 

The work-around was to append:


to the name of the database in the 'Database Properties' dialog.

Please can you make the neccessary changes to the openoffice code.
Comment 2 caolanm 2009-09-18 20:26:17 UTC
I think from the reports we have at that we can "confirm" this at
Comment 3 Frank Schönheit 2009-09-30 13:11:33 UTC
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

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 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.
Comment 4 Frank Schönheit 2009-09-30 13:12:22 UTC
changing platform to "All"
Comment 5 ocke.janssen 2009-11-18 12:09:31 UTC
Fixed in cws dba33d.

No new setting necessary for MySQL
Comment 6 ocke.janssen 2009-12-18 09:17:29 UTC
Please verify. Thanks.
Comment 7 marc.neumann 2010-01-14 07:43:42 UTC
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: