Steps to reproduce this issue
- Create/access a table with a backslash in the enum value -
CREATE TABLE x (c ENUM('\\foo','\\bar'))
- Attempt to insert/update a row with a value with a backslash through the data tab
Current behavior
HeidiSQL double-escapes the input, leading to the query INSERT INTO `test`.`x` (`c`) VALUES ('\\\\foo'); and /* SQL Error (1265): Data truncated for column 'c' at row 1 */
Expected behavior
HeidiSQL should generate the query INSERT INTO `test`.`x` (`c`) VALUES ('\\foo');, which is successful when run manually
Possible solution
The enum value is escaped for backslashes twice (or once too many). Possibly similar to #690.
Environment
- HeidiSQL version: Windows, latest nightly
- Database system and version: MariaDB 10.4.8
- Operating system: Windows 10 [Version 10.0.18362.418]
Steps to reproduce this issue
CREATE TABLE x (c ENUM('\\foo','\\bar'))Current behavior
HeidiSQL double-escapes the input, leading to the query
INSERT INTO `test`.`x` (`c`) VALUES ('\\\\foo');and/* SQL Error (1265): Data truncated for column 'c' at row 1 */Expected behavior
HeidiSQL should generate the query
INSERT INTO `test`.`x` (`c`) VALUES ('\\foo');, which is successful when run manuallyPossible solution
The enum value is escaped for backslashes twice (or once too many). Possibly similar to #690.
Environment