Bug #107983 MySQL Workbench crashes on 8.0.29 when running full database search
Submitted: 26 Jul 2022 13:53 Modified: 5 Aug 2022 8:51
Reporter: Max asd Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Workbench Severity:S1 (Critical)
Version:8.0.30.CE,8.0.29,8.0.28,8.0.27 OS:MacOS (macOS 12.x Monterey x86_64)
Assigned to: CPU Architecture:Any
Tags: WBBugReporter

[26 Jul 2022 13:53] Max asd
Description:
When running full database search (MySQL 8.0.29) in workbench, it almost immediately crashes with the following error in the logs (no error or warning message in the UI):

17:10:58 [ERR][ GRTDispatcher]: exception in grt execute_task, continuing: Exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘rows LIKE ‘%test%’ , rows, ‘’) AS rows FROM WHERE create’ at line 1
17:10:58 [ERR][ GRTDispatcher]: worker: task ‘Search’ has failed with error:.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘rows LIKE ‘%test%’ , rows, ‘’) AS rows FROM

How to repeat:
Select DB schema on the left, then click "Search table data for text..." button and then click "Start Search"

Suggested fix:
- Don't crash on exception when the query is incorrect?
- Fix the query so that it is correct?
[27 Jul 2022 12:00] MySQL Verification Team
Hello Max,

Thank you for the bug report.
I've tried to reproduce your issue on a Mac with workbench 8.0.29 but not seeing any issues at my end.
Discussed internally with the WB developers and confirmed that it is not seen.
If you can provide more information, feel free to add it to this bug and change the status back to 'Open'.

Thank you for your interest in MySQL.

Regards,
Ashwini Patil
[27 Jul 2022 13:03] Max asd
I narrowed the issue down to one table, hold on
[27 Jul 2022 13:23] Max asd
The following creates a reliable crash:

1. docker run --rm -it -e MYSQL_ROOT_PASSWORD=my-secret-pw -e MYSQL_DATABASE=test_db -p 3307:3306  percona:8

2. Open test_db and run these:

DROP TABLE IF EXISTS `test_table_1`;
CREATE TABLE `test_table_1` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `create_user_id` char(8) DEFAULT NULL,
  `create_date` datetime DEFAULT NULL,
  `change_user_id` char(8) DEFAULT NULL,
  `change_date` datetime DEFAULT NULL,
  `delete_user_id` char(8) DEFAULT NULL,
  `delete_date` datetime DEFAULT NULL,
  `client_id` int unsigned NOT NULL,
  `rpt_type` varchar(10) DEFAULT NULL,
  `standard` tinyint(1) DEFAULT '0',
  `start_date` datetime DEFAULT NULL,
  `title1` varchar(50) DEFAULT NULL,
  `title2` varchar(100) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL,
  `cols` text,
  `rows` text,
  PRIMARY KEY (`id`),
  UNIQUE KEY `title1` (`title1`,`client_id`,`delete_date`)
) ENGINE=MyISAM AUTO_INCREMENT=127854 DEFAULT CHARSET=latin1;
INSERT INTO `test_table_1` (`id`, `create_user_id`, `create_date`, `change_user_id`, `change_date`, `delete_user_id`, `delete_date`, `client_id`, `rpt_type`, `standard`, `start_date`, `title1`, `title2`, `description`, `cols`, `rows`) VALUES
(77, 'asd1', NULL, NULL, NULL, 'asd1', NULL, 1171, 'annual', 0, NULL, 'dffd', 'dfgd', '', 'Jan,Feb', '');

3. Refresh, right click on test_table_1, select "Search Table Data..."
4. Search for "asd", start search:

14:23:43 [ERR][  GRTDispatcher]: exception in grt execute_task, continuing: Exception: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rows LIKE '%asd%' , rows, '') AS rows FROM test_db.test_table_1 WHERE create_use' at line 1
14:23:43 [ERR][  GRTDispatcher]: worker: task 'Search' has failed with error:.You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rows LIKE '%asd%' , rows, '') AS rows FROM test_db.test_table_1 WHERE create_use' at line 1
[27 Jul 2022 13:39] Max asd
-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               MySQLWorkbench [68076]
Path:                  /Applications/MySQLWorkbench.app/Contents/MacOS/MySQLWorkbench
Identifier:            com.oracle.workbench.MySQLWorkbench
Version:               8.0.29.CE (1)
Code Type:             X86-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2022-07-27 14:23:44.0718 +0100
OS Version:            macOS 12.4 (21F79)
Report Version:        12
Bridge OS Version:     3.0 (14Y910)
Anonymous UUID:        EFDDDFBB-9633-262A-E900-8545D91F3168

Time Awake Since Boot: 1300000 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       UNKNOWN_0xD at 0x0000000000000000
Exception Codes:       0x000000000000000d, 0x0000000000000000
Exception Note:        EXC_CORPSE_NOTIFY

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [68076]

VM Region Info: 0 is not in any region.  Bytes before following region: 4368060416
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      1045b5000-104605000    [  320K] r-x/r-x SM=COW  ...ySQLWorkbench

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libwbpublic.be.dylib          	       0x1056a3125 std::__1::__function::__func<std::__1::__bind<bool (MySQLEditor::*)(), MySQLEditor*>, std::__1::allocator<std::__1::__bind<bool (MySQLEditor::*)(), MySQLEditor*> >, bool ()>::operator()() + 33
1   libwbpublic.be.dylib          	       0x1056cb769 bec::GRTManager::perform_idle_tasks() + 115
2   libwbprivate.be.dylib         	       0x106ecc9c1 wb::WBContext::flush_idle_tasks(bool) + 41
3   MySQLWorkbench                	       0x1045cd4af -[WBMainController flushIdleTasks:] + 50
[5 Aug 2022 8:47] Max asd
Any luck?
[5 Aug 2022 8:51] Max asd
Still an issue in 8.0.30.CE
[29 Sep 2022 14:00] Matthew Boehm
@Max, open a new bug report. The MySQL team has already marked this bug invalid and they won't see any new info posted here.