Skip to content

Bogus SqlParser warning for valid ALTER TABLE .. ALTER COLUMN syntax #2573

Description

@lukaseder

Steps to reproduce

try (Statement s = connection.createStatement()) {
    try {
        s.executeUpdate("create table t (i int, j int, primary key (i)) engine = MergeTree()");
        s.executeUpdate("alter table t alter column j default 1");
    }
    finally {
        s.executeUpdate("drop table if exists t");
    }
}

The syntax is perfectly fine:

Error Log or Exception StackTrace

12:35:58,252  WARN [SqlParser                     ] - SQL syntax error at line: 1, pos: 14, mismatched input 'alter' expecting {ADD, ATTACH, CLEAR, COMMENT, DELETE, DETACH, DROP, FREEZE, MATERIALIZE, MODIFY, MOVE, ON, REMOVE, RENAME, REPLACE, UPDATE}

Expected Behaviour

No log entries

Configuration

Environment

  • Client version: com.clickhouse:clickhouse-jdbc:0.9.2
  • Language version: OpenJDK Runtime Environment Temurin-21.0.7+6 (build 21.0.7+6-LTS)
  • OS: Microsoft Windows [Version 10.0.26100.4946]

ClickHouse Server

  • ClickHouse Server version: 25.4.4.25

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

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions