sql thread pool relies on this being safe to call even if we didn't * register with start_sql_thread */
| 794 | /* sql thread pool relies on this being safe to call even if we didn't |
| 795 | * register with start_sql_thread */ |
| 796 | void done_sql_thread(void) |
| 797 | { |
| 798 | struct sql_thread *thd = pthread_getspecific(query_info_key); |
| 799 | if (thd) { |
| 800 | Pthread_mutex_lock(&gbl_sql_lock); |
| 801 | listc_rfl(&thedb->sql_threads, thd); |
| 802 | Pthread_mutex_unlock(&gbl_sql_lock); |
| 803 | Pthread_mutex_destroy(&thd->lk); |
| 804 | Pthread_setspecific(query_info_key, NULL); |
| 805 | if (thd->buf) { |
| 806 | free(thd->buf); |
| 807 | thd->buf = NULL; |
| 808 | } |
| 809 | if (thd->query_hash) { |
| 810 | hash_for(thd->query_hash, free_queryhash, NULL); |
| 811 | hash_clear(thd->query_hash); |
| 812 | hash_free(thd->query_hash); |
| 813 | thd->query_hash = 0; |
| 814 | } |
| 815 | destroy_sqlite_master(thd->rootpages, thd->rootpage_nentries); |
| 816 | free(thd); |
| 817 | } |
| 818 | bdb_temp_table_maybe_reset_priority_thread(thedb->bdb_env, 1); |
| 819 | } |
| 820 | |
| 821 | static int ondisk_to_sqlite_tz(struct dbtable *db, struct schema *s, void *inp, |
| 822 | int rrn, unsigned long long genid, void *outp, |
no test coverage detected