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
/*******************************************************************************
 * Copyright (c) 2004, 2005 Actuate Corporation.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http:www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *  Actuate Corporation  - initial API and implementation
 *******************************************************************************/
package org.eclipse.birt.report.data.adapter.impl;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.birt.core.data.DataType;
import org.eclipse.birt.core.exception.BirtException;
import org.eclipse.birt.data.engine.api.DataEngine;
import org.eclipse.birt.data.engine.api.IColumnDefinition;
import org.eclipse.birt.data.engine.api.IResultMetaData;
import org.eclipse.birt.data.engine.api.querydefn.QueryDefinition;
import org.eclipse.birt.report.data.adapter.api.AdapterException;
import org.eclipse.birt.report.data.adapter.api.IModelAdapter;
import org.eclipse.birt.report.data.adapter.i18n.ResourceConstants;
import org.eclipse.birt.report.model.api.CachedMetaDataHandle;
import org.eclipse.birt.report.model.api.DataSetHandle;
import org.eclipse.birt.report.model.api.JointDataSetHandle;
import org.eclipse.birt.report.model.api.ModuleHandle;
import org.eclipse.birt.report.model.api.ResultSetColumnHandle;
import org.eclipse.birt.report.model.api.ScriptDataSetHandle;
import org.eclipse.birt.report.model.api.StructureFactory;