Skip to content

multilingual #84

@vadim-tropashko

Description

@vadim-tropashko

When using QuickSQL to define a table with a 'check' constraint on a column, the generated SQL is malformed if the table name contains non-ASCII characters. Specifically, the generated constraint name includes an extra quotation mark, which can lead to syntax errors in the resulting SQL.

  1. Define a table in QuickSQL with only ASCII table and column names:

articles
id /pk
status int /check 1,2,3

The SQL created is:

create table articles (
id number default on null to_number(sys_guid(), 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
constraint articles_id_pk primary key,
status integer constraint articles_status_ck
check (status in (1,2,3))
);

This is correct.

  1. Define a table in QuickSQL where the table name contains non-ASCII characters:

日本語
id /pk
status int /check 1,2,3

The SQL created is:

create table "日本語" (
id number default on null to_number(sys_guid(), 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
constraint "日本語_id_pk" primary key,
status integer constraint "日本語"status_ck"
check (status in (1,2,3))
);

Note the malformed constraint name (constraint "日本語"status_ck"), which incorrectly mixes quoted and unquoted identifiers, and includes an extra quotation mark.

The constraint names should be correctly formed regardless of whether the table name contains ASCII or non-ASCII characters. For example:

status integer constraint "日本語_status_ck"
check (status in (1,2,3))

This bug may cause SQL execution failures when using non-ASCII table names in QuickSQL, impacting usability for users working with multilingual identifiers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions