bpo-34041: Added *deterministic* parameter to sqlite3.Connection.create_function(). by sir-sigurd · Pull Request #8086 · python/cpython
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum, if the flag only has an impact on performance, IHMO it's ok to ignore it if SQLite doesn't support it. But I would prefer to use "#ifndef SQLITE_DETERMINISTIC" for this test. Something like:
#ifndef SQLITE_DETERMINISTIC
if (deterministic) eTextRep |= SQLITE_DETERMINISTIC;
#endif
If Python is built on old SQLite: no luck, you will never get deterministic functions. If you build Python on new SQLite but run old SQLite: SQLITE_DETERMINISTIC is ignored, it's fine. If you have new versions in both cases: you're lucky, and you get the optimization :-)