Closed
Description
Please confirm that the bug report does not already exist
- I confirm there is no existing issue for this bug.
Steps to reproduce
- Have a database with a relationship
- Update the metadata database directly, add a
.
or[<digit>]
(e.g.[2]
) to the linked column ID - Restart NocoDB
- Check out the view and get an SQL error
Example of generated invalid SQL:
SELECT
(
SELECT
count("__nc_rollup"."uuid")
FROM
"mart_ncdb"."attribute" AS "__nc_rollup"
INNER JOIN "mart_ncdb"."attribute_may_have_val_particular" ON
"mart_ncdb"."attribute_may_have_val_particular"."left_item_uuid" = "__nc_rollup"."uuid"
WHERE
"mart_ncdb"."attribute_may_have_val_particular"."right_item_uuid" = "mart_ncdb"."sentence"."uuid"
) AS "!TL)X{)~uzc=15"[2], -- ERROR
"mart_ncdb"."sentence"."uuid" AS "c1uyfpahct7vkcw"
FROM
"mart_ncdb"."sentence"
WHERE
"uuid" = '4e5ef00c-8d3a-4d43-a94d-3d783c8c70c0'
LIMIT 1
The actual column ID is !TL)X{)~uzc=15[2]QFb
Desired Behavior
- Whatever datum is used as an SQL column name, it's not truncated and correctly escaped when necessary
- Maybe it's better to use
column_name
, notcolumn_id
, to increase SQL readability in the case of troubleshooting
Project Details
Node: v22.15.0
Arch: x64
Platform: linux
Docker: false
RootDB: pg
PackageVersion: 0.263.1
Attachments
No response
Metadata
Metadata
Assignees
Labels
No labels