MCPcopy Create free account
hub / github.com/MariaDB/server / free_connection

Method free_connection

sql/sql_class.cc:1782–1814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1780*/
1781
1782void THD::free_connection()
1783{
1784 DBUG_ENTER("free_connection");
1785 DBUG_ASSERT(free_connection_done == 0);
1786 my_free(const_cast<char*>(db.str));
1787 db= null_clex_str;
1788#ifndef EMBEDDED_LIBRARY
1789 if (net.vio)
1790 vio_delete(net.vio);
1791 net.vio= nullptr;
1792 net_end(&net);
1793 delete(rgi_fake);
1794 rgi_fake= NULL;
1795 delete(rli_fake);
1796 rli_fake= NULL;
1797#endif
1798 if (!cleanup_done)
1799 cleanup();
1800 ha_close_connection(this);
1801 plugin_thdvar_cleanup(this);
1802 mysql_audit_free_thd(this);
1803 main_security_ctx.destroy();
1804 /* close all prepared statements, to save memory */
1805 stmt_map.reset();
1806 free_connection_done= 1;
1807#if defined(ENABLED_PROFILING)
1808 profiling.restart(); // Reset profiling
1809#endif
1810 debug_sync_reset_thread(this);
1811 DBUG_ASSERT(status_var.tmp_space_used == 0 ||
1812 !debug_assert_on_not_freed_memory);
1813 DBUG_VOID_RETURN;
1814}
1815
1816/*
1817 Reset thd for reuse by another connection

Callers 1

unlink_thdFunction · 0.80

Calls 11

my_freeFunction · 0.85
vio_deleteFunction · 0.85
net_endFunction · 0.85
ha_close_connectionFunction · 0.85
plugin_thdvar_cleanupFunction · 0.85
mysql_audit_free_thdFunction · 0.85
debug_sync_reset_threadFunction · 0.70
cleanupFunction · 0.50
destroyMethod · 0.45
resetMethod · 0.45
restartMethod · 0.45

Tested by

no test coverage detected