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
Renamed MYSQL_COM_* to COM_
changed default schema for tests to test_c
This commit is contained in:
@@ -57,37 +57,37 @@ enum mysql_enum_shutdown_level
|
||||
|
||||
enum enum_server_command
|
||||
{
|
||||
MYSQL_COM_SLEEP = 0,
|
||||
MYSQL_COM_QUIT,
|
||||
MYSQL_COM_INIT_DB,
|
||||
MYSQL_COM_QUERY,
|
||||
MYSQL_COM_FIELD_LIST,
|
||||
MYSQL_COM_CREATE_DB,
|
||||
MYSQL_COM_DROP_DB,
|
||||
MYSQL_COM_REFRESH,
|
||||
MYSQL_COM_SHUTDOWN,
|
||||
MYSQL_COM_STATISTICS,
|
||||
MYSQL_COM_PROCESS_INFO,
|
||||
MYSQL_COM_CONNECT,
|
||||
MYSQL_COM_PROCESS_KILL,
|
||||
MYSQL_COM_DEBUG,
|
||||
MYSQL_COM_PING,
|
||||
MYSQL_COM_TIME = 15,
|
||||
MYSQL_COM_DELAYED_INSERT,
|
||||
MYSQL_COM_CHANGE_USER,
|
||||
MYSQL_COM_BINLOG_DUMP,
|
||||
MYSQL_COM_TABLE_DUMP,
|
||||
MYSQL_COM_CONNECT_OUT = 20,
|
||||
MYSQL_COM_REGISTER_SLAVE,
|
||||
MYSQL_COM_STMT_PREPARE = 22,
|
||||
MYSQL_COM_STMT_EXECUTE = 23,
|
||||
MYSQL_COM_STMT_SEND_LONG_DATA = 24,
|
||||
MYSQL_COM_STMT_CLOSE = 25,
|
||||
MYSQL_COM_STMT_RESET = 26,
|
||||
MYSQL_COM_SET_OPTION = 27,
|
||||
MYSQL_COM_STMT_FETCH = 28,
|
||||
MYSQL_COM_DAEMON,
|
||||
MYSQL_COM_END
|
||||
COM_SLEEP = 0,
|
||||
COM_QUIT,
|
||||
COM_INIT_DB,
|
||||
COM_QUERY,
|
||||
COM_FIELD_LIST,
|
||||
COM_CREATE_DB,
|
||||
COM_DROP_DB,
|
||||
COM_REFRESH,
|
||||
COM_SHUTDOWN,
|
||||
COM_STATISTICS,
|
||||
COM_PROCESS_INFO,
|
||||
COM_CONNECT,
|
||||
COM_PROCESS_KILL,
|
||||
COM_DEBUG,
|
||||
COM_PING,
|
||||
COM_TIME = 15,
|
||||
COM_DELAYED_INSERT,
|
||||
COM_CHANGE_USER,
|
||||
COM_BINLOG_DUMP,
|
||||
COM_TABLE_DUMP,
|
||||
COM_CONNECT_OUT = 20,
|
||||
COM_REGISTER_SLAVE,
|
||||
COM_STMT_PREPARE = 22,
|
||||
COM_STMT_EXECUTE = 23,
|
||||
COM_STMT_SEND_LONG_DATA = 24,
|
||||
COM_STMT_CLOSE = 25,
|
||||
COM_STMT_RESET = 26,
|
||||
COM_SET_OPTION = 27,
|
||||
COM_STMT_FETCH = 28,
|
||||
COM_DAEMON,
|
||||
COM_END
|
||||
};
|
||||
|
||||
|
||||
|
@@ -7,9 +7,7 @@ ADD_DEFINITIONS(-D HAVE_COMPRESS)
|
||||
ADD_DEFINITIONS(-D LIBMARIADB)
|
||||
ADD_DEFINITIONS(-D THREAD)
|
||||
|
||||
IF(WITH_SIGNCODE)
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/sign.cmake)
|
||||
ENDIF()
|
||||
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/sign.cmake)
|
||||
|
||||
SET(EXPORT_SYMBOLS
|
||||
load_defaults
|
||||
|
@@ -1835,7 +1835,7 @@ mysql_select_db(MYSQL *mysql, const char *db)
|
||||
DBUG_ENTER("mysql_select_db");
|
||||
DBUG_PRINT("enter",("db: '%s'",db));
|
||||
|
||||
if ((error=simple_command(mysql,MYSQL_COM_INIT_DB,db,(uint) strlen(db),0,0)))
|
||||
if ((error=simple_command(mysql, COM_INIT_DB,db,(uint) strlen(db),0,0)))
|
||||
DBUG_RETURN(error);
|
||||
my_free(mysql->db);
|
||||
mysql->db=my_strdup(db,MYF(MY_WME));
|
||||
@@ -1935,7 +1935,7 @@ void mysql_close_slow_part(MYSQL *mysql)
|
||||
free_old_query(mysql);
|
||||
mysql->status=MYSQL_STATUS_READY; /* Force command */
|
||||
mysql->reconnect=0;
|
||||
simple_command(mysql,MYSQL_COM_QUIT,NullS,0,1,0);
|
||||
simple_command(mysql, COM_QUIT,NullS,0,1,0);
|
||||
end_server(mysql);
|
||||
}
|
||||
}
|
||||
@@ -2006,7 +2006,7 @@ mysql_query(MYSQL *mysql, const char *query)
|
||||
int STDCALL
|
||||
mysql_send_query(MYSQL* mysql, const char* query, unsigned long length)
|
||||
{
|
||||
return simple_command(mysql, MYSQL_COM_QUERY, query, length, 1,0);
|
||||
return simple_command(mysql, COM_QUERY, query, length, 1,0);
|
||||
}
|
||||
|
||||
int mthd_my_read_query_result(MYSQL *mysql)
|
||||
@@ -2073,7 +2073,7 @@ mysql_real_query(MYSQL *mysql, const char *query, unsigned long length)
|
||||
|
||||
free_old_query(mysql);
|
||||
|
||||
if (simple_command(mysql,MYSQL_COM_QUERY,query,length,1,0))
|
||||
if (simple_command(mysql, COM_QUERY,query,length,1,0))
|
||||
DBUG_RETURN(-1);
|
||||
DBUG_RETURN(mysql->methods->db_read_query_result(mysql));
|
||||
}
|
||||
@@ -2347,7 +2347,7 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild)
|
||||
LINT_INIT(query);
|
||||
|
||||
end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128);
|
||||
if (simple_command(mysql,MYSQL_COM_FIELD_LIST,buff,(uint) (end-buff),1,0) ||
|
||||
if (simple_command(mysql, COM_FIELD_LIST,buff,(uint) (end-buff),1,0) ||
|
||||
!(query = mysql->methods->db_read_rows(mysql,(MYSQL_FIELD*) 0,8)))
|
||||
DBUG_RETURN(NULL);
|
||||
|
||||
@@ -2380,7 +2380,7 @@ mysql_list_processes(MYSQL *mysql)
|
||||
DBUG_ENTER("mysql_list_processes");
|
||||
|
||||
LINT_INIT(fields);
|
||||
if (simple_command(mysql,MYSQL_COM_PROCESS_INFO,0,0,0,0))
|
||||
if (simple_command(mysql, COM_PROCESS_INFO,0,0,0,0))
|
||||
DBUG_RETURN(0);
|
||||
free_old_query(mysql);
|
||||
pos=(uchar*) mysql->net.read_pos;
|
||||
@@ -2402,7 +2402,7 @@ mysql_create_db(MYSQL *mysql, const char *db)
|
||||
{
|
||||
DBUG_ENTER("mysql_createdb");
|
||||
DBUG_PRINT("enter",("db: %s",db));
|
||||
DBUG_RETURN(simple_command(mysql,MYSQL_COM_CREATE_DB,db, (uint) strlen(db),0,0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_CREATE_DB,db, (uint) strlen(db),0,0));
|
||||
}
|
||||
|
||||
|
||||
@@ -2411,7 +2411,7 @@ mysql_drop_db(MYSQL *mysql, const char *db)
|
||||
{
|
||||
DBUG_ENTER("mysql_drop_db");
|
||||
DBUG_PRINT("enter",("db: %s",db));
|
||||
DBUG_RETURN(simple_command(mysql,MYSQL_COM_DROP_DB,db,(uint) strlen(db),0,0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_DROP_DB,db,(uint) strlen(db),0,0));
|
||||
}
|
||||
|
||||
/* In 5.0 this version became an additional parameter shutdown_level */
|
||||
@@ -2421,7 +2421,7 @@ mysql_shutdown(MYSQL *mysql, enum mysql_enum_shutdown_level shutdown_level)
|
||||
uchar s_level[2];
|
||||
DBUG_ENTER("mysql_shutdown");
|
||||
s_level[0]= (uchar)shutdown_level;
|
||||
DBUG_RETURN(simple_command(mysql, MYSQL_COM_SHUTDOWN, (char *)s_level, 1, 0, 0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_SHUTDOWN, (char *)s_level, 1, 0, 0));
|
||||
}
|
||||
|
||||
int STDCALL
|
||||
@@ -2430,7 +2430,7 @@ mysql_refresh(MYSQL *mysql,uint options)
|
||||
uchar bits[1];
|
||||
DBUG_ENTER("mysql_refresh");
|
||||
bits[0]= (uchar) options;
|
||||
DBUG_RETURN(simple_command(mysql,MYSQL_COM_REFRESH,(char*) bits,1,0,0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_REFRESH,(char*) bits,1,0,0));
|
||||
}
|
||||
|
||||
int STDCALL
|
||||
@@ -2440,7 +2440,7 @@ mysql_kill(MYSQL *mysql,ulong pid)
|
||||
DBUG_ENTER("mysql_kill");
|
||||
int4store(buff,pid);
|
||||
/* if we kill our own thread, reading the response packet will fail */
|
||||
DBUG_RETURN(simple_command(mysql,MYSQL_COM_PROCESS_KILL,buff,4,0,0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_PROCESS_KILL,buff,4,0,0));
|
||||
}
|
||||
|
||||
|
||||
@@ -2448,14 +2448,14 @@ int STDCALL
|
||||
mysql_dump_debug_info(MYSQL *mysql)
|
||||
{
|
||||
DBUG_ENTER("mysql_dump_debug_info");
|
||||
DBUG_RETURN(simple_command(mysql,MYSQL_COM_DEBUG,0,0,0,0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_DEBUG,0,0,0,0));
|
||||
}
|
||||
|
||||
char * STDCALL
|
||||
mysql_stat(MYSQL *mysql)
|
||||
{
|
||||
DBUG_ENTER("mysql_stat");
|
||||
if (simple_command(mysql,MYSQL_COM_STATISTICS,0,0,0,0))
|
||||
if (simple_command(mysql, COM_STATISTICS,0,0,0,0))
|
||||
return mysql->net.last_error;
|
||||
mysql->net.read_pos[mysql->packet_length]=0; /* End of stat string */
|
||||
if (!mysql->net.read_pos[0])
|
||||
@@ -2472,11 +2472,11 @@ mysql_ping(MYSQL *mysql)
|
||||
{
|
||||
int rc;
|
||||
DBUG_ENTER("mysql_ping");
|
||||
rc= simple_command(mysql,MYSQL_COM_PING,0,0,0,0);
|
||||
rc= simple_command(mysql, COM_PING,0,0,0,0);
|
||||
|
||||
/* if connection was terminated and reconnect is true, try again */
|
||||
if (rc!=0 && mysql->reconnect)
|
||||
rc= simple_command(mysql,MYSQL_COM_PING,0,0,0,0);
|
||||
rc= simple_command(mysql, COM_PING,0,0,0,0);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -3198,7 +3198,7 @@ int STDCALL mysql_set_server_option(MYSQL *mysql,
|
||||
char buffer[2];
|
||||
DBUG_ENTER("mysql_set_server_option");
|
||||
int2store(buffer, (uint)option);
|
||||
DBUG_RETURN(simple_command(mysql, MYSQL_COM_SET_OPTION, buffer, sizeof(buffer), 0, 0));
|
||||
DBUG_RETURN(simple_command(mysql, COM_SET_OPTION, buffer, sizeof(buffer), 0, 0));
|
||||
}
|
||||
|
||||
ulong STDCALL mysql_get_client_version(void)
|
||||
|
@@ -281,7 +281,7 @@ static int stmt_cursor_fetch(MYSQL_STMT *stmt, uchar **row)
|
||||
int4store(buf, stmt->stmt_id);
|
||||
int4store(buf + STMT_ID_LENGTH, stmt->prefetch_rows);
|
||||
|
||||
if (simple_command(stmt->mysql, MYSQL_COM_STMT_FETCH, (char *)buf, sizeof(buf), 1, stmt))
|
||||
if (simple_command(stmt->mysql, COM_STMT_FETCH, (char *)buf, sizeof(buf), 1, stmt))
|
||||
DBUG_RETURN(1);
|
||||
|
||||
/* free previously allocated buffer */
|
||||
@@ -974,7 +974,7 @@ my_bool net_stmt_close(MYSQL_STMT *stmt, my_bool remove)
|
||||
if (stmt->state > MYSQL_STMT_INITTED)
|
||||
{
|
||||
int4store(stmt_id, stmt->stmt_id);
|
||||
if (simple_command(stmt->mysql,MYSQL_COM_STMT_CLOSE, stmt_id, sizeof(stmt_id), 1, stmt))
|
||||
if (simple_command(stmt->mysql,COM_STMT_CLOSE, stmt_id, sizeof(stmt_id), 1, stmt))
|
||||
{
|
||||
SET_CLIENT_STMT_ERROR(stmt, stmt->mysql->net.last_errno, stmt->mysql->net.sqlstate, stmt->mysql->net.last_error);
|
||||
return 1;
|
||||
@@ -1256,10 +1256,10 @@ int STDCALL mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, unsigned lon
|
||||
stmt->field_count= 0;
|
||||
|
||||
int4store(stmt_id, stmt->stmt_id);
|
||||
if (simple_command(mysql, MYSQL_COM_STMT_CLOSE, stmt_id, sizeof(stmt_id), 1, stmt))
|
||||
if (simple_command(mysql, COM_STMT_CLOSE, stmt_id, sizeof(stmt_id), 1, stmt))
|
||||
goto fail;
|
||||
}
|
||||
if (simple_command(mysql, MYSQL_COM_STMT_PREPARE, query, length, 1, stmt))
|
||||
if (simple_command(mysql, COM_STMT_PREPARE, query, length, 1, stmt))
|
||||
goto fail;
|
||||
|
||||
if (stmt->mysql->methods->db_read_prepare_response &&
|
||||
@@ -1343,7 +1343,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt)
|
||||
int4store(buff, stmt->stmt_id);
|
||||
int4store(buff + STMT_ID_LENGTH, (int)~0);
|
||||
|
||||
if (simple_command(stmt->mysql, MYSQL_COM_STMT_FETCH, buff, sizeof(buff), 1, stmt))
|
||||
if (simple_command(stmt->mysql, COM_STMT_FETCH, buff, sizeof(buff), 1, stmt))
|
||||
DBUG_RETURN(1);
|
||||
/* todo: cursor */
|
||||
}
|
||||
@@ -1487,7 +1487,7 @@ int STDCALL mysql_stmt_execute(MYSQL_STMT *stmt)
|
||||
request= (char *)mysql_stmt_execute_generate_request(stmt, &request_len);
|
||||
DBUG_PRINT("info",("request_len=%ld", request_len));
|
||||
|
||||
ret= test(simple_command(mysql, MYSQL_COM_STMT_EXECUTE, request, request_len, 1, stmt) ||
|
||||
ret= test(simple_command(mysql, COM_STMT_EXECUTE, request, request_len, 1, stmt) ||
|
||||
(mysql && mysql->methods->db_read_stmt_result && mysql->methods->db_read_stmt_result(mysql)));
|
||||
if (request)
|
||||
my_free(request);
|
||||
@@ -1666,7 +1666,7 @@ static my_bool madb_reset_stmt(MYSQL_STMT *stmt, unsigned int flags)
|
||||
{
|
||||
unsigned char cmd_buf[STMT_ID_LENGTH];
|
||||
int4store(cmd_buf, stmt->stmt_id);
|
||||
if ((ret= simple_command(mysql,MYSQL_COM_STMT_RESET, (char *)cmd_buf, sizeof(cmd_buf), 0, stmt)))
|
||||
if ((ret= simple_command(mysql,COM_STMT_RESET, (char *)cmd_buf, sizeof(cmd_buf), 0, stmt)))
|
||||
{
|
||||
SET_CLIENT_STMT_ERROR(stmt, mysql->net.last_errno, mysql->net.sqlstate,
|
||||
mysql->net.last_error);
|
||||
@@ -1820,7 +1820,7 @@ my_bool STDCALL mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
int2store(cmd_buff + STMT_ID_LENGTH, param_number);
|
||||
memcpy(cmd_buff + STMT_ID_LENGTH + 2, data, length);
|
||||
stmt->params[param_number].long_data_used= 1;
|
||||
ret= simple_command(stmt->mysql,MYSQL_COM_STMT_SEND_LONG_DATA, (char *)cmd_buff, packet_len, 1, stmt);
|
||||
ret= simple_command(stmt->mysql, COM_STMT_SEND_LONG_DATA, (char *)cmd_buff, packet_len, 1, stmt);
|
||||
my_free(cmd_buff);
|
||||
DBUG_RETURN(ret);
|
||||
}
|
||||
|
@@ -141,7 +141,7 @@ static int send_change_user_packet(MCPVIO_EXT *mpvio,
|
||||
|
||||
end= ma_send_connect_attr(mysql, end);
|
||||
|
||||
res= simple_command(mysql, MYSQL_COM_CHANGE_USER,
|
||||
res= simple_command(mysql, COM_CHANGE_USER,
|
||||
buff, (ulong)(end-buff), 1, NULL);
|
||||
|
||||
error:
|
||||
|
@@ -292,15 +292,15 @@ int repl_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
||||
return 0;
|
||||
}
|
||||
switch(command) {
|
||||
case MYSQL_COM_QUERY:
|
||||
case MYSQL_COM_STMT_PREPARE:
|
||||
case COM_QUERY:
|
||||
case COM_STMT_PREPARE:
|
||||
if (is_slave_command(arg, length))
|
||||
SET_SLAVE(mysql, data);
|
||||
else
|
||||
SET_MASTER(mysql,data);
|
||||
break;
|
||||
case MYSQL_COM_STMT_EXECUTE:
|
||||
case MYSQL_COM_STMT_FETCH:
|
||||
case COM_STMT_EXECUTE:
|
||||
case COM_STMT_FETCH:
|
||||
if (data->pvio[MARIADB_SLAVE]->mysql->stmts && is_slave_stmt(data->pvio[MARIADB_SLAVE]->mysql, arg))
|
||||
SET_SLAVE(mysql, data);
|
||||
else
|
||||
|
@@ -62,42 +62,42 @@ struct st_mysql_client_plugin _mysql_client_plugin_declaration_ =
|
||||
};
|
||||
|
||||
static char *commands[]= {
|
||||
"MYSQL_COM_SLEEP",
|
||||
"MYSQL_COM_QUIT",
|
||||
"MYSQL_COM_INIT_DB",
|
||||
"MYSQL_COM_QUERY",
|
||||
"MYSQL_COM_FIELD_LIST",
|
||||
"MYSQL_COM_CREATE_DB",
|
||||
"MYSQL_COM_DROP_DB",
|
||||
"MYSQL_COM_REFRESH",
|
||||
"MYSQL_COM_SHUTDOWN",
|
||||
"MYSQL_COM_STATISTICS",
|
||||
"MYSQL_COM_PROCESS_INFO",
|
||||
"MYSQL_COM_CONNECT",
|
||||
"MYSQL_COM_PROCESS_KILL",
|
||||
"MYSQL_COM_DEBUG",
|
||||
"MYSQL_COM_PING",
|
||||
"MYSQL_COM_TIME",
|
||||
"MYSQL_COM_DELAYED_INSERT",
|
||||
"MYSQL_COM_CHANGE_USER",
|
||||
"MYSQL_COM_BINLOG_DUMP",
|
||||
"MYSQL_COM_TABLE_DUMP",
|
||||
"MYSQL_COM_CONNECT_OUT",
|
||||
"MYSQL_COM_REGISTER_SLAVE",
|
||||
"MYSQL_COM_STMT_PREPARE",
|
||||
"MYSQL_COM_STMT_EXECUTE",
|
||||
"MYSQL_COM_STMT_SEND_LONG_DATA",
|
||||
"MYSQL_COM_STMT_CLOSE",
|
||||
"MYSQL_COM_STMT_RESET",
|
||||
"MYSQL_COM_SET_OPTION",
|
||||
"MYSQL_COM_STMT_FETCH",
|
||||
"MYSQL_COM_DAEMON",
|
||||
"MYSQL_COM_END"
|
||||
"COM_SLEEP",
|
||||
"COM_QUIT",
|
||||
"COM_INIT_DB",
|
||||
"COM_QUERY",
|
||||
"COM_FIELD_LIST",
|
||||
"COM_CREATE_DB",
|
||||
"COM_DROP_DB",
|
||||
"COM_REFRESH",
|
||||
"COM_SHUTDOWN",
|
||||
"COM_STATISTICS",
|
||||
"COM_PROCESS_INFO",
|
||||
"COM_CONNECT",
|
||||
"COM_PROCESS_KILL",
|
||||
"COM_DEBUG",
|
||||
"COM_PING",
|
||||
"COM_TIME",
|
||||
"COM_DELAYED_INSERT",
|
||||
"COM_CHANGE_USER",
|
||||
"COM_BINLOG_DUMP",
|
||||
"COM_TABLE_DUMP",
|
||||
"COM_CONNECT_OUT",
|
||||
"COM_REGISTER_SLAVE",
|
||||
"COM_STMT_PREPARE",
|
||||
"COM_STMT_EXECUTE",
|
||||
"COM_STMT_SEND_LONG_DATA",
|
||||
"COM_STMT_CLOSE",
|
||||
"COM_STMT_RESET",
|
||||
"COM_SET_OPTION",
|
||||
"COM_STMT_FETCH",
|
||||
"COM_DAEMON",
|
||||
"COM_END"
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
unsigned long thread_id;
|
||||
int last_command; /* MYSQL_COM_* values, -1 for handshake */
|
||||
int last_command; /* COM_* values, -1 for handshake */
|
||||
unsigned int max_packet_size;
|
||||
size_t total_size[2];
|
||||
unsigned int client_flags;
|
||||
@@ -332,7 +332,7 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
else
|
||||
printf("%8lu: CONNECT_SUCCESS(host=%s,user=%s,db=%s)\n", info->thread_id,
|
||||
mysql->host, info->username, info->db ? info->db : "'none'");
|
||||
info->last_command= MYSQL_COM_SLEEP;
|
||||
info->last_command= COM_SLEEP;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -346,30 +346,30 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
info->last_command= *p;
|
||||
p++;
|
||||
switch (info->last_command) {
|
||||
case MYSQL_COM_INIT_DB:
|
||||
case MYSQL_COM_DROP_DB:
|
||||
case MYSQL_COM_CREATE_DB:
|
||||
case MYSQL_COM_DEBUG:
|
||||
case MYSQL_COM_QUERY:
|
||||
case MYSQL_COM_STMT_PREPARE:
|
||||
case COM_INIT_DB:
|
||||
case COM_DROP_DB:
|
||||
case COM_CREATE_DB:
|
||||
case COM_DEBUG:
|
||||
case COM_QUERY:
|
||||
case COM_STMT_PREPARE:
|
||||
trace_set_command(info, p, len - 1);
|
||||
break;
|
||||
case MYSQL_COM_PROCESS_KILL:
|
||||
case COM_PROCESS_KILL:
|
||||
info->refid= uint4korr(p);
|
||||
break;
|
||||
case MYSQL_COM_QUIT:
|
||||
printf("%8d: MYSQL_COM_QUIT\n", info->thread_id);
|
||||
case COM_QUIT:
|
||||
printf("%8d: COM_QUIT\n", info->thread_id);
|
||||
delete_trace_info(info->thread_id);
|
||||
break;
|
||||
case MYSQL_COM_PING:
|
||||
printf("%8d: MYSQL_COM_PING\n", info->thread_id);
|
||||
case COM_PING:
|
||||
printf("%8d: COM_PING\n", info->thread_id);
|
||||
break;
|
||||
case MYSQL_COM_STMT_EXECUTE:
|
||||
case MYSQL_COM_STMT_RESET:
|
||||
case MYSQL_COM_STMT_CLOSE:
|
||||
case COM_STMT_EXECUTE:
|
||||
case COM_STMT_RESET:
|
||||
case COM_STMT_CLOSE:
|
||||
info->refid= uint4korr(p);
|
||||
break;
|
||||
case MYSQL_COM_CHANGE_USER:
|
||||
case COM_CHANGE_USER:
|
||||
break;
|
||||
default:
|
||||
if (info->local_infile == 1)
|
||||
@@ -396,24 +396,24 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
is_error= ((unsigned int)len == -1);
|
||||
|
||||
switch(info->last_command) {
|
||||
case MYSQL_COM_STMT_EXECUTE:
|
||||
case MYSQL_COM_STMT_RESET:
|
||||
case MYSQL_COM_STMT_CLOSE:
|
||||
case MYSQL_COM_PROCESS_KILL:
|
||||
case COM_STMT_EXECUTE:
|
||||
case COM_STMT_RESET:
|
||||
case COM_STMT_CLOSE:
|
||||
case COM_PROCESS_KILL:
|
||||
dump_reference(info, is_error);
|
||||
info->refid= 0;
|
||||
info->last_command= 0;
|
||||
break;
|
||||
case MYSQL_COM_QUIT:
|
||||
case COM_QUIT:
|
||||
dump_simple(info, is_error);
|
||||
break;
|
||||
case MYSQL_COM_QUERY:
|
||||
case MYSQL_COM_INIT_DB:
|
||||
case MYSQL_COM_DROP_DB:
|
||||
case MYSQL_COM_CREATE_DB:
|
||||
case MYSQL_COM_DEBUG:
|
||||
case MYSQL_COM_CHANGE_USER:
|
||||
if (info->last_command == MYSQL_COM_QUERY && (uchar)*p == 251)
|
||||
case COM_QUERY:
|
||||
case COM_INIT_DB:
|
||||
case COM_DROP_DB:
|
||||
case COM_CREATE_DB:
|
||||
case COM_DEBUG:
|
||||
case COM_CHANGE_USER:
|
||||
if (info->last_command == COM_QUERY && (uchar)*p == 251)
|
||||
{
|
||||
info->local_infile= 1;
|
||||
p++;
|
||||
@@ -429,8 +429,8 @@ void trace_callback(int mode, MYSQL *mysql, const uchar *buffer, size_t length)
|
||||
info->command= NULL;
|
||||
}
|
||||
break;
|
||||
case MYSQL_COM_STMT_PREPARE:
|
||||
printf("%8d: MYSQL_COM_STMT_PREPARE(%s) ", info->thread_id, info->command);
|
||||
case COM_STMT_PREPARE:
|
||||
printf("%8d: COM_STMT_PREPARE(%s) ", info->thread_id, info->command);
|
||||
if (!*p)
|
||||
{
|
||||
unsigned long stmt_id= uint4korr(p+1);
|
||||
|
@@ -101,7 +101,7 @@ struct my_tests_st
|
||||
char *skipmsg;
|
||||
};
|
||||
|
||||
static char *schema = "test";
|
||||
static char *schema = "test_c";
|
||||
static char *hostname = 0;
|
||||
static char *password = 0;
|
||||
static unsigned int port = 0;
|
||||
@@ -390,7 +390,7 @@ MYSQL *test_connect(struct my_tests_st *test) {
|
||||
}
|
||||
}
|
||||
if (!(mysql_real_connect(mysql, hostname, username, password,
|
||||
schema, port, socketname, (test) ? test->connect_flags:0)))
|
||||
NULL, port, socketname, (test) ? test->connect_flags:0)))
|
||||
{
|
||||
diag("Couldn't establish connection to server %s. Error (%d): %s",
|
||||
hostname, mysql_errno(mysql), mysql_error(mysql));
|
||||
|
Reference in New Issue
Block a user