Skip to content

Expression causes table save error #2156

@jeffvfren

Description

@jeffvfren

Description

I ran this command to add the new column without error and the existing data was successfully copied from ColName to ColName_Idx:

ALTER TABLE TbName
ADD COLUMN ColName_Idx VARCHAR(255)
GENERATED ALWAYS AS (REGEXP_REPLACE(ColName, '[[:space:][:punct:]]', '')) STORED;

However, in HeidiSql "Expression" it is not displayed correctly:

regexp_replace(`ColName`,_utf8mb4\'[[:space:][:punct:]]\',_utf8mb4\'\')

The correct expression should be:

regexp_replace(`ColName`,'[[:space:][:punct:]]','')

Image

This causes HeidiSql to be unable to save the table design after modification:

Image

HeidiSQL version

HeidiSQL 12.10

Database server version

MySql community 8.0.40

Reproduction recipe

  1. Run this code to add a new column to an existing table. The column name "ColName" must exist:
ALTER TABLE TbName
ADD COLUMN ColName_Idx VARCHAR(255)
GENERATED ALWAYS AS (REGEXP_REPLACE(ColName, '[[:space:][:punct:]]', '')) STORED;
  1. Now edit the table in HeidiSql, for example add another column and save it.

Error/Backtrace

/* SQL Error (1064): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'[[:space:][:punct:]]\',_utf8mb4\'\')) stored AFTER `ColName`' at line 3 */

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDefective behaviour in HeidiSQLconfirmedIssue verified by project membernettype-mysqlMySQL and/or MariaDB specific issue

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions