Skip to content
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

Table with column name starting with _ fails to be created, followed by failure to drop or create the table again #1282

Closed
1 of 2 tasks
americast opened this issue Oct 13, 2023 · 2 comments · Fixed by #1293

Comments

@americast
Copy link
Member

Search before asking

  • I have searched the EvaDB issues and found no similar bug report.

Bug

I get an error if I run a CREATE TABLE query that has a column name starting with _:

CREATE TABLE hello (
        _row_id INTEGER,
        price TEXT,
        beds TEXT,
        bath TEXT,
        area TEXT,
        address TEXT);

This is the error I get:

ExecutorError: (sqlite3.IntegrityError) UNIQUE constraint failed: column_catalog.name, column_catalog.table_id
[SQL: INSERT INTO column_catalog (name, type, is_nullable, array_type, array_dimensions, table_id) VALUES (?, ?, ?, ?, ?, ?)]
[parameters: ('_row_id', 'INTEGER', 1, None, '()', 1)]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

However, strangely, after this, I am unable to either drop nor create the table hello again.

CREATE TABLE hello (
        rowid INTEGER,
        price TEXT,
        beds TEXT,
        bath TEXT,
        area TEXT,
        address TEXT);

leads to ExecutorError: Table: hello already exists. And,

DROP TABLE IF EXISTS hello;

leads to ExecutorError: Failed to drop the table hello with Exception No table found with name hello.

The only way to recover from here seems to be to delete the evadb_data directory.

Environment

Latest staging on Ubuntu 20.04

Are you willing to submit a PR?

  • Yes I'd like to help by submitting a PR!
@xzdandy xzdandy mentioned this issue Oct 13, 2023
2 tasks
@gaurav274
Copy link
Member

@americast _row_id is a reserved keyword, and users cannot create a table with this column name.

@gaurav274
Copy link
Member

I can reproduce the other error. Will fix it.

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

Successfully merging a pull request may close this issue.

2 participants