mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Revert "gh-133390: Support SQL keyword completion for sqlite3 CLI (#133393)" temporarily (GH-135232)
This reverts commit 62b3d2d443
,
which broke buildbots
This commit is contained in:
parent
46151648ca
commit
24069fbca8
7 changed files with 6 additions and 193 deletions
|
@ -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"
|
||||
|
@ -405,40 +404,6 @@ pysqlite_error_name(int rc)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
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) \
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue