summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorunknown <df@pippilotta.erinye.com>2007-08-03 17:15:23 +0200
committerunknown <df@pippilotta.erinye.com>2007-08-03 17:15:23 +0200
commitd63ec0931de1c22f54e2e633442293799bf5cdf2 (patch)
tree41392b6e41e1b68bd6aeb6fb0853704e5a98ce3a /include
parent705e7a748ec2e0126297627a2186dad08b637e16 (diff)
parentf338fd010a0a29e4c52c41b3ef4962f36be6a1d1 (diff)
downloadmariadb-git-d63ec0931de1c22f54e2e633442293799bf5cdf2.tar.gz
Merge bk-internal:/home/bk/mysql-5.1-marvel
into pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-marvel-engines BitKeeper/etc/ignore: auto-union configure.in: Auto merged BitKeeper/deleted/.del-CMakeLists.txt~99a50df6: Auto merged client/mysqlbinlog.cc: Auto merged client/mysqldump.c: Auto merged include/mysql.h: Auto merged mysql-test/t/disabled.def: Auto merged sql/field.cc: Auto merged sql/field.h: Auto merged sql/ha_ndbcluster_binlog.cc: Auto merged sql/handler.cc: Auto merged sql/item.h: Auto merged sql/log.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/mysqld.cc: Auto merged sql/set_var.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_show.cc: Auto merged sql/sql_table.cc: Auto merged sql/table.cc: Auto merged sql/sql_parse.cc: merge fix sql/sql_select.cc: merge fix
Diffstat (limited to 'include')
-rw-r--r--include/heap.h5
-rw-r--r--include/keycache.h6
-rw-r--r--include/my_base.h2
-rw-r--r--include/my_getopt.h1
-rw-r--r--include/my_sys.h10
-rw-r--r--include/mysql.h55
-rw-r--r--include/mysql/plugin.h2
-rw-r--r--include/mysql_com.h27
8 files changed, 65 insertions, 43 deletions
diff --git a/include/heap.h b/include/heap.h
index d309fb4f162..4a1c7d419ed 100644
--- a/include/heap.h
+++ b/include/heap.h
@@ -189,11 +189,14 @@ typedef struct st_heap_create_info
ulonglong max_table_size;
ulonglong auto_increment;
my_bool with_auto_increment;
+ my_bool internal_table;
} HP_CREATE_INFO;
/* Prototypes for heap-functions */
extern HP_INFO *heap_open(const char *name, int mode);
+extern HP_INFO *heap_open_from_share(HP_SHARE *share, int mode);
+extern HP_INFO *heap_open_from_share_and_register(HP_SHARE *share, int mode);
extern int heap_close(HP_INFO *info);
extern int heap_write(HP_INFO *info,const uchar *buff);
extern int heap_update(HP_INFO *info,const uchar *old,const uchar *newdata);
@@ -204,7 +207,7 @@ extern int heap_delete(HP_INFO *info,const uchar *buff);
extern int heap_info(HP_INFO *info,HEAPINFO *x,int flag);
extern int heap_create(const char *name, uint keys, HP_KEYDEF *keydef,
uint reclength, ulong max_records, ulong min_records,
- HP_CREATE_INFO *create_info);
+ HP_CREATE_INFO *create_info, HP_SHARE **share);
extern int heap_delete_table(const char *name);
extern void heap_drop_table(HP_INFO *info);
extern int heap_extra(HP_INFO *info,enum ha_extra_function function);
diff --git a/include/keycache.h b/include/keycache.h
index 7f4ce86cea0..a6005bae878 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -47,7 +47,7 @@ typedef struct st_key_cache
my_bool in_resize; /* true during resize operation */
my_bool resize_in_flush; /* true during flush of resize operation */
my_bool can_be_used; /* usage of cache for read/write is allowed */
- ulong key_cache_mem_size; /* specified size of the cache memory */
+ size_t key_cache_mem_size; /* specified size of the cache memory */
uint key_cache_block_size; /* size of the page buffer of a cache block */
ulong min_warm_blocks; /* min number of warm blocks; */
ulong age_threshold; /* age threshold for hot blocks */
@@ -107,10 +107,10 @@ typedef struct st_key_cache
extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
- ulong use_mem, uint division_limit,
+ size_t use_mem, uint division_limit,
uint age_threshold);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
uint age_threshold);
diff --git a/include/my_base.h b/include/my_base.h
index 04127b81b78..339554979a8 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -48,6 +48,8 @@
#define HA_OPEN_FOR_REPAIR 32 /* open even if crashed */
#define HA_OPEN_FROM_SQL_LAYER 64
#define HA_OPEN_MMAP 128 /* open memory mapped */
+/* Internal temp table, used for temporary results */
+#define HA_OPEN_INTERNAL_TABLE 256
/* The following is parameter to ha_rkey() how to use key */
diff --git a/include/my_getopt.h b/include/my_getopt.h
index 115abf00618..c74f3ed672e 100644
--- a/include/my_getopt.h
+++ b/include/my_getopt.h
@@ -31,6 +31,7 @@ C_MODE_START
#define GET_DISABLED 11
#define GET_ENUM 12
#define GET_SET 13
+#define GET_DOUBLE 14
#define GET_ASK_ADDR 128
#define GET_TYPE_MASK 127
diff --git a/include/my_sys.h b/include/my_sys.h
index fb949842e48..76c9a7f02c7 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -150,7 +150,7 @@ extern ulonglong sf_malloc_mem_limit;
#else
#define my_checkmalloc()
#undef TERMINATE
-#define TERMINATE(A) {}
+#define TERMINATE(A,B) {}
#define QUICK_SAFEMALLOC
#define NORMAL_SAFEMALLOC
extern void *my_malloc(size_t Size,myf MyFlags);
@@ -618,7 +618,7 @@ extern int nt_share_delete(const char *name,myf MyFlags);
#endif
#ifndef TERMINATE
-extern void TERMINATE(FILE *file);
+extern void TERMINATE(FILE *file, uint flag);
#endif
extern void init_glob_errs(void);
extern FILE *my_fopen(const char *FileName,int Flags,myf MyFlags);
@@ -833,7 +833,7 @@ extern my_bool my_compress(uchar *, size_t *, size_t *);
extern my_bool my_uncompress(uchar *, size_t , size_t *);
extern uchar *my_compress_alloc(const uchar *packet, size_t *len,
size_t *complen);
-extern int packfrm(const uchar *, size_t, uchar **, size_t *);
+extern int packfrm(uchar *, size_t, uchar **, size_t *);
extern int unpackfrm(uchar **, size_t *, const uchar *);
extern ha_checksum my_checksum(ha_checksum crc, const uchar *mem,
@@ -846,7 +846,11 @@ extern void my_sleep(ulong m_seconds);
extern uint my_set_max_open_files(uint files);
void my_free_open_file_info(void);
+extern time_t my_time(myf flags);
extern ulonglong my_getsystime(void);
+extern ulonglong my_micro_time();
+extern ulonglong my_micro_time_and_time(time_t *time_arg);
+time_t my_time_possible_from_micro(ulonglong microtime);
extern my_bool my_gethwaddr(uchar *to);
extern int my_getncpus();
diff --git a/include/mysql.h b/include/mysql.h
index da97531509f..68cce3196a0 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -113,6 +113,7 @@ typedef struct st_mysql_field {
unsigned int decimals; /* Number of decimals in field */
unsigned int charsetnr; /* Character set */
enum enum_field_types type; /* Type of field. See mysql_com.h for types */
+ void *extension;
} MYSQL_FIELD;
typedef char **MYSQL_ROW; /* return data as array of strings */
@@ -147,12 +148,13 @@ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
typedef struct embedded_query_result EMBEDDED_QUERY_RESULT;
typedef struct st_mysql_data {
- my_ulonglong rows;
- unsigned int fields;
MYSQL_ROWS *data;
+ struct embedded_query_result *embedded_info;
MEM_ROOT alloc;
+ my_ulonglong rows;
+ unsigned int fields;
/* extra info for embedded library */
- struct embedded_query_result *embedded_info;
+ void *extension;
} MYSQL_DATA;
enum mysql_option
@@ -215,6 +217,7 @@ struct st_mysql_options {
void (*local_infile_end)(void *);
int (*local_infile_error)(void *, char *, unsigned int);
void *local_infile_userdata;
+ void *extension;
};
enum mysql_status
@@ -304,27 +307,28 @@ typedef struct st_mysql
from mysql_stmt_close if close had to cancel result set of this object.
*/
my_bool *unbuffered_fetch_owner;
-#if defined(EMBEDDED_LIBRARY) || defined(EMBEDDED_LIBRARY_COMPATIBLE) || MYSQL_VERSION_ID >= 50100
/* needed for embedded server - no net buffer to store the 'info' */
char *info_buffer;
-#endif
+ void *extension;
} MYSQL;
+
typedef struct st_mysql_res {
- my_ulonglong row_count;
+ my_ulonglong row_count;
MYSQL_FIELD *fields;
MYSQL_DATA *data;
MYSQL_ROWS *data_cursor;
unsigned long *lengths; /* column lengths of current row */
MYSQL *handle; /* for unbuffered reads */
- MEM_ROOT field_alloc;
- unsigned int field_count, current_field;
+ const struct st_mysql_methods *methods;
MYSQL_ROW row; /* If unbuffered read */
MYSQL_ROW current_row; /* buffer to current row */
+ MEM_ROOT field_alloc;
+ unsigned int field_count, current_field;
my_bool eof; /* Used by mysql_fetch_row */
/* mysql_stmt_close() had to cancel this result */
my_bool unbuffered_fetch_cancelled;
- const struct st_mysql_methods *methods;
+ void *extension;
} MYSQL_RES;
#define MAX_MYSQL_MANAGER_ERR 256
@@ -344,21 +348,23 @@ typedef struct st_mysql_res {
typedef struct st_mysql_manager
{
NET net;
- char *host,*user,*passwd;
+ char *host, *user, *passwd;
+ char *net_buf, *net_buf_pos, *net_data_end;
unsigned int port;
- my_bool free_me;
- my_bool eof;
int cmd_status;
int last_errno;
- char* net_buf,*net_buf_pos,*net_data_end;
int net_buf_size;
+ my_bool free_me;
+ my_bool eof;
char last_error[MAX_MYSQL_MANAGER_ERR];
+ void *extension;
} MYSQL_MANAGER;
typedef struct st_mysql_parameters
{
unsigned long *p_max_allowed_packet;
unsigned long *p_net_buffer_length;
+ void *extension;
} MYSQL_PARAMETERS;
#if !defined(MYSQL_SERVER) && !defined(EMBEDDED_LIBRARY)
@@ -373,6 +379,7 @@ typedef struct st_mysql_parameters
*/
int STDCALL mysql_server_init(int argc, char **argv, char **groups);
void STDCALL mysql_server_end(void);
+
/*
mysql_server_init/end need to be called when using libmysqld or
libmysqlclient (exactly, mysql_server_init() is called by mysql_init() so
@@ -661,23 +668,24 @@ typedef struct st_mysql_bind
void *buffer; /* buffer to get/put data */
/* set this if you want to track data truncations happened during fetch */
my_bool *error;
- enum enum_field_types buffer_type; /* buffer type */
+ unsigned char *row_ptr; /* for the current data position */
+ void (*store_param_func)(NET *net, struct st_mysql_bind *param);
+ void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
+ unsigned char **row);
+ void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
+ unsigned char **row);
/* output buffer length, must be set when fetching str/binary */
unsigned long buffer_length;
- unsigned char *row_ptr; /* for the current data position */
unsigned long offset; /* offset position for char/binary fetch */
unsigned long length_value; /* Used if length is 0 */
unsigned int param_number; /* For null count and error messages */
unsigned int pack_length; /* Internal length for packed data */
+ enum enum_field_types buffer_type; /* buffer type */
my_bool error_value; /* used if error is 0 */
my_bool is_unsigned; /* set if integer type is unsigned */
my_bool long_data_used; /* If used with mysql_send_long_data */
my_bool is_null_value; /* Used if is_null is 0 */
- void (*store_param_func)(NET *net, struct st_mysql_bind *param);
- void (*fetch_result)(struct st_mysql_bind *, MYSQL_FIELD *,
- unsigned char **row);
- void (*skip_result)(struct st_mysql_bind *, MYSQL_FIELD *,
- unsigned char **row);
+ void *extension;
} MYSQL_BIND;
@@ -692,15 +700,15 @@ typedef struct st_mysql_stmt
MYSQL_FIELD *fields; /* result set metadata */
MYSQL_DATA result; /* cached result set */
MYSQL_ROWS *data_cursor; /* current row in cached result */
- /* copy of mysql->affected_rows after statement execution */
- my_ulonglong affected_rows;
- my_ulonglong insert_id; /* copy of mysql->insert_id */
/*
mysql_stmt_fetch() calls this function to fetch one row (it's different
for buffered, unbuffered and cursor fetch).
*/
int (*read_row_func)(struct st_mysql_stmt *stmt,
unsigned char **row);
+ /* copy of mysql->affected_rows after statement execution */
+ my_ulonglong affected_rows;
+ my_ulonglong insert_id; /* copy of mysql->insert_id */
unsigned long stmt_id; /* Id for prepared statement */
unsigned long flags; /* i.e. type of cursor to open */
unsigned long prefetch_rows; /* number of rows per one COM_FETCH */
@@ -726,6 +734,7 @@ typedef struct st_mysql_stmt
metadata fields when doing mysql_stmt_store_result.
*/
my_bool update_max_length;
+ void *extension;
} MYSQL_STMT;
enum enum_stmt_attr_type
diff --git a/include/mysql/plugin.h b/include/mysql/plugin.h
index b87fcc60692..541fa7dfbe6 100644
--- a/include/mysql/plugin.h
+++ b/include/mysql/plugin.h
@@ -110,7 +110,7 @@ enum enum_mysql_show_type
{
SHOW_UNDEF, SHOW_BOOL, SHOW_INT, SHOW_LONG,
SHOW_LONGLONG, SHOW_CHAR, SHOW_CHAR_PTR,
- SHOW_ARRAY, SHOW_FUNC
+ SHOW_ARRAY, SHOW_FUNC, SHOW_DOUBLE
};
struct st_mysql_show_var {
diff --git a/include/mysql_com.h b/include/mysql_com.h
index ae57e84a696..5850d48fbf5 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -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 */