Bug 143510 mysql column alias problem
I was using the following select statement as my data source: select id_case, cases.id_state, states.state, cast(summary AS CHAR) as summary, cast(descr AS CHAR) as descr, start_date, cast(client_text AS CHAR) as client_text, group_elements.name, groups.name from states, cases LEFT OUTER JOIN group_elements ON id_analist = group_elements.id_ge LEFT OUTER JOIN groups ON cases.id_group = groups.id_group where states.id_state = cases.id_state when I came across this issue. In the preview (I'm not sure if the same happens after report generation), group_elements.name and groups.name values don't show up correctly. In fact, groups.name appears as "name_9" (which of course isn't a problem) but its values are the same as group_elements.name values. Using an alias for one of the columns solves this issue. (Obviously this might be an issue with the mysql driver, but I don't think that's the case)
data/org.eclipse.birt.report.data.adapter/src/org/eclipse/birt/report/data/adapter/impl/DataSetMetaDataHelper.java
import org.eclipse.birt.report.model.api.elements.DesignChoiceConstants;
import org.eclipse.birt.report.model.api.elements.structures.ResultSetColumn;
/**
 * One note is the relationship between resultSet, columnHints and
 * cachedMetaData. resultSet and columnHints are combined to be used as the
 * additional column definition based on the column metadata of data set.
 * cachedMetaData is retrieved from the data engine, and the time of its
 * generation is after the resultSet and columnHints is applied to the original
 * metadata. resultHint is processed before columnHints, and they corresponds to
 * the IColumnDefinition of data engine.
 * 
 * When refreshing the metadata of dataset handle, resultSet should not be added
 * into data set design since resultSet is based on old metadata, and then it is
 * no use for updated metadata. But it is a little different for script dataset.
 * Since the metadata of script dataset comes from defined resultSet, the
 * special case is resultSet needs to be added when it meets script data set.
 */
public class DataSetMetaDataHelper
{
	
	private DataEngine dataEngine;
	private IModelAdapter modelAdaptor;
	private ModuleHandle moduleHandle;
	/**
	 * 
	 * @param dataEngine
	 * @param modelAdaptor
	 * @param moduleHandle
	 */
	DataSetMetaDataHelper( DataEngine dataEngine, IModelAdapter modelAdaptor,