Bug 139383 Nest query with data set parameter binding will cause an error message
Description: Nest query with data set parameter binding will cause an error message. Steps to reproduce: 1.New a sampledb data source and dataset, and input select distinct CLASSICMODELS.CUSTOMERS.STATE from CLASSICMODELS.CUSTOMERS in the Query of dataset. 2.New another sampledb data source and dataset, and input select *from CLASSICMODELS.CUSTOMERS where CLASSICMODELS.CUSTOMERS.STATE=? in the Query of dataset. Go to the parameters pane and set a default value CA to the param1. 3. Drag the first dataset to the layout to get a 1*2 table.(refer to the attached design file) 4. Drag the second dataset to the detail row and get a table nest table(inner table have its binding) 5. Choose the inner table and go to the binding tab, click the button Dataset Parameter Binding 6. Set the param1 value: row._outer["STATE"] 7. Save and preview it Actual result: A error occurred: Error0 : data.engine.UnexpectedError ( 19 time(s) ) detail : org.eclipse.birt.data.engine.core.DataException: Data engine operation failed due to an unexpected exception. Error evaluating Javascript expression. Script engine error: TypeError: Cannot read property "STATE" from null Script source: source, line: 0, text:row._outer["STATE"] at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.evaluateInputParameterValue(PreparedOdaDSQuery.java:351) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.getMergedParameters(PreparedOdaDSQuery.java:309) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.populateOdiQuery(PreparedOdaDSQuery.java:216) at org.eclipse.birt.data.engine.impl.QueryExecutor.prepareExecution(QueryExecutor.java:213) at org.eclipse.birt.data.engine.impl.PreparedQuery.doPrepare(PreparedQuery.java:357) at org.eclipse.birt.data.engine.impl.PreparedDataSourceQuery.execute(PreparedDataSourceQuery.java:182) at org.eclipse.birt.report.engine.data.dte.DteDataEngine.doExecuteQuery(DteDataEngine.java:121) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:214) at org.eclipse.birt.report.engine.data.dte.AbstractDataEngine.execute(AbstractDataEngine.java:204) at org.eclipse.birt.report.engine.executor.QueryItemExecutor.openResultSet(QueryItemExecutor.java:62) at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:122) at org.eclipse.birt.report.engine.executor.ReportExecutorVisitor.visitTableItem(ReportExecutorVisitor.java:205) at org.eclipse.birt.report.engine.ir.TableItemDesign.accept(TableItemDesign.java:69) at org.eclipse.birt.report.engine.executor.TableItemExecutor.accessRow(TableItemExecutor.java:618) at org.eclipse.birt.report.engine.executor.TableItemExecutor.accessTableBand(TableItemExecutor.java:506) at org.eclipse.birt.report.engine.executor.TableItemExecutor.accessDetail(TableItemExecutor.java:418) at org.eclipse.birt.report.engine.executor.ListingElementExecutor.accessQuery(ListingElementExecutor.java:130) at org.eclipse.birt.report.engine.executor.TableItemExecutor.execute(TableItemExecutor.java:151) at org.eclipse.birt.report.engine.executor.ReportExecutorVisitor.visitTableItem(ReportExecutorVisitor.java:205) at org.eclipse.birt.report.engine.ir.TableItemDesign.accept(TableItemDesign.java:69) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:129) at org.eclipse.birt.report.engine.executor.ReportExecutor.execute(ReportExecutor.java:89) at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:171) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(Unknown Source) at org.eclipse.birt.report.service.actionhandler.BirtRunAndRenderActionHandler.__execute(Unknown Source) at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(Unknown Source) at org.eclipse.birt.report.presentation.aggregation.layout.EngineFragment.doService(Unknown Source) at org.eclipse.birt.report.presentation.aggregation.AbstractBaseFragment.service(Unknown Source) at org.eclipse.birt.report.servlet.ViewerServlet.__doGet(Unknown Source) at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doGet(Unknown Source) at javax.servlet.http.HttpServlet.service(HttpServlet.java:740) at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2422) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.eclipse.tomcat.internal.EclipseErrorReportValve.invoke(EclipseErrorReportValve.java:153) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174) at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643) at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480) at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995) at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:199) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) at java.lang.Thread.run(Unknown Source)Caused by: org.eclipse.birt.core.exception.CoreException: Error evaluating Javascript expression. Script engine error: TypeError: Cannot read property "STATE" from null Script source: source, line: 0, text:row._outer["STATE"] at org.eclipse.birt.core.script.JavascriptEvalUtil.wrapRhinoException(JavascriptEvalUtil.java:280) at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:104) at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.doEvaluateRawExpression(ExprEvaluateUtil.java:221) at org.eclipse.birt.data.engine.expression.ExprEvaluateUtil.evaluateRawExpression2(ExprEvaluateUtil.java:201) at org.eclipse.birt.data.engine.impl.ExecutorHelper.evaluate(ExecutorHelper.java:67) at org.eclipse.birt.data.engine.impl.PreparedOdaDSQuery$OdaDSQueryExecutor.evaluateInputParameterValue(PreparedOdaDSQuery.java:343) ... 65 moreCaused by: org.mozilla.javascript.EcmaError: TypeError: Cannot read property "STATE" from null at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3240) at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3230) at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3246) at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3265) at org.mozilla.javascript.ScriptRuntime.undefReadError(ScriptRuntime.java:3278) at org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:1281) at org.mozilla.javascript.gen.c44._c0(source:0) at org.mozilla.javascript.gen.c44.call(source) at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304) at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769) at org.mozilla.javascript.gen.c44.call(source) at org.mozilla.javascript.gen.c44.exec(source) at org.eclipse.birt.core.script.JavascriptEvalUtil.evaluateRawScript(JavascriptEvalUtil.java:97) ... 69 more
UI/org.eclipse.birt.report.designer.ui/src/org/eclipse/birt/report/designer/internal/ui/dialogs/ParameterBindingPage.java
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
/**
 * The Binding attribute page of DE element. Note: Binding Not support
 * multi-selection.
 */
public class ParameterBindingPage extends AttributePage
{
	private Label dataSetName;
	/**
	 * The Binding properties table.
	 */
	private Table table;
	/**
	 * The TableViewer of the table widget.
	 */
	private TableViewer tableViewer;
	/**
	 * The column list.
	 */
	private static final String[] columnNames = {
			Messages.getString( "BindingPage.TableColumn.Parameter" ), 
			Messages.getString( "BindingPage.TableColumn.DataType" ), 
			Messages.getString( "BindingPage.TableColumn.Value" ),}; 
	private static final String NONE = Messages.getString( "BindingPage.None" );