Skip to content

Creating table silently failed in default database #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JakkuSakura opened this issue Apr 6, 2025 · 5 comments
Open

Creating table silently failed in default database #318

JakkuSakura opened this issue Apr 6, 2025 · 5 comments
Assignees

Comments

@JakkuSakura
Copy link

Describe what's wrong
I tried to create a table in default database, and it fails without explicit error.
If I create table in non-default databases, it works as expected.

JakkuSakura/chdb-rust@2715433

Does it reproduce on the most recent release?
I'm using chdb v2.1.1

How to reproduce

  1. git clone https://github.com/JakkuSakura/chdb-rust
  2. git switch -d 271543383827da3ed42e4ae883c9d767d5f379f6
  3. ./update_libchdb.sh --local
  4. cargo test

I didn't test other chdb clients, but here's the SQL that is falling

CREATE TABLE logs (id UInt64, msg String) ENGINE = MergeTree() ORDER BY id;
INSERT INTO logs (id, msg) VALUES (1, 'test');

Message

Error: QueryError("Code: 60. DB::Exception: Table default.logs does not exist. (UNKNOWN_TABLE)")

If I add:

CREATE DATABASE demo; USE demo

Then it's working

@JakkuSakura
Copy link
Author

JakkuSakura commented Apr 6, 2025

Seems duplicate of #269
upgrading to v3.1.2 doesn't solve the issue

@JakkuSakura
Copy link
Author

Sometimes USE demo is not persistent in the same session

@auxten
Copy link
Member

auxten commented Apr 7, 2025

This should be fixed by change the default database type. Currently it's memory engine.

@JakkuSakura
Copy link
Author

Is it? I even specified ENGINE = MergeTree when creating tables.
Memory engine can't be persistent is another issue

@auxten
Copy link
Member

auxten commented Apr 7, 2025

Table and Database both have engine type. If Database is memory engine, Table with MergeTree will also not persist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants