summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/my_base.h10
-rw-r--r--include/my_no_pthread.h6
-rw-r--r--include/my_sys.h31
-rw-r--r--include/myisam.h10
-rw-r--r--include/mysql.h3
-rw-r--r--include/mysql_com.h12
-rw-r--r--include/mysqld_error.h3
7 files changed, 50 insertions, 25 deletions
diff --git a/include/my_base.h b/include/my_base.h
index 4c3e53c4573..a1744f37bc6 100644
--- a/include/my_base.h
+++ b/include/my_base.h
@@ -126,14 +126,14 @@ enum ha_extra_function {
HA_EXTRA_RESET_STATE, /* Reset positions */
HA_EXTRA_IGNORE_DUP_KEY, /* Dup keys don't rollback everything*/
HA_EXTRA_NO_IGNORE_DUP_KEY,
- HA_EXTRA_RETRIEVE_ALL_COLS, /* Instructs InnoDB to retrieve all
- columns, not just those where
- field->query_id is the same as the
- current query id */
+ /*
+ Instructs InnoDB to retrieve all columns, not just those where
+ field->query_id is the same as the current query id
+ */
+ HA_EXTRA_RETRIEVE_ALL_COLS,
HA_EXTRA_PREPARE_FOR_DELETE,
HA_EXTRA_PREPARE_FOR_UPDATE, /* Remove read cache if problems */
HA_EXTRA_PRELOAD_BUFFER_SIZE, /* Set buffer size for preloading */
- HA_EXTRA_SET_KEY_CACHE /* Set ref to assigned key cache */
};
/* The following is parameter to ha_panic() */
diff --git a/include/my_no_pthread.h b/include/my_no_pthread.h
index 0a034f78192..2c9cde65e78 100644
--- a/include/my_no_pthread.h
+++ b/include/my_no_pthread.h
@@ -27,5 +27,9 @@
#define pthread_mutex_lock(A)
#define pthread_mutex_unlock(A)
#define pthread_mutex_destroy(A)
-
+#define my_rwlock_init(A,B)
+#define rw_rdlock(A)
+#define rw_wrlock(A)
+#define rw_unlock(A)
+#define rwlock_destroy(A)
#endif
diff --git a/include/my_sys.h b/include/my_sys.h
index 6082b988822..25c450e5d2b 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000 MySQL AB
+/* Copyright (C) 2000-2003 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -111,6 +111,7 @@ extern int NEAR my_errno; /* Last error in mysys */
#define MY_WAIT_FOR_USER_TO_FIX_PANIC 60 /* in seconds */
#define MY_WAIT_GIVE_USER_A_MESSAGE 10 /* Every 10 times of prev */
#define MIN_COMPRESS_LENGTH 50 /* Don't compress small bl. */
+#define DFLT_INIT_HITS 3
/* root_alloc flags */
#define MY_KEEP_PREALLOC 1
@@ -510,13 +511,13 @@ typedef struct st_key_cache* KEY_CACHE_HANDLE;
/* Key cache variable structure */
/*
- The structure contains the parameters of a key cache that can
- be set and undated by regular set global statements.
- It also contains read-only statistics parameters.
- If the corresponding key cache data structure has been already
- created the variable contains the key cache handle.
- The variables are put into a named list called key_caches.
- At present the variables are only added to this list.
+ The structure contains the parameters of a key cache that can
+ be set and undated by regular set global statements.
+ It also contains read-only statistics parameters.
+ If the corresponding key cache data structure has been already
+ created the variable contains the key cache handle.
+ The variables are put into a named list called key_caches.
+ At present the variables are only added to this list.
*/
typedef struct st_key_cache_var
{
@@ -532,16 +533,16 @@ typedef struct st_key_cache_var
ulong cache_r_requests; /* number of read requests (read hits) */
ulong cache_read; /* number of reads from files to the cache */
int blocks; /* max number of blocks in the cache */
+ my_bool in_init; /* Set to 1 in MySQL during init/resize */
struct st_key_cache_asmt *assign_list; /* list of assignments to the cache */
int assignments; /* number of not completed assignments */
void (*action)(void *); /* optional call back function */
void *extra_info; /* ptr to extra info */
} KEY_CACHE_VAR;
-#define DEFAULT_KEY_CACHE_NAME "default"
+
extern KEY_CACHE_HANDLE *dflt_keycache;
extern KEY_CACHE_VAR dflt_key_cache_var;
-#define DFLT_INIT_HITS 3
#include <my_alloc.h>
@@ -701,7 +702,15 @@ extern int key_cache_write(KEY_CACHE_HANDLE keycache,
uint block_length,int force_write);
extern int flush_key_blocks(KEY_CACHE_HANDLE keycache,
int file, enum flush_type type);
-extern void end_key_cache(KEY_CACHE_HANDLE *pkeycache,my_bool cleanup);
+extern void end_key_cache(KEY_CACHE_HANDLE keycache, my_bool cleanup);
+extern my_bool multi_keycache_init(void);
+extern void multi_keycache_free(void);
+extern KEY_CACHE_HANDLE *multi_key_cache_search(byte *key, uint length);
+extern my_bool multi_key_cache_set(const byte *key, uint length,
+ KEY_CACHE_HANDLE *key_cache);
+extern void multi_key_cache_change(KEY_CACHE_HANDLE *old_data,
+ KEY_CACHE_HANDLE *new_data);
+
extern sig_handler my_set_alarm_variable(int signo);
extern void my_string_ptr_sort(void *base,uint items,size_s size);
extern void radixsort_for_str_ptr(uchar* base[], uint number_of_elements,
diff --git a/include/myisam.h b/include/myisam.h
index bf28168b7d7..52f2948aaef 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -324,7 +324,7 @@ typedef struct st_mi_check_param
sort_buffer_length,sort_key_blocks;
uint out_flag,warning_printed,error_printed,verbose;
uint opt_sort_key,total_files,max_level;
- uint testflag;
+ uint testflag, key_cache_block_size;
uint8 language;
my_bool using_global_keycache, opt_lock_memory, opt_follow_links;
my_bool retry_repair, force_sort, calc_checksum;
@@ -388,7 +388,6 @@ int change_to_newfile(const char * filename, const char * old_ext,
int lock_file(MI_CHECK *param, File file, my_off_t start, int lock_type,
const char *filetype, const char *filename);
void lock_memory(MI_CHECK *param);
-int flush_blocks(MI_CHECK *param, File file);
void update_auto_increment_key(MI_CHECK *param, MI_INFO *info,
my_bool repair);
int update_state_info(MI_CHECK *param, MI_INFO *info,uint update);
@@ -408,9 +407,10 @@ my_bool mi_test_if_sort_rep(MI_INFO *info, ha_rows rows, ulonglong key_map,
int mi_init_bulk_insert(MI_INFO *info, ulong cache_size, ha_rows rows);
void mi_flush_bulk_insert(MI_INFO *info, uint inx);
void mi_end_bulk_insert(MI_INFO *info);
-int mi_assign_to_keycache(MI_INFO *info, ulonglong key_map,
- KEY_CACHE_VAR *key_cache,
- pthread_mutex_t *assign_lock);
+int mi_assign_to_key_cache(MI_INFO *info, ulonglong key_map,
+ KEY_CACHE_VAR *key_cache);
+void mi_change_key_cache(KEY_CACHE_VAR *old_key_cache,
+ KEY_CACHE_VAR *new_key_cache);
int mi_preload(MI_INFO *info, ulonglong key_map, my_bool ignore_leaves);
#ifdef __cplusplus
diff --git a/include/mysql.h b/include/mysql.h
index f44d515478c..2098ed0516a 100644
--- a/include/mysql.h
+++ b/include/mysql.h
@@ -411,6 +411,9 @@ int STDCALL mysql_dump_debug_info(MYSQL *mysql);
int STDCALL mysql_refresh(MYSQL *mysql,
unsigned int refresh_options);
int STDCALL mysql_kill(MYSQL *mysql,unsigned long pid);
+int STDCALL mysql_set_server_option(MYSQL *mysql,
+ enum enum_mysql_set_option
+ option);
int STDCALL mysql_ping(MYSQL *mysql);
const char * STDCALL mysql_stat(MYSQL *mysql);
const char * STDCALL mysql_get_server_info(MYSQL *mysql);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index f4b6114c8d4..3031b883e98 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -44,7 +44,7 @@ enum enum_server_command
COM_TIME, COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP,
COM_TABLE_DUMP, COM_CONNECT_OUT, COM_REGISTER_SLAVE,
COM_PREPARE, COM_EXECUTE, COM_LONG_DATA, COM_CLOSE_STMT,
- COM_RESET_STMT,
+ COM_RESET_STMT, COM_SET_OPTION,
COM_END /* Must be last */
};
@@ -116,7 +116,7 @@ enum enum_server_command
#define CLIENT_TRANSACTIONS 8192 /* Client knows about transactions */
#define CLIENT_RESERVED 16384 /* Old flag for 4.1 protocol */
#define CLIENT_SECURE_CONNECTION 32768 /* New 4.1 authentication */
-#define CLIENT_MULTI_QUERIES 65536 /* Enable/disable multiquery support */
+#define CLIENT_MULTI_STATEMENTS 65536 /* Enable/disable multi-stmt support */
#define CLIENT_MULTI_RESULTS 131072 /* Enable/disable multi-results */
#define CLIENT_REMEMBER_OPTIONS (1L << 31)
@@ -192,6 +192,7 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
};
/* For backward compatibility */
+#define CLIENT_MULTI_QUERIES CLIENT_MULTI_STATEMENTS
#define FIELD_TYPE_DECIMAL MYSQL_TYPE_DECIMAL
#define FIELD_TYPE_TINY MYSQL_TYPE_TINY
#define FIELD_TYPE_SHORT MYSQL_TYPE_SHORT
@@ -230,6 +231,13 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
#define MYSQL_TYPE_UINT24 -4
#endif
+/* options for mysql_set_option */
+enum enum_mysql_set_option
+{
+ MYSQL_OPTION_MULTI_STATEMENTS_ON,
+ MYSQL_OPTION_MULTI_STATEMENTS_OFF
+};
+
#define net_new_transaction(net) ((net)->pkt_nr=0)
#ifdef __cplusplus
diff --git a/include/mysqld_error.h b/include/mysqld_error.h
index 1168e74ae95..79f089ed6c8 100644
--- a/include/mysqld_error.h
+++ b/include/mysqld_error.h
@@ -302,4 +302,5 @@
#define ER_WRONG_NAME_FOR_CATALOG 1283
#define ER_WARN_QC_RESIZE 1284
#define ER_BAD_FT_COLUMN 1285
-#define ER_ERROR_MESSAGES 286
+#define ER_UNKNOWN_KEY_CACHE 1286
+#define ER_ERROR_MESSAGES 287