Project: Birt
Bug 136801 Chart bind joint data set, data type change incorrectly.
Reported: 2006-04-14 02:41:35 | Status: closed fixed

Chart bind joint data set, data type change incorrectly. Steps: Data source: sample DB Data set1: select * from customers Data set2: select * from employees Data set3: left join: data set1 and data set2 1.Create a chart 2.Open chart builder, go to "Select Data" tab, select Use data set: data set3 Actual Results: 1.NPE will thrown out at: org.eclipse.birt.chart.reportitem.ui.ReportDataServiceProvider.getPreviewRowData(ReportDataServiceProvider.java:257) org.eclipse.birt.chart.reportitem.ui.ReportDataServiceProvider.getPreviewData(ReportDataServiceProvider.java:150) org.eclipse.birt.chart.ui.swt.wizard.TaskSelectData.switchDataTable(TaskSelectData.java:432) org.eclipse.birt.chart.ui.swt.wizard.TaskSelectData.switchDataSet(TaskSelectData.java:511) org.eclipse.birt.chart.ui.swt.wizard.TaskSelectData.widgetSelected(TaskSelectData.java:600) org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase.open(WizardBase.java:203) org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.open(ChartWizard.java:181) org.eclipse.birt.chart.reportitem.ui.ChartReportItemBuilderImpl.open(ChartReportItemBuilderImpl.java:210) org.eclipse.birt.report.designer.internal.ui.editors.schematic.extensions.ExtendedElementToolExtends.preHandleMouseUp(ExtendedElementToolExtends.java:55) org.eclipse.birt.report.designer.internal.ui.editors.schematic.tools.ReportCreationTool.performCreation(ReportCreationTool.java:85) org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178) org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1053) org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:259) org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374) org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:538) org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:324) org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) org.eclipse.core.launcher.Main.basicRun(Main.java:280) org.eclipse.core.launcher.Main.run(Main.java:977) org.eclipse.core.launcher.Main.main(Main.java:952) Caused By:The data type of script expression result is org.eclipse.birt.core.data.DataType$AnyType, but one of its value is "null", which cannot be converted to org.eclipse.birt.core.data.DataType$AnyType. org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.getSortedResultIterator(PreparedJointDataSourceQuery.java:311) org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.initialize(PreparedJointDataSourceQuery.java:107) org.eclipse.birt.data.engine.impl.PreparedJointDataSourceQuery.<init>(PreparedJointDataSourceQuery.java:84) org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.newInstance(PreparedDataSourceQuery.java:89) org.eclipse.birt.data.engine.impl.DataEngineImpl.prepare(DataEngineImpl.java:390) org.eclipse.birt.data.engine.impl.DataEngineImpl.prepare(DataEngineImpl.java:357) org.eclipse.birt.chart.reportitem.ui.ChartDataSetManager.getCacheResult(ChartDataSetManager.java:244) org.eclipse.birt.chart.reportitem.ui.ReportDataServiceProvider.getPreviewRowData(ReportDataServiceProvider.java:215) org.eclipse.birt.chart.reportitem.ui.ReportDataServiceProvider.getPreviewData(ReportDataServiceProvider.java:150) org.eclipse.birt.chart.ui.swt.wizard.TaskSelectData.switchDataTable(TaskSelectData.java:432) org.eclipse.birt.chart.ui.swt.wizard.TaskSelectData.switchDataSet(TaskSelectData.java:511) org.eclipse.birt.chart.ui.swt.wizard.TaskSelectData.widgetSelected(TaskSelectData.java:600) org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) org.eclipse.birt.core.ui.frameworks.taskwizard.WizardBase.open(WizardBase.java:203) org.eclipse.birt.chart.ui.swt.wizard.ChartWizard.open(ChartWizard.java:181) org.eclipse.birt.chart.reportitem.ui.ChartReportItemBuilderImpl.open(ChartReportItemBuilderImpl.java:210) org.eclipse.birt.report.designer.internal.ui.editors.schematic.extensions.ExtendedElementToolExtends.preHandleMouseUp(ExtendedElementToolExtends.java:55) org.eclipse.birt.report.designer.internal.ui.editors.schematic.tools.ReportCreationTool.performCreation(ReportCreationTool.java:85) org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178) org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1053) org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:259) org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseReleased(DomainEventDispatcher.java:374) org.eclipse.draw2d.LightweightSystem$EventHandler.mouseUp(LightweightSystem.java:538) org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:137) org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:925) org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3346) org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2966) org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1914) org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1878) org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:419) org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:95) org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:169) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:324) org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) org.eclipse.core.launcher.Main.basicRun(Main.java:280) org.eclipse.core.launcher.Main.run(Main.java:977) org.eclipse.core.launcher.Main.main(Main.java:952) Expected Results: 1.Can work well.

Files changed in fix:
data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/executor/DataSetCacheManager.java data/org.eclipse.birt.data/src/org/eclipse/birt/data/engine/impl/PreparedJointDataSourceQuery.java