mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
bpo-44991: Normalise function and collation callback naming (GH-28209)
This commit is contained in:
parent
b37dc9b3bc
commit
cfb1df3b71
1 changed files with 5 additions and 7 deletions
|
@ -667,7 +667,7 @@ set_sqlite_error(sqlite3_context *context, const char *msg)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_pysqlite_func_callback(sqlite3_context *context, int argc, sqlite3_value **argv)
|
func_callback(sqlite3_context *context, int argc, sqlite3_value **argv)
|
||||||
{
|
{
|
||||||
PyGILState_STATE threadstate = PyGILState_Ensure();
|
PyGILState_STATE threadstate = PyGILState_Ensure();
|
||||||
|
|
||||||
|
@ -908,7 +908,7 @@ pysqlite_connection_create_function_impl(pysqlite_Connection *self,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
rc = sqlite3_create_function_v2(self->db, name, narg, flags, ctx,
|
rc = sqlite3_create_function_v2(self->db, name, narg, flags, ctx,
|
||||||
_pysqlite_func_callback,
|
func_callback,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&destructor_callback); // will decref func
|
&destructor_callback); // will decref func
|
||||||
|
@ -1501,10 +1501,8 @@ error:
|
||||||
/* ------------------------- COLLATION CODE ------------------------ */
|
/* ------------------------- COLLATION CODE ------------------------ */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pysqlite_collation_callback(
|
collation_callback(void *context, int text1_length, const void *text1_data,
|
||||||
void* context,
|
int text2_length, const void *text2_data)
|
||||||
int text1_length, const void* text1_data,
|
|
||||||
int text2_length, const void* text2_data)
|
|
||||||
{
|
{
|
||||||
PyGILState_STATE gilstate = PyGILState_Ensure();
|
PyGILState_STATE gilstate = PyGILState_Ensure();
|
||||||
|
|
||||||
|
@ -1778,7 +1776,7 @@ pysqlite_connection_create_collation_impl(pysqlite_Connection *self,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
rc = sqlite3_create_collation_v2(self->db, name, flags, ctx,
|
rc = sqlite3_create_collation_v2(self->db, name, flags, ctx,
|
||||||
&pysqlite_collation_callback,
|
&collation_callback,
|
||||||
&destructor_callback);
|
&destructor_callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue