Skip to content

ALTER TABLE UPDATE statement run without default database #750

Closed

Description

@welyss

insert ok, alter table update can't take the default database,
found that in file "ClickHouseStatementImpl" method "getInputStream":
boolean ignoreDatabase = parsedStmt.isRecognized() && !parsedStmt.isDML();
ALTER TABLE UPDATE is Recognized to DDL, is there any option to change this logic

Activity

  1. zhicwu commented on Oct 21, 2021

    @zhicwu
    Contributor

    Sorry about the inconvenience. Currently no option for this - I can think of two workarounds: 1) use full qualified name in your query; 2) multi-statement script(e.g. use yourdb; alert table update...)

  2. added this to the 0.3.2 Release milestone on Nov 28, 2021
  3. zhicwu commented on Nov 28, 2021

    @zhicwu
    Contributor

    This has been fixed in develop branch. Make sure you use the new JDBC driver com.clickhouse.jdbc.ClickHouseDriver.

    alter table test_date update ndate='2021-11-10' where ndate is null;
    
    -- same as alter table test_date update ndate='2021-11-11' where no = 0 settings mutations_sync=1
    update test_date set ndate='2021-11-11' where no = 0
  4. linked a pull request that will close this issueNew JDBC driver #747on Nov 28, 2021
  5. self-assigned this
    on Nov 28, 2021
  6. welyss commented on Nov 29, 2021

    @welyss
    Author

    thanks!I will check it on 0.3.2 release.

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions