diff options
author | Petr Viktorin <encukou@gmail.com> | 2025-06-07 10:56:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-07 08:56:43 +0000 |
commit | 24069fbca861a5904ee7718469919e84828f22e7 (patch) | |
tree | b5b69902d81e326fc2441f572a8f8d99ab335143 /Modules/_sqlite/module.c | |
parent | 46151648ca8ba1edd2a2783e8e154692a13d8ea8 (diff) | |
download | cpython-24069fbca861a5904ee7718469919e84828f22e7.tar.gz cpython-24069fbca861a5904ee7718469919e84828f22e7.zip |
Revert "gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)" temporarily (GH-135232)
This reverts commit 62b3d2d443785c4ea5262edb4f9f7040440f9463,
which broke buildbots
Diffstat (limited to 'Modules/_sqlite/module.c')
-rw-r--r-- | Modules/_sqlite/module.c | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 5464fd1227a..909ddd1f990 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -32,7 +32,6 @@ #include "microprotocols.h" #include "row.h" #include "blob.h" -#include "util.h" #if SQLITE_VERSION_NUMBER < 3015002 #error "SQLite 3.15.2 or higher required" @@ -406,40 +405,6 @@ pysqlite_error_name(int rc) } static int -add_keyword_tuple(PyObject *module) -{ -#if SQLITE_VERSION_NUMBER >= 3024000 - int count = sqlite3_keyword_count(); - PyObject *keywords = PyTuple_New(count); - if (keywords == NULL) { - return -1; - } - for (int i = 0; i < count; i++) { - const char *keyword; - int size; - int result = sqlite3_keyword_name(i, &keyword, &size); - if (result != SQLITE_OK) { - pysqlite_state *state = pysqlite_get_state(module); - set_error_from_code(state, result); - goto error; - } - PyObject *kwd = PyUnicode_FromStringAndSize(keyword, size); - if (!kwd) { - goto error; - } - PyTuple_SET_ITEM(keywords, i, kwd); - } - return PyModule_Add(module, "SQLITE_KEYWORDS", keywords); - -error: - Py_DECREF(keywords); - return -1; -#else - return 0; -#endif -} - -static int add_integer_constants(PyObject *module) { #define ADD_INT(ival) \ do { \ @@ -737,10 +702,6 @@ module_exec(PyObject *module) goto error; } - if (add_keyword_tuple(module) < 0) { - goto error; - } - if (PyModule_AddStringConstant(module, "sqlite_version", sqlite3_libversion())) { goto error; } |