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

Cannot create compression on 2 tables with the same column name #31

Open
austinlau opened this issue Sep 27, 2023 · 0 comments
Open

Cannot create compression on 2 tables with the same column name #31

austinlau opened this issue Sep 27, 2023 · 0 comments

Comments

@austinlau
Copy link

austinlau commented Sep 27, 2023

It cannot create compression on 2 tables with the same column name. Run the code below and it duplicates the index name.

import sqlite3

conn = sqlite3.connect(r":memory:")
conn.enable_load_extension(True)
conn.load_extension(r"sqlite_zstd.dll")
conn.enable_load_extension(False)

conn.execute('''
CREATE TABLE table1 (
	id INTEGER NOT NULL, 
	name VARCHAR, 
	data TEXT_JSON, 
	PRIMARY KEY (id)
);
''')
conn.execute('''
CREATE TABLE table2 (
	id INTEGER NOT NULL, 
	name VARCHAR, 
	data TEXT_JSON, 
	PRIMARY KEY (id)
);
''')

conn.execute('''
    SELECT
        zstd_enable_transparent('{"table": "table1", "column": "data", "compression_level": 19, "dict_chooser": "''a''"}'),
        zstd_enable_transparent('{"table": "table2", "column": "data", "compression_level": 19, "dict_chooser": "''a''"}')
    ''')

with the error:
OperationalError: Could not create index on dictid

Caused by:
0: index _data_dict_idx already exists
1: Error code 1: SQL error or missing database

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

1 participant