Apache OpenOffice (AOO) Bugzilla – Issue 19884
mysql column name alias and filter trouble
Last modified: 2006-05-31 14:29:06 UTC
Hi, I have a problem with filtering a data-source. I am using the column alias for all record fields. (SELECT COLNAME AS ALIAS_COLNAME)when i want to set some filter rules, e.g. zip>=97000 AND zip<98000 it doesn't work. The filter probably creates a new SELECT-statement and adapts the WHERE clause, since an error pops up which reads: "unknown column 'ALIAS_COLNAME'" I am using mysql-connector-java-3.0.8-stable-bin in the programm\classes directory.(although it seems to be a plain name mapping problem, since sorting by name or autofilter works perfectly) Mirko Schmitt
correcting sub component (see http://www.openoffice.org/issues/describecomponents.cgi?component=Database%20access, please), and default owner
Hi Mirko, First a (just for info) a part from the mysql documentation. >>>>>><<<<<< A.5.4 Problems with alias You can use an alias to refer to a column in the GROUP BY, ORDER BY, or in the HAVING part. Aliases can also be used to give columns better names: SELECT SQRT(a*b) as rt FROM table_name GROUP BY rt HAVING rt > 0; SELECT id,COUNT(*) AS cnt FROM table_name GROUP BY id HAVING cnt > 0; SELECT id AS "Customer identity" FROM table_name; Note that standard SQL doesn't allow you to refer to an alias in a WHERE clause. This is because when the WHERE code is executed the column value may not yet be determined. For example, the following query is illegal: SELECT id,COUNT(*) AS cnt FROM table_name WHERE cnt > 0 GROUP BY id; The WHERE statement is executed to determine which rows should be included in the GROUP BY part while HAVING is used to decide which rows from the result set should be used. >>>>>><<<<<< However there is a problem with the filter because it use the where clause with the alias name. So I send it to the right developer, set the target and set it to new. Bye Marc
.
fixed in cws oj08
change subcomponent to 'none'
not fixed in OJ08
reassign to OJ
Back to you. You found just another bug. :-)
set to fixed
verify in CWS oj08 This 'filter' works now, however there is still the other bug for the sort trouble.
the new sort issue is issue 26031
Hi, fixed in current developer build -> close. The current developer build can be found at http://download.openoffice.org/680/index.html Feel free to reopen if this issue is not fixed in the developer build. Bye Marc