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

SQLyog wrongly interprets "CHECK" option in ENUM as a CHECK CONSTRAINT #2312

Closed H0w4rd closed 6 months ago

H0w4rd commented 1 year ago

You can reproduce this bug if you create a table as following

CREATE TABLE `settings` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `key` varchar(100) NOT NULL,
  `value` mediumtext DEFAULT NULL,
  `blob` mediumblob DEFAULT NULL,
  `form_type` enum('TEXT','TEXTAREA','WYSIWYG','DATE','DATETIME','INTEGER','FLOAT','CHECKBOX','ARRAY','PASSWORD','BLOB') DEFAULT NULL COMMENT 'Typ formulářového prvku',
  `settings_id` int(11) unsigned DEFAULT NULL,
  `order` int(10) unsigned DEFAULT 1,
  `not_deleted` tinyint(1) unsigned DEFAULT 1 COMMENT 'Nesmazany',
  PRIMARY KEY (`id`),
  UNIQUE KEY `settings_UK_key` (`key`,`not_deleted`),
  KEY `settings_id` (`settings_id`),
  CONSTRAINT `settings_ibfk_1` FOREIGN KEY (`settings_id`) REFERENCES `settings` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8

Then open it with F6 (Alter table) and you will see this under CHECK CONSTRAINT: BOX','ARRAY','PASSWORD','BLOB') DEFAULT NULL

image

This causes troubles later when altering the table, generated SQL command is wrong and has to be manually fixed (CHECK CONSTRAINT part).

Please could you fix it?

Version 13.2.0

sibwy commented 1 year ago

This is reproducible in SQLyog 13.2.0 with MySQL v8.0.31 and MariaDB v10.8.3.

sibwy commented 6 months ago

Fixed in SQLyog v13.2.1