Skip to content

Extra escaping when backslash in enum value #799

@iggyvolz

Description

@iggyvolz

Steps to reproduce this issue

  1. Create/access a table with a backslash in the enum value - CREATE TABLE x (c ENUM('\\foo','\\bar'))
  2. 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
    image
  • Database system and version: MariaDB 10.4.8
  • Operating system: Windows 10 [Version 10.0.18362.418]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQLconfirmedIssue verified by project member

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions