Bug #31993 Feature request: validate SET

Submitted: 31 Oct 2007 16:14 Modified: 9 Jan 2015 9:59
Reporter: Ulf Wendel Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Workbench Severity:S4 (Feature request)
Version:1.0.6 Alpha OS:Windows
Assigned to: Assigned Account CPU Architecture:Any

[31 Oct 2007 16:14] Ulf Wendel
Description:
SET() columns seem to be not validated. You can abuse them in the same way as you can abuse ENUM():

 - non-string members
 - invalid defaults
 - too long enumeration

WB will not catch any of these issues when you validate you model with any malicious SET columns and the exported CREATE SQL statements will be invalid

Please note this is about WB 1.0.6 Alpha. 1.0.6 Alpha is newer than 1.1.10. You can download it from https://inside.mysql.com/wiki/MySQLWorkbenchAlphaReleases . Please note also the special and temporary handling of pre-beta bug reports.

How to repeat:
Create a table with a few SET columns and try to insert bogus:

 - SET(1, 2) --> no strings
 - SET('1', '2') DEFAULT '3' --> invalid default
 - SET('1', ..., '65') --> too long enumeration, max 64 elements

Validate the model, export a SQL CREATE script. This is an example of SQL that WB has exported:

CREATE  TABLE IF NOT EXISTS `test`.`t1` (`id` INT (11) NOT NULL , `c_set` SET('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a2','b2','c2','d2','e2','f2','g2','h2','i2','j2','k2','l2','m2','n2','o2','p2','q2','r2','s2','t2','u2','v2','w2','x2','y2','z2','53','54','55','56','57','58','59','60','61','62','63','64')  NULL DEFAULT NULL , `c_set_invalid` SET('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','a2','b2','c2','d2','e2','f2','g2','h2','i2','j2','k2','l2','m2','n2','o2','p2','q2','r2','s2','t2','u2','v2','w2','x2','y2','z2','53','54','55','56','57','58','59','60','61','62','63','64','65')   NULL , `c_set_inv_default` SET('a', 'b')  NULL DEFAULT 'c' , PRIMARY KEY (`id`) ) ENGINE = MyISAM DEFAULT CHARACTER SET = latin1 ;
[6 Nov 2007 21:41] Andrii Nikitin
syntax check is panned to be added to column definitions
[8 Nov 2007 14:36] Andrii Nikitin
will be done by syntax check
[15 Feb 2008 15:53] Johannes Taxacher
entry of integer SET-elements not possible anymore.
the other 2 problems arent checked/validated yet.
[15 Feb 2008 22:15] Peter Lavin
Johannes,

Should this perhaps be changed to "To be Fixed Later"? That's what your last comment seems to indicate.
[5 Mar 2014 13:25] Miguel Tadeu Mota
Added those missing validations.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.057 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.