Various changes

- "Prepare" wasn't listed in SHOW PROCESSLIST
- during ~MySQL_Connection(), all
pull/739/head
René Cannaò 10 years ago
parent 016b596a0f
commit c987da5b03

@ -635,8 +635,13 @@ void MySQL_HostGroups_Manager::push_MyConn_to_pool(MySQL_Connection *c, bool _lo
}
if (mysrvc->status==MYSQL_SERVER_STATUS_ONLINE) {
if (c->async_state_machine==ASYNC_IDLE) {
c->optimize();
mysrvc->ConnectionsFree->add(c);
if (c->local_stmts->get_num_entries() > 50) {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Destroying MySQL_Connection %p, server %s:%d with status %d because has too many prepared statements\n", c, mysrvc->address, mysrvc->port, mysrvc->status);
delete c;
} else {
c->optimize();
mysrvc->ConnectionsFree->add(c);
}
} else {
proxy_debug(PROXY_DEBUG_MYSQL_CONNPOOL, 7, "Destroying MySQL_Connection %p, server %s:%d with status %d\n", c, mysrvc->address, mysrvc->port, mysrvc->status);
delete c;

@ -132,7 +132,7 @@ void MySQL_STMT_Manager::active_prepared_statements(uint32_t *unique, uint32_t *
uint32_t u=0;
uint32_t t=0;
spin_wrlock(&rwlock);
fprintf(stderr,"%u , %u\n", find_prepared_statement_by_hash_calls, add_prepared_statement_calls);
fprintf(stderr,"%u , %u , %u\n", find_prepared_statement_by_hash_calls, add_prepared_statement_calls, m.size());
for (std::map<uint32_t, MySQL_STMT_Global_info *>::iterator it=m.begin(); it!=m.end(); ++it) {
MySQL_STMT_Global_info *a=it->second;
if (a->ref_count_client) {

@ -2598,6 +2598,9 @@ SQLite3_result * MySQL_Threads_Handler::SQL3_Processlist() {
case PROCESSING_STMT_EXECUTE:
pta[11]=strdup("Execute");
break;
case PROCESSING_STMT_PREPARE:
pta[11]=strdup("Prepare");
break;
default:
sprintf(buf,"%d", sess->status);
pta[11]=strdup(buf);

@ -214,6 +214,7 @@ MySQL_Connection::~MySQL_Connection() {
delete local_stmts;
}
if (query.stmt) {
query.stmt->mysql=NULL;
mysql_stmt_close(query.stmt);
query.stmt=NULL;
}

Loading…
Cancel
Save