Skip to content

Hyphen in link middle table name breaks database rebuilding #3500

@saierd

Description

@saierd

Describe the bug

After creating a link with a hyphen in the middle table name, EspoCRM can no longer rebuild the database

The App log contains the messages:

Error while rebuilding database. See log file for details.

and

Rebuild database error: An exception occurred while executing a query: SQLSTATE[42000]: Syntax error or access violation: 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 '-_mytablename (id BIGINT AUTO_INCREMENT NOT NULL, account_id VARCHAR(17) CHARACTE' at line 1

The error can be fixed by removing the relation.

To Reproduce (MANDATORY, DO NOT REMOVE)

Explicit steps to reproduce the behavior:

  1. Create a many-to-many link.
  2. Overwrite the "Middle Table Name" with a string containing a hyphen

Expected behavior

The table name gets rejected or actually works.

EspoCRM version

9.1.8

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions