webyog / sqlyog-community

Webyog provides monitoring and management tools for open source relational databases. We develop easy-to-use MySQL client tools for performance tuning and database management. Webyog's solutions include SQL Diagnostic Manager for MySQL performance optimization and SQLyog for MySQL administration. More than 35,000 companies (including Amazon, IBM, Salesforce, AT&T, eBay, and GE) and 2.5 million users rely on Webyog's solutions to provide valuable insights into their databases. Webyog is an Idera, Inc. company.
https://webyog.com/
GNU General Public License v2.0
2.16k stars 318 forks source link

Crash upon Alter table (F6) a table with CHECK CONSTRAINT #2309

Closed H0w4rd closed 1 year ago

H0w4rd commented 1 year ago

When I try to edit a table containing a column with CHECK CONSTRAINT, SQLyog crashes:

Faulting application name: SQLyogCommunity.exe, version: 13.1.9.0, time stamp: 0x61b84c18
Faulting module name: dbgcore.DLL_unloaded, version: 10.0.19041.789, time stamp: 0x225c0d3d
Exception code: 0xc000041d
Fault offset: 0x0000000000006a80
Faulting process id: 0x1cf0
Faulting application start time: 0x01d8f2cce97629aa
Faulting application path: C:\Program Files\SQLyog Community\SQLyogCommunity.exe
Faulting module path: dbgcore.DLL
Report Id: fdb8af69-24cc-4a69-87ea-30eaca0f28b7
Faulting package full name: 
Faulting package-relative application ID: 

MariaDB 10.4

sibwy commented 1 year ago

Please contact us by email at ideramysqlsupport@idera.com about this. The way we use GitHub is strictly as an issue-tracker for known issues and not for support or discussions. This is necessary in order to keep the system manageable.

H0w4rd commented 1 year ago

But this is an issue. Could you please reopen it? I will provide more information how to reproduce the problem.

H0w4rd commented 1 year ago

You can reproduce the problem when you create the following table:

CREATE TABLE `test` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `kind` varchar(50) NOT NULL,
  `color` varchar(100) DEFAULT NULL,
  `background_color` varchar(100) DEFAULT NULL,
  `created` datetime NOT NULL DEFAULT current_timestamp(),
  `created_user_id` int(11) unsigned DEFAULT NULL,
  `changed` datetime DEFAULT NULL,
  `changed_user_id` int(11) unsigned DEFAULT NULL,
  `active` tinyint(1) unsigned NOT NULL DEFAULT 1,
  `not_deleted` tinyint(1) unsigned DEFAULT 1 COMMENT 'Nesmazaný' CHECK (`not_deleted` = 1 or `not_deleted` is null),
  PRIMARY KEY (`id`),
  UNIQUE KEY `tag_n` (`name`,`kind`,`not_deleted`)
) ENGINE=InnoDB AUTO_INCREMENT=51 DEFAULT CHARSET=utf8

and then try to right-click on it in the tree on the left side and select Alter table (F6).

Version 13.1.9 disappeared immediatelly with the error (written above) in the event log. Version 13.2.0 seems to be able to recover from it at first, but won't show the table, but second time it crashes anyway. Tested on MariaDB 10.4 and 10.5.

The problem seems to be caused together by the comment containing 'ý' as well as by the check constraint. I hope you can fix the problem because I would like to start using CHECK constraints.