1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Add 'extension' field to all client library structures to make them extensible

Reorder structure elements to make structures smaller and faster on 64 bit systems
This is a first step in cleaning up the client include files (but should be enough to allow us to do future fixes without breaking the library)
This change is part of WL#2872,  Make client library extensible.
This commit is contained in:
monty@mysql.com/nosik.monty.fi
2007-07-30 06:22:25 +03:00
parent dd81895e45
commit a33c863ffd
3 changed files with 55 additions and 42 deletions

View File

@@ -186,25 +186,25 @@ typedef struct st_vio Vio;
typedef struct st_net {
#if !defined(CHECK_EMBEDDED_DIFFERENCES) || !defined(EMBEDDED_LIBRARY)
Vio* vio;
Vio *vio;
unsigned char *buff,*buff_end,*write_pos,*read_pos;
my_socket fd; /* For Perl DBI/dbd */
unsigned long max_packet,max_packet_size;
unsigned int pkt_nr,compress_pkt_nr;
unsigned int write_timeout, read_timeout, retry_count;
int fcntl;
my_bool compress;
/*
The following variable is set if we are doing several queries in one
command ( as in LOAD TABLE ... FROM MASTER ),
and do not want to confuse the client with OK at the wrong time
*/
unsigned long remain_in_buf,length, buf_length, where_b;
unsigned long max_packet,max_packet_size;
unsigned int pkt_nr,compress_pkt_nr;
unsigned int write_timeout, read_timeout, retry_count;
int fcntl;
unsigned int *return_status;
unsigned char reading_or_writing;
char save_char;
my_bool no_send_ok; /* For SPs and other things that do multiple stmts */
my_bool no_send_eof; /* For SPs' first version read-only cursors */
my_bool compress;
/*
Set if OK packet is already sent, and we do not need to send error
messages
@@ -215,20 +215,20 @@ typedef struct st_net {
queries in cache that have not stored its results yet
*/
#endif
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
unsigned int last_errno;
unsigned char error;
/*
'query_cache_query' should be accessed only via query cache
functions and methods to maintain proper locking.
*/
unsigned char *query_cache_query;
unsigned int last_errno;
unsigned char error;
my_bool report_error; /* We should report error (we have unreported error) */
my_bool return_errno;
char last_error[MYSQL_ERRMSG_SIZE], sqlstate[SQLSTATE_LENGTH+1];
void *extension;
} NET;
#define packet_error (~(unsigned long) 0)
enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
@@ -389,6 +389,7 @@ typedef struct st_udf_args
char *maybe_null; /* Set to 1 for all maybe_null args */
char **attributes; /* Pointer to attribute name */
unsigned long *attribute_lengths; /* Length of attribute arguments */
void *extension;
} UDF_ARGS;
/* This holds information about the result */
@@ -399,7 +400,9 @@ typedef struct st_udf_init
unsigned int decimals; /* for real functions */
unsigned long max_length; /* For string functions */
char *ptr; /* free pointer for function data */
my_bool const_item; /* 0 if result is independent of arguments */
/* 0 if result is independent of arguments */
my_bool const_item;
void *extension;
} UDF_INIT;
/* Constants when using compression */