dolthub / dolt

Dolt – Git for Data
https://www.dolthub.com
Apache License 2.0
18.02k stars 517 forks source link

Character set REGEXP syntax (ie. 'N[1,3]') not supported in Dolt #3005

Open VinaiRachakonda opened 2 years ago

VinaiRachakonda commented 2 years ago

Consider the following table and data

CREATE TABLE IF NOT EXISTS `person` (`id` INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY, `name` VARCHAR(255) NOT NULL);
INSERT INTO `person` (`name`) VALUES ('n1');
INSERT INTO `person` (`name`) VALUES ('n2');
INSERT INTO `person` (`name`) VALUES ('n3');

Consider the following query

SELECT `t1`.`id`, `t1`.`name` FROM `person` AS `t1` WHERE (`t1`.`name` REGEXP 'N[1,3]') ORDER BY `t1`.`name`;

MySQL Returns

+----+------+
| id | name |
+----+------+
|  1 | n1   |
|  3 | n3   |
+----+------+

Dolt returns the empty set

VinaiRachakonda commented 2 years ago

This is affecting the Peewee ORM

VinaiRachakonda commented 2 years ago

Skipped enginetest here