You've already forked mariadb-connector-c
mirror of
https://github.com/mariadb-corporation/mariadb-connector-c.git
synced 2025-08-08 14:02:17 +03:00
Fixes for DBD:mysql (CONC-57)
added missing functions mysql_read_query_result and mysql_get_parameters
This commit is contained in:
@@ -341,6 +341,16 @@ typedef struct character_set
|
|||||||
unsigned int mbmaxlen; /* max. length for multibyte strings */
|
unsigned int mbmaxlen; /* max. length for multibyte strings */
|
||||||
} MY_CHARSET_INFO;
|
} MY_CHARSET_INFO;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
unsigned long *p_max_allowed_packet;
|
||||||
|
unsigned long *p_net_buffer_length;
|
||||||
|
void *extension;
|
||||||
|
} MYSQL_PARAMETERS;
|
||||||
|
|
||||||
|
#define net_buffer_length (*mysql_get_parameters()->p_net_buffer_length)
|
||||||
|
#define max_allowed_packet (*mysql_get_parameters()->p_max_allowed_packet)
|
||||||
|
|
||||||
/* Local infile support functions */
|
/* Local infile support functions */
|
||||||
#define LOCAL_INFILE_ERROR_LEN 512
|
#define LOCAL_INFILE_ERROR_LEN 512
|
||||||
|
|
||||||
@@ -405,7 +415,7 @@ int STDCALL mysql_select_db(MYSQL *mysql, const char *db);
|
|||||||
int STDCALL mysql_query(MYSQL *mysql, const char *q);
|
int STDCALL mysql_query(MYSQL *mysql, const char *q);
|
||||||
int STDCALL mysql_send_query(MYSQL *mysql, const char *q,
|
int STDCALL mysql_send_query(MYSQL *mysql, const char *q,
|
||||||
unsigned long length);
|
unsigned long length);
|
||||||
int STDCALL mysql_read_query_result(MYSQL *mysql);
|
my_bool STDCALL mysql_read_query_result(MYSQL *mysql);
|
||||||
int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
|
int STDCALL mysql_real_query(MYSQL *mysql, const char *q,
|
||||||
unsigned long length);
|
unsigned long length);
|
||||||
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
|
int STDCALL mysql_create_db(MYSQL *mysql, const char *DB);
|
||||||
@@ -467,6 +477,7 @@ size_t STDCALL mariadb_convert_string(const char *from, size_t *from_len, CHARSE
|
|||||||
char *to, size_t *to_len, CHARSET_INFO *to_cs, int *errorcode);
|
char *to, size_t *to_len, CHARSET_INFO *to_cs, int *errorcode);
|
||||||
int STDCALL mysql_options4(MYSQL *mysql,enum mysql_option option,
|
int STDCALL mysql_options4(MYSQL *mysql,enum mysql_option option,
|
||||||
const void *arg1, const void *arg2);
|
const void *arg1, const void *arg2);
|
||||||
|
MYSQL_PARAMETERS *STDCALL mysql_get_parameters(void);
|
||||||
|
|
||||||
#include <my_stmt.h>
|
#include <my_stmt.h>
|
||||||
|
|
||||||
|
@@ -69,6 +69,13 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <ma_dyncol.h>
|
#include <ma_dyncol.h>
|
||||||
|
|
||||||
|
#undef max_allowed_packet
|
||||||
|
#undef net_buffer_length
|
||||||
|
extern ulong max_allowed_packet; /* net.c */
|
||||||
|
extern ulong net_buffer_length; /* net.c */
|
||||||
|
static MYSQL_PARAMETERS mariadb_internal_parameters=
|
||||||
|
{&max_allowed_packet, &net_buffer_length, 0};
|
||||||
|
|
||||||
static my_bool mysql_client_init=0;
|
static my_bool mysql_client_init=0;
|
||||||
static void mysql_close_options(MYSQL *mysql);
|
static void mysql_close_options(MYSQL *mysql);
|
||||||
extern my_bool my_init_done;
|
extern my_bool my_init_done;
|
||||||
@@ -2233,7 +2240,7 @@ int mthd_my_read_query_result(MYSQL *mysql)
|
|||||||
ulong field_count;
|
ulong field_count;
|
||||||
MYSQL_DATA *fields;
|
MYSQL_DATA *fields;
|
||||||
ulong length;
|
ulong length;
|
||||||
DBUG_ENTER("mysql_read_query_result");
|
DBUG_ENTER("mthd_my_read_query_result");
|
||||||
|
|
||||||
if (!mysql || (length = net_safe_read(mysql)) == packet_error)
|
if (!mysql || (length = net_safe_read(mysql)) == packet_error)
|
||||||
DBUG_RETURN(1);
|
DBUG_RETURN(1);
|
||||||
@@ -2276,6 +2283,12 @@ get_info:
|
|||||||
DBUG_RETURN(0);
|
DBUG_RETURN(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
my_bool STDCALL
|
||||||
|
mysql_read_query_result(MYSQL *mysql)
|
||||||
|
{
|
||||||
|
return test(mysql->methods->db_read_query_result(mysql)) ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
int STDCALL
|
int STDCALL
|
||||||
mysql_real_query(MYSQL *mysql, const char *query, unsigned long length)
|
mysql_real_query(MYSQL *mysql, const char *query, unsigned long length)
|
||||||
{
|
{
|
||||||
@@ -3377,6 +3390,12 @@ mysql_get_server_name(MYSQL *mysql)
|
|||||||
return mariadb_connection(mysql) ? "MariaDB" : "MySQL";
|
return mariadb_connection(mysql) ? "MariaDB" : "MySQL";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MYSQL_PARAMETERS *STDCALL
|
||||||
|
mysql_get_parameters(void)
|
||||||
|
{
|
||||||
|
return &mariadb_internal_parameters;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default methods for a connection. These methods are
|
* Default methods for a connection. These methods are
|
||||||
* stored in mysql->methods and can be overwritten by
|
* stored in mysql->methods and can be overwritten by
|
||||||
|
@@ -59,6 +59,7 @@ EXPORTS
|
|||||||
mysql_ping
|
mysql_ping
|
||||||
mysql_stmt_result_metadata
|
mysql_stmt_result_metadata
|
||||||
mysql_query
|
mysql_query
|
||||||
|
mysql_read_query_result
|
||||||
mysql_real_connect
|
mysql_real_connect
|
||||||
mysql_real_escape_string
|
mysql_real_escape_string
|
||||||
mysql_real_query
|
mysql_real_query
|
||||||
@@ -109,6 +110,7 @@ EXPORTS
|
|||||||
mysql_get_server_name
|
mysql_get_server_name
|
||||||
mysql_get_charset_by_name
|
mysql_get_charset_by_name
|
||||||
mysql_get_charset_by_nr
|
mysql_get_charset_by_nr
|
||||||
|
mysql_get_parameters
|
||||||
mariadb_convert_string
|
mariadb_convert_string
|
||||||
mariadb_dyncol_free
|
mariadb_dyncol_free
|
||||||
mariadb_dyncol_create_many_num
|
mariadb_dyncol_create_many_num
|
||||||
|
@@ -37,6 +37,11 @@
|
|||||||
|
|
||||||
#define MAX_PACKET_LENGTH (256L*256L*256L-1)
|
#define MAX_PACKET_LENGTH (256L*256L*256L-1)
|
||||||
|
|
||||||
|
/* net_buffer_length and max_allowec_packet are defined in mysql.h
|
||||||
|
See bug conc-57
|
||||||
|
*/
|
||||||
|
#undef net_buffer_length
|
||||||
|
#undef max_allowed_packet
|
||||||
ulong max_allowed_packet=1024L * 1024L * 1024L;
|
ulong max_allowed_packet=1024L * 1024L * 1024L;
|
||||||
ulong net_read_timeout= NET_READ_TIMEOUT;
|
ulong net_read_timeout= NET_READ_TIMEOUT;
|
||||||
ulong net_write_timeout= NET_WRITE_TIMEOUT;
|
ulong net_write_timeout= NET_WRITE_TIMEOUT;
|
||||||
|
@@ -36,6 +36,7 @@ global:
|
|||||||
mysql_get_client_info;
|
mysql_get_client_info;
|
||||||
mysql_get_host_info;
|
mysql_get_host_info;
|
||||||
mysql_get_proto_info;
|
mysql_get_proto_info;
|
||||||
|
mysql_get_parameters;
|
||||||
mysql_get_server_info;
|
mysql_get_server_info;
|
||||||
mysql_get_client_version;
|
mysql_get_client_version;
|
||||||
mysql_get_ssl_cipher;
|
mysql_get_ssl_cipher;
|
||||||
|
@@ -597,7 +597,7 @@ int test_connection_timeout(MYSQL *my)
|
|||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
elapsed= time(NULL) - start;
|
elapsed= time(NULL) - start;
|
||||||
diag("elapsed: %d, timeout: %d", elapsed, timeout);
|
diag("elapsed: %u", elapsed);
|
||||||
mysql_close(mysql);
|
mysql_close(mysql);
|
||||||
FAIL_IF(elapsed > timeout + 1, "timeout ignored")
|
FAIL_IF(elapsed > timeout + 1, "timeout ignored")
|
||||||
return OK;
|
return OK;
|
||||||
|
Reference in New Issue
Block a user