Skip to content

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

@austinlau

Description

@austinlau

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions