You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
where=" where {}".format(where) ifwhereisnotNoneelse"",
)
It's registering a function called convert_value() and then failing to de-register that function once it has finished.
It might even be possible for two queries running against the same connection to clobber each other's convert_value() functions, leading to incorrect behaviour.
So two fixes: firstly it should register the function with a unique name (maybe add a random suffix). Secondly, it should de-register that function once it has finished.
The text was updated successfully, but these errors were encountered:
As far as I can tell the Python sqlite3 module doesn't actually have a mechanism for de-registering a custom SQL function.
This means that if I implement a mechanism whereby each call to .convert() registers a new SQL function with a random suffix (convert_value_23424() for example) those functions will stay registered - and if .convert() is called a large number of times the number of obsolete custom function registrations will grow without bounds.
It currently works like this:
sqlite-utils/sqlite_utils/db.py
Lines 2177 to 2195 in 77c240d
It's registering a function called
convert_value()
and then failing to de-register that function once it has finished.It might even be possible for two queries running against the same connection to clobber each other's
convert_value()
functions, leading to incorrect behaviour.So two fixes: firstly it should register the function with a unique name (maybe add a random suffix). Secondly, it should de-register that function once it has finished.
The text was updated successfully, but these errors were encountered: