1600
1600
cli_use_result, /* use_result */
1601
1601
cli_fetch_lengths, /* fetch_lengths */
1602
1602
cli_flush_use_result, /* flush_use_result */
1603
NULL, /* list_fields */
1604
NULL, /* unbuffered_fetch */
1605
NULL, /* read_statistics */
1603
#ifndef MYSQL_SERVER
1604
cli_list_fields, /* list_fields */
1605
cli_unbuffered_fetch, /* unbuffered_fetch */
1606
cli_read_statistics, /* read_statistics */
1606
1607
cli_read_query_result, /* next_result */
1607
NULL, /* read_change_user_result */
1608
cli_read_change_user_result, /* read_change_user_result */
2418
2420
my_free(mysql->user,MYF(MY_ALLOW_ZERO_PTR));
2419
2421
my_free(mysql->passwd,MYF(MY_ALLOW_ZERO_PTR));
2420
2422
my_free(mysql->db,MYF(MY_ALLOW_ZERO_PTR));
2421
#if defined(EMBEDDED_LIBRARY) || MYSQL_VERSION_ID >= 50100
2422
2423
my_free(mysql->info_buffer,MYF(MY_ALLOW_ZERO_PTR));
2423
2424
mysql->info_buffer= 0;
2425
2426
/* Clear pointers for better safety */
2426
2427
mysql->host_info= mysql->user= mysql->passwd= mysql->db= 0;
2431
Clear connection pointer of every statement: this is necessary
2432
to give error on attempt to use a prepared statement of closed
2436
mysql_detach_stmt_list()
2437
stmt_list pointer to mysql->stmts
2438
func_name name of calling function
2441
There is similar code in mysql_reconnect(), so changes here
2442
should also be reflected there.
2445
void mysql_detach_stmt_list(LIST **stmt_list __attribute__((unused)),
2446
const char *func_name __attribute__((unused)))
2449
/* Reset connection handle in all prepared statements. */
2450
LIST *element= *stmt_list;
2451
char buff[MYSQL_ERRMSG_SIZE];
2452
DBUG_ENTER("mysql_detach_stmt_list");
2454
my_snprintf(buff, sizeof(buff)-1, ER(CR_STMT_CLOSED), func_name);
2455
for (; element; element= element->next)
2457
MYSQL_STMT *stmt= (MYSQL_STMT *) element->data;
2458
set_stmt_error(stmt, CR_STMT_CLOSED, unknown_sqlstate, buff);
2460
/* No need to call list_delete for statement here */
2464
#endif /* MYSQL_CLIENT */
2468
2431
void STDCALL mysql_close(MYSQL *mysql)
2470
2433
DBUG_ENTER("mysql_close");