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
removed ma_errmsg from mysql.h
This commit is contained in:
@@ -60,7 +60,6 @@ typedef int my_socket;
|
||||
#include "mariadb_version.h"
|
||||
#include "ma_list.h"
|
||||
#include "mariadb_ctype.h"
|
||||
#include "ma_errmsg.h"
|
||||
|
||||
#ifndef ST_MA_USED_MEM_DEFINED
|
||||
#define ST_MA_USED_MEM_DEFINED
|
||||
|
@@ -16,11 +16,11 @@
|
||||
MA 02111-1307, USA */
|
||||
|
||||
/* Write and read of logical packets to/from socket
|
||||
** Writes are cached into net_buffer_length big packets.
|
||||
** Read packets are reallocated dynamicly when reading big packets.
|
||||
** Each logical packet has the following pre-info:
|
||||
** 3 byte length & 1 byte package-number.
|
||||
*/
|
||||
** Writes are cached into net_buffer_length big packets.
|
||||
** Read packets are reallocated dynamicly when reading big packets.
|
||||
** Each logical packet has the following pre-info:
|
||||
** 3 byte length & 1 byte package-number.
|
||||
*/
|
||||
|
||||
|
||||
#include <ma_global.h>
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
/* net_buffer_length and max_allowed_packet are defined in mysql.h
|
||||
See bug conc-57
|
||||
*/
|
||||
*/
|
||||
#undef net_buffer_length
|
||||
|
||||
#undef max_allowed_packet
|
||||
@@ -68,15 +68,15 @@ ulong net_buffer_length= 8192; /* Default length. Enlarged if necessary */
|
||||
|
||||
|
||||
/*
|
||||
** Give error if a too big packet is found
|
||||
** The server can change this with the -O switch, but because the client
|
||||
** can't normally do this the client should have a bigger max-buffer.
|
||||
*/
|
||||
** Give error if a too big packet is found
|
||||
** The server can change this with the -O switch, but because the client
|
||||
** can't normally do this the client should have a bigger max-buffer.
|
||||
*/
|
||||
|
||||
static int ma_net_write_buff(NET *net,const char *packet, size_t len);
|
||||
|
||||
|
||||
/* Init with packet info */
|
||||
/* Init with packet info */
|
||||
|
||||
int ma_net_init(NET *net, MARIADB_PVIO* pvio)
|
||||
{
|
||||
@@ -176,18 +176,17 @@ int ma_net_flush(NET *net)
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
** Write something to server/client buffer
|
||||
*****************************************************************************/
|
||||
** Write something to server/client buffer
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
** Write a logical packet with packet header
|
||||
** Format: Packet length (3 bytes), packet number(1 byte)
|
||||
** When compression is used a 3 byte compression length is added
|
||||
** NOTE: If compression is used the original package is destroyed!
|
||||
*/
|
||||
** Write a logical packet with packet header
|
||||
** Format: Packet length (3 bytes), packet number(1 byte)
|
||||
** When compression is used a 3 byte compression length is added
|
||||
** NOTE: If compression is used the original package is destroyed!
|
||||
*/
|
||||
|
||||
int
|
||||
ma_net_write(NET *net, const uchar *packet, size_t len)
|
||||
int ma_net_write(NET *net, const uchar *packet, size_t len)
|
||||
{
|
||||
uchar buff[NET_HEADER_SIZE];
|
||||
while (len >= MAX_PACKET_LENGTH)
|
||||
@@ -210,8 +209,7 @@ ma_net_write(NET *net, const uchar *packet, size_t len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
ma_net_write_command(NET *net, uchar command,
|
||||
int ma_net_write_command(NET *net, uchar command,
|
||||
const char *packet, size_t len,
|
||||
my_bool disable_flush)
|
||||
{
|
||||
@@ -251,8 +249,7 @@ ma_net_write_command(NET *net, uchar command,
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
ma_net_write_buff(NET *net,const char *packet, size_t len)
|
||||
static int ma_net_write_buff(NET *net,const char *packet, size_t len)
|
||||
{
|
||||
size_t left_length;
|
||||
|
||||
@@ -299,8 +296,7 @@ unsigned char *mysql_net_store_length(unsigned char *packet, size_t length);
|
||||
|
||||
/* Read and write using timeouts */
|
||||
|
||||
int
|
||||
ma_net_real_write(NET *net,const char *packet,size_t len)
|
||||
int ma_net_real_write(NET *net, const char *packet, size_t len)
|
||||
{
|
||||
ssize_t length;
|
||||
char *pos,*end;
|
||||
@@ -357,10 +353,9 @@ ma_net_real_write(NET *net,const char *packet,size_t len)
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
** Read something from server/clinet
|
||||
*****************************************************************************/
|
||||
static ulong
|
||||
ma_real_read(NET *net, size_t *complen)
|
||||
** Read something from server/clinet
|
||||
*****************************************************************************/
|
||||
static ulong ma_real_read(NET *net, size_t *complen)
|
||||
{
|
||||
uchar *pos;
|
||||
ssize_t length;
|
||||
@@ -387,6 +382,7 @@ ma_real_read(NET *net, size_t *complen)
|
||||
remain -= (ulong) length;
|
||||
pos+= (ulong) length;
|
||||
}
|
||||
|
||||
if (i == 0)
|
||||
{ /* First parts is packet length */
|
||||
ulong helping;
|
||||
@@ -460,7 +456,7 @@ ulong ma_net_read(NET *net)
|
||||
compressed protocol:
|
||||
|
||||
--------------------------------------
|
||||
packet_lengt h 3
|
||||
packet_length 3
|
||||
sequence_id 1
|
||||
uncompressed_length 3
|
||||
--------------------------------------
|
||||
@@ -585,6 +581,7 @@ int net_add_multi_command(NET *net, uchar command, const uchar *packet,
|
||||
{
|
||||
return(1);
|
||||
}
|
||||
/* don't increase packet number */
|
||||
net->compress_pkt_nr= net->pkt_nr= 0;
|
||||
return ma_net_write_command(net, command, (const char *)packet, length, 1);
|
||||
}
|
||||
|
@@ -193,7 +193,7 @@ restart:
|
||||
my_set_error(mysql, net->last_errno == ER_NET_PACKET_TOO_LARGE ?
|
||||
CR_NET_PACKET_TOO_LARGE:
|
||||
CR_SERVER_LOST,
|
||||
SQLSTATE_UNKNOWN, 0);
|
||||
SQLSTATE_UNKNOWN, 0, errno);
|
||||
return(packet_error);
|
||||
}
|
||||
if (net->read_pos[0] == 255)
|
||||
|
@@ -129,12 +129,9 @@ static int bulk1(MYSQL *mysql)
|
||||
mysql_free_result(res);
|
||||
FAIL_IF(intval != array_size - 1, "Expected max value 1024");
|
||||
|
||||
/*
|
||||
rc= mysql_query(mysql, "DROP TABLE IF EXISTS bulk1");
|
||||
check_mysql_rc(rc, mysql);
|
||||
*/
|
||||
return OK;
|
||||
|
||||
}
|
||||
|
||||
static int bulk2(MYSQL *mysql)
|
||||
|
Reference in New Issue
Block a user