Bug Report T1152531
Visible to All Users

End-User Report Designer for WPF - Invalid SQL query crashes the application

created 2 years ago

The application crashes when the user enters an invalid query and clicks the "OK" button if the "EnableCustomSql" parameter is used and "Allow Edit SQL" is enabled.

Steps to reproduce:
1 - Create a report file using a database.
2 - Open the "Manage Queries".
3 - Check the "Allow Edit SQL" parameter.
4 - Input an invalid SQL (e.g.: column name typo).
5 - Click on the "OK" button.

Our developers are investigating this issue.

Call Stack
System.AggregateException HResult=0x80131500 Message=One or more queries have failed to execute. Source=DevExpress.DataAccess.v22.2 StackTrace: at DevExpress.DataAccess.Sql.SqlDataSource.ThrowAggregateExceptionIfNeeded(Exception[] exceptions, String message) at DevExpress.DataAccess.Sql.SqlDataSource.RebuildResultSchemaCore(Predicate`1 confirmExecution, IEnumerable`1 parameters, IEnumerable`1 queries, IResultSchemaProvider resultSchemaProvider, CancellationToken cancellationToken) at DevExpress.DataAccess.Sql.SqlDataSource.RebuildResultSchema(Predicate`1 confirmExecution, IEnumerable`1 parameters, IEnumerable`1 queries) at DevExpress.DataAccess.Sql.SqlDataSource.RebuildResultSchema(Predicate`1 confirmExecution, IEnumerable`1 parameters) at DevExpress.DataAccess.Sql.SqlDataSource.RebuildResultSchema(IEnumerable`1 parameters) at DevExpress.DataAccess.Sql.SqlDataSource.RebuildResultSchema() at DevExpress.Xpf.Reports.UserDesigner.Editors.SqlQueryCollectionUITypeEditor.RebuildResultSchema(XtraReportDiagramItem reportModel, DataComponentBaseDiagramItem dataComponentItem) at DevExpress.Xpf.Reports.UserDesigner.Editors.QueryCollectionEditorBase.RebuildResultSchemaInternal(Tuple`2 rebuildSchemaState) at DevExpress.Xpf.Reports.UserDesigner.Editors.QueryCollectionEditorBase.<BeforeCommitAction>b__27_0(Tuple`2 redo) at DevExpress.Utils.Transaction.<>c__DisplayClass0_0`2.<DevExpress.Utils.ITransaction.Execute>b__0(TRedoState x) at DevExpress.Utils.UndoManagerBase.<>c__DisplayClass8_0`2.<CreateRedoAction>b__0() at DevExpress.Utils.UndoManagerBase.RedoAction.DevExpress.Utils.UndoManagerBase.IRedoAction.Redo() at DevExpress.Utils.Transaction.DevExpress.Utils.ITransaction.Execute[TRedoState,TUndoState](TRedoState redoState, Func`2 redo, Func`2 undo, Func`3 merge) at DevExpress.Xpf.Reports.UserDesigner.Editors.QueryCollectionEditorBase.BeforeCommitAction() at DevExpress.Xpf.Reports.UserDesigner.Editors.QueryCollectionEditorBase`2.BeforeCommitAction() at DevExpress.Xpf.Diagram.Native.CollectionEditorBase.<>c__DisplayClass90_0.<InitializeClosingEvent>b__0(Object s, CancelEventArgs e) at System.ComponentModel.CancelEventHandler.Invoke(Object sender, CancelEventArgs e) at System.Windows.Window.OnClosing(CancelEventArgs e) at DevExpress.Xpf.Core.DXWindow.OnClosing(CancelEventArgs e) at DevExpress.Xpf.Core.DXDialogWindow.OnClosing(CancelEventArgs e) at System.Windows.Window.WmClose() at System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.UnsafeSendMessage(IntPtr hWnd, WindowMessage msg, IntPtr wParam, IntPtr lParam) at System.Windows.Window.InternalClose(Boolean shutdown, Boolean ignoreCancel) at System.Windows.Window.Close() at System.Windows.Window.set_DialogResult(Nullable`1 value) at DevExpress.Xpf.Core.DXDialogWindow.CloseDialog(Nullable`1 result) at DevExpress.Xpf.Core.DXDialogWindow.CloseCore(UICommand command) at DevExpress.Xpf.Core.DXDialogWindow.OnUICommandExecuted(Object sender, EventArgs e) at DevExpress.Mvvm.UICommand.DevExpress.Mvvm.Native.IUICommand.RaiseExecuted() at DevExpress.Xpf.Core.DialogButton.UICommandWrapper.System.Windows.Input.ICommand.Execute(Object parameter) at MS.Internal.Commands.CommandHelpers.CriticalExecuteCommandSource(ICommandSource commandSource, Boolean userInitiated) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Window.ShowHelper(Object booleanBox) at System.Windows.Window.Show() at System.Windows.Window.ShowDialog() at DevExpress.Xpf.Core.DXDialogWindow.ShowDialogWindowCore() at DevExpress.Xpf.Core.DXDialogWindow.ShowDialogWindow() at DevExpress.Xpf.Core.DialogService.ShowDialog(IEnumerable`1 dialogCommands, String title, Object view) at DevExpress.Xpf.Core.DialogService.DevExpress.Mvvm.IDialogService.ShowDialog(IEnumerable`1 dialogCommands, String title, String documentType, Object viewModel, Object parameter, Object parentViewModel) at DevExpress.Xpf.Editors.DialogServiceEditorBehavior.<>c__DisplayClass12_0.<ProcessClickForFrameworkElementInternal>b__0(IDialogService service) at DevExpress.Mvvm.UI.Native.AssignableServiceHelper2`2.DoServiceAction(DependencyObject owner, TService service, Action`1 action) at DevExpress.Xpf.Editors.DialogServiceEditorBehavior.ProcessClickForFrameworkElementInternal(FrameworkElement owner, Object editValue) at DevExpress.Xpf.Editors.DialogServiceEditorBehaviorBase.<>c__DisplayClass20_0.<ProcessClickForFrameworkElement>b__0() at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler) at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at Report.App.Main() This exception was originally thrown at this call stack: System.Data.SQLite.SQLite3.Prepare(System.Data.SQLite.SQLiteConnection, string, System.Data.SQLite.SQLiteStatement, uint, ref string) System.Data.SQLite.SQLiteCommand.BuildNextCommand() System.Data.SQLite.SQLiteCommand.GetStatement(int) System.Data.SQLite.SQLiteDataReader.NextResult() System.Data.SQLite.SQLiteDataReader.SQLiteDataReader(System.Data.SQLite.SQLiteCommand, System.Data.CommandBehavior) System.Data.SQLite.SQLiteCommand.ExecuteReader(System.Data.CommandBehavior) System.Data.SQLite.SQLiteCommand.ExecuteDbDataReader(System.Data.CommandBehavior) System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(System.Data.CommandBehavior) DevExpress.DataAccess.Native.ColumnarDataLoaderHelper.ExecuteReader(System.Data.IDbCommand, System.Data.CommandBehavior, System.Threading.CancellationToken) DevExpress.DataAccess.Native.ColumnarDataLoaderHelper.InternalExecuteReader.AnonymousMethod__0() ... [Call Stack Truncated] Inner Exception 1: QueryExecutionException: Query Query failed to execute. Inner Exception 2: SqlExecutionException: Error trying to execute an SQL query 'select fgh from Orders'. Error: SQL logic error no such column: fgh Inner Exception 3: SQLiteException: SQL logic error no such column: fgh

Answers approved by DevExpress Support

created 2 years ago (modified 2 years ago)

We have addressed the issue described in this ticket and will include a fix in our next maintenance update. Should you need to apply our fix prior to official release, you can request a hotfix here.

Important Notes:

  • Hotfixes may be unavailable for Early Access/Beta builds or updates set for release within a week.
  • .NET only: in the NuGet Package Manager, use your personal NuGet feed and check the "Include prerelease" option to view the hotfix package in the "Updates" tab.
    Comments (3)

      Tested with version 22.2.6 and 23.1.2, this bug is not fixed.
      When I click the "OK" button with the wrong SQL, the application crashes with the same exception and does not show a dialog as when I click the "Preview Result" button.

        Aleksandr (DevExpress Support) 2 years ago

          Hello Rafael,

          You are correct. I reproduced the issue in v22.2.6 too. Please accept our apologies for that and thank you for helping us find this mistake.

          I forwarded this question to our developers for further investigation. We will update this thread as soon as we have any results.

          Regards,
          Aleksandr

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.