mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 14:19:10 -04:00
not to store imp_dbh globally, which should fix RT-86006 under Win32 (ie. ithreads-enabled environments)
- This is a tentative fix. Ideally this should be stored in MY_CXT or something less global.
This commit is contained in:
parent
eb10c7ce6f
commit
69d9a31fc0
1 changed files with 3 additions and 3 deletions
6
dbdimp.c
6
dbdimp.c
|
@ -27,7 +27,7 @@ DBISTATE_DECLARE;
|
|||
/*-----------------------------------------------------*
|
||||
* Globals
|
||||
*-----------------------------------------------------*/
|
||||
imp_dbh_t *last_prepared_dbh; /* see _last_dbh_is_unicode() */
|
||||
static int last_dbh_is_unicode; /* see _last_dbh_is_unicode() */
|
||||
|
||||
|
||||
/*-----------------------------------------------------*
|
||||
|
@ -108,7 +108,7 @@ int _last_dbh_is_unicode() {
|
|||
/* some functions need to know if the unicode flag is on, but
|
||||
don't have a dbh pointer ... so unfortunately the only way is
|
||||
to use a global variable */
|
||||
return last_prepared_dbh && last_prepared_dbh->unicode;
|
||||
return last_dbh_is_unicode;
|
||||
}
|
||||
|
||||
|
||||
|
@ -682,7 +682,7 @@ sqlite_st_prepare_sv(SV *sth, imp_sth_t *imp_sth, SV *sv_statement, SV *attribs)
|
|||
stmt_list_s * new_stmt;
|
||||
D_imp_dbh_from_sth;
|
||||
|
||||
last_prepared_dbh = imp_dbh;
|
||||
last_dbh_is_unicode = imp_dbh->unicode;
|
||||
|
||||
if (!DBIc_ACTIVE(imp_dbh)) {
|
||||
sqlite_error(sth, -2, "attempt to prepare on inactive database handle");
|
||||
|
|
Loading…
Add table
Reference in a new issue