You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-07 02:42:49 +03:00
Fix for CONC-457:
mysql_list_processlists was marked as deprecated in MySQL 4.0 and not updated anymore. It exists still in latest MySQL and MariaDB connectors. It now supports the 4.1 protocol, using 7 instead of 5 fields. The following functions are now marked deprecated in source: * mysql_list_dbs * mysql_list_tables * mysql_list_processes
This commit is contained in:
@@ -2476,6 +2476,12 @@ mysql_field_seek(MYSQL_RES *result, MYSQL_FIELD_OFFSET field_offset)
|
|||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************************************
|
||||||
|
Warning: mysql_list_dbs is deprecated and will be
|
||||||
|
removed. Use SQL statement "SHOW DATABASES"
|
||||||
|
instead
|
||||||
|
********************************************************/
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
** List all databases
|
** List all databases
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
@@ -2491,6 +2497,11 @@ mysql_list_dbs(MYSQL *mysql, const char *wild)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/********************************************************
|
||||||
|
Warning: mysql_list_tables is deprecated and will be
|
||||||
|
removed. Use SQL statement "SHOW TABLES"
|
||||||
|
instead
|
||||||
|
********************************************************/
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
** List all tables in a database
|
** List all tables in a database
|
||||||
** If wild is given then only the tables matching wild are returned
|
** If wild is given then only the tables matching wild are returned
|
||||||
@@ -2550,6 +2561,12 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/********************************************************
|
||||||
|
Warning: mysql_list_processes is deprecated and will be
|
||||||
|
removed. Use SQL statement "SHOW PROCESSLIST"
|
||||||
|
instead
|
||||||
|
********************************************************/
|
||||||
|
|
||||||
/* List all running processes (threads) in server */
|
/* List all running processes (threads) in server */
|
||||||
|
|
||||||
MYSQL_RES * STDCALL
|
MYSQL_RES * STDCALL
|
||||||
@@ -2565,7 +2582,7 @@ mysql_list_processes(MYSQL *mysql)
|
|||||||
free_old_query(mysql);
|
free_old_query(mysql);
|
||||||
pos=(uchar*) mysql->net.read_pos;
|
pos=(uchar*) mysql->net.read_pos;
|
||||||
field_count=(uint) net_field_length(&pos);
|
field_count=(uint) net_field_length(&pos);
|
||||||
if (!(fields = mysql->methods->db_read_rows(mysql,(MYSQL_FIELD*) 0,5)))
|
if (!(fields = mysql->methods->db_read_rows(mysql,(MYSQL_FIELD*) 0,7)))
|
||||||
return(NULL);
|
return(NULL);
|
||||||
if (!(mysql->fields=unpack_fields(fields, &mysql->field_alloc,
|
if (!(mysql->fields=unpack_fields(fields, &mysql->field_alloc,
|
||||||
field_count, 0)))
|
field_count, 0)))
|
||||||
|
@@ -1426,8 +1426,18 @@ static int test_sslenforce(MYSQL *unused __attribute__((unused)))
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static int test_conc457(MYSQL *mysql)
|
||||||
|
{
|
||||||
|
MYSQL_RES *result= mysql_list_processes(mysql);
|
||||||
|
|
||||||
|
FAIL_IF(mysql_field_count(mysql) != 9, "expected 9 columns");
|
||||||
|
mysql_free_result(result);
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct my_tests_st my_tests[] = {
|
struct my_tests_st my_tests[] = {
|
||||||
|
{"test_conc457", test_conc457, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||||
{"test_conc384", test_conc384, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
{"test_conc384", test_conc384, TEST_CONNECTION_NONE, 0, NULL, NULL},
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
{"test_mdev12965", test_mdev12965, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
{"test_mdev12965", test_mdev12965, TEST_CONNECTION_DEFAULT, 0, NULL, NULL},
|
||||||
|
Reference in New Issue
Block a user