kvesteri / sqlalchemy-continuum

Versioning extension for SQLAlchemy.
BSD 3-Clause "New" or "Revised" License
575 stars 127 forks source link

track_association_operations out of range #266

Closed jellevanwezel closed 2 years ago

jellevanwezel commented 2 years ago

Hi,

When I try to version a simple table, I get an index out of range error in manager.py on line 454. In the function track_association_operations

table_name = statement.split(' ')[2]

Here it assumes the statement is either an:

REMOVE FROM <TABLE_NAME>

or an

INSERT INTO <TABLE_NAME>

However, this is not always the case. In my case, it also triggers when the statement is:

SELECT nextval(...)

Then the table name extraction fails.

From the context I see the actual compiled statement is an insert on some sequence table. This table is created by this plugin.

Am I doing something wrong on the implementations side?

marksteward commented 2 years ago

Are you using MariaDB? If so, this is a change in SQLAlchemy 1.4 - see #264

jellevanwezel commented 2 years ago

Yes, that is it! So it's already on the radar Then this issue can be closed

Thanks!