Skip to content

SHOW CREATE TABLE returns incorrect statement #175735

Description

@FullDuplexFish

Describe the problem

Please describe the issue you observed, and any steps we can take to reproduce it:

To Reproduce

CREATE TABLE t (c0 STRING COLLATE de DEFAULT '');                                           
root@127.0.0.1:26257/d0> show create table t;                                                                        
  table_name |                       create_statement
-------------+----------------------------------------------------------------
  t          | CREATE TABLE public.t (
             |     c0 STRING COLLATE de NULL DEFAULT '':::STRING COLLATE de,
             |     rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),
             |     CONSTRAINT t_pkey PRIMARY KEY (rowid ASC)
             | ) WITH (schema_locked = true);
(1 row)
root@127.0.0.1:26257/d0> CREATE TABLE public.t (                                                                     
                      ->       c0 STRING COLLATE de NULL DEFAULT '':::STRING COLLATE de,                             
                      ->       rowid INT8 NOT VISIBLE NOT NULL DEFAULT unique_rowid(),                               
                      ->       CONSTRAINT t_pkey PRIMARY KEY (rowid ASC)                                             
                      ->   ) WITH (schema_locked = true);                                                            
ERROR: statement ignored: at or near ",": syntax error: multiple COLLATE declarations for column "c0"
SQLSTATE: 42601
DETAIL: source SQL:
CREATE TABLE public.t (
      c0 STRING COLLATE de NULL DEFAULT '':::STRING COLLATE de,
                                                              ^

Expected behavior
Creating second table successfully

Environment:

  • CockroachDB version [CockroachDB CCL v26.3.0-alpha.00000000-dev-13cb3eb27674b4a981e5c526d04c2387e81efd0b (x86_64-pc-linux-gnu, built 2026/09/21 05:57:20, go1.26.2)]
  • Server OS: [Ubuntu 24.04]
  • Client app [cockroach sql]

Jira issue: CRDB-68652

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCode not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.O-communityOriginated from the communityX-blathers-untriagedblathers was unable to find an owner

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions