summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
committerSergei Golubchik <serg@mariadb.org>2014-10-15 12:59:13 +0200
commitf62c12b405ba7ec80b8e2490856b83c6f5899211 (patch)
tree010605c7f145da6ea6ac14b39abc4cf700d619b1 /include
parentf947f73b2b6d2bd246b81a9038224d2a85777520 (diff)
parentf1afc003eefe0aafd3e070c7453d9e029d8445a8 (diff)
downloadmariadb-git-f62c12b405ba7ec80b8e2490856b83c6f5899211.tar.gz
Merge 10.0.14 into 10.1
Diffstat (limited to 'include')
-rw-r--r--include/atomic/rwlock.h38
-rw-r--r--include/keycache.h13
-rw-r--r--include/m_ctype.h8
-rw-r--r--include/my_cpu.h44
-rw-r--r--include/my_sys.h5
-rw-r--r--include/myisam.h6
-rw-r--r--include/mysql.h.pp10
-rw-r--r--include/mysql_com.h3
-rw-r--r--include/thread_pool_priv.h2
9 files changed, 80 insertions, 49 deletions
diff --git a/include/atomic/rwlock.h b/include/atomic/rwlock.h
index f6bf7d0b76f..2ffdd384cc5 100644
--- a/include/atomic/rwlock.h
+++ b/include/atomic/rwlock.h
@@ -41,13 +41,6 @@ typedef char my_atomic_rwlock_t;
typedef struct {pthread_mutex_t rw;} my_atomic_rwlock_t;
-#ifndef SAFE_MUTEX
-
-/*
- we're using read-write lock macros but map them to mutex locks, and they're
- faster. Still, having semantically rich API we can change the
- underlying implementation, if necessary.
-*/
#define my_atomic_rwlock_destroy(name) pthread_mutex_destroy(& (name)->rw)
#define my_atomic_rwlock_init(name) pthread_mutex_init(& (name)->rw, 0)
#define my_atomic_rwlock_rdlock(name) pthread_mutex_lock(& (name)->rw)
@@ -55,37 +48,6 @@ typedef struct {pthread_mutex_t rw;} my_atomic_rwlock_t;
#define my_atomic_rwlock_rdunlock(name) pthread_mutex_unlock(& (name)->rw)
#define my_atomic_rwlock_wrunlock(name) pthread_mutex_unlock(& (name)->rw)
-#else /* SAFE_MUTEX */
-
-/*
- SAFE_MUTEX pollutes the compiling name space with macros
- that alter pthread_mutex_t, pthread_mutex_init, etc.
- Atomic operations should never use the safe mutex wrappers.
- Unfortunately, there is no way to have both:
- - safe mutex macros expanding pthread_mutex_lock to safe_mutex_lock
- - my_atomic macros expanding to unmodified pthread_mutex_lock
- inlined in the same compilation unit.
- So, in case of SAFE_MUTEX, a function call is required.
- Given that SAFE_MUTEX is a debugging facility,
- this extra function call is not a performance concern for
- production builds.
-*/
-C_MODE_START
-extern void plain_pthread_mutex_init(safe_mutex_t *);
-extern void plain_pthread_mutex_destroy(safe_mutex_t *);
-extern void plain_pthread_mutex_lock(safe_mutex_t *);
-extern void plain_pthread_mutex_unlock(safe_mutex_t *);
-C_MODE_END
-
-#define my_atomic_rwlock_destroy(name) plain_pthread_mutex_destroy(&(name)->rw)
-#define my_atomic_rwlock_init(name) plain_pthread_mutex_init(&(name)->rw)
-#define my_atomic_rwlock_rdlock(name) plain_pthread_mutex_lock(&(name)->rw)
-#define my_atomic_rwlock_wrlock(name) plain_pthread_mutex_lock(&(name)->rw)
-#define my_atomic_rwlock_rdunlock(name) plain_pthread_mutex_unlock(&(name)->rw)
-#define my_atomic_rwlock_wrunlock(name) plain_pthread_mutex_unlock(&(name)->rw)
-
-#endif /* SAFE_MUTEX */
-
#define MY_ATOMIC_MODE "mutex"
#ifndef MY_ATOMIC_MODE_RWLOCKS
#define MY_ATOMIC_MODE_RWLOCKS 1
diff --git a/include/keycache.h b/include/keycache.h
index 8fa9bf1cd18..85937ebefb9 100644
--- a/include/keycache.h
+++ b/include/keycache.h
@@ -67,11 +67,13 @@ typedef enum key_cache_type
typedef
int (*INIT_KEY_CACHE)
(void *, uint key_cache_block_size,
- size_t use_mem, uint division_limit, uint age_threshold);
+ size_t use_mem, uint division_limit, uint age_threshold,
+ uint changed_blocks_hash_size);
typedef
int (*RESIZE_KEY_CACHE)
(void *, uint key_cache_block_size,
- size_t use_mem, uint division_limit, uint age_threshold);
+ size_t use_mem, uint division_limit, uint age_threshold,
+ uint changed_blocks_hash_size);
typedef
void (*CHANGE_KEY_CACHE_PARAM)
(void *keycache_cb,
@@ -146,6 +148,7 @@ typedef struct st_key_cache
ulonglong param_division_limit;/* min. percentage of warm blocks */
ulonglong param_age_threshold; /* determines when hot block is downgraded */
ulonglong param_partitions; /* number of the key cache partitions */
+ ulonglong changed_blocks_hash_size; /* number of hash buckets for changed files */
my_bool key_cache_inited; /* <=> key cache has been created */
my_bool can_be_used; /* usage of cache for read/write is allowed */
my_bool in_init; /* set to 1 in MySQL during init/resize */
@@ -160,10 +163,11 @@ extern KEY_CACHE dflt_key_cache_var, *dflt_key_cache;
extern int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
size_t use_mem, uint division_limit,
- uint age_threshold, uint partitions);
+ uint age_threshold, uint changed_blocks_hash_size,
+ uint partitions);
extern int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
size_t use_mem, uint division_limit,
- uint age_threshold);
+ uint age_threshold, uint changed_blocks_hash_size);
extern void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
uint age_threshold);
extern uchar *key_cache_read(KEY_CACHE *keycache,
@@ -202,6 +206,7 @@ extern int repartition_key_cache(KEY_CACHE *keycache,
size_t use_mem,
uint division_limit,
uint age_threshold,
+ uint changed_blocks_hash_size,
uint partitions);
C_MODE_END
#endif /* _keycache_h */
diff --git a/include/m_ctype.h b/include/m_ctype.h
index 6f372002ebb..5994816cbfc 100644
--- a/include/m_ctype.h
+++ b/include/m_ctype.h
@@ -735,6 +735,14 @@ my_bool my_propagate_simple(CHARSET_INFO *cs, const uchar *str, size_t len);
my_bool my_propagate_complex(CHARSET_INFO *cs, const uchar *str, size_t len);
+typedef struct
+{
+ size_t char_length;
+ uint repertoire;
+} MY_STRING_METADATA;
+
+void my_string_metadata_get(MY_STRING_METADATA *metadata,
+ CHARSET_INFO *cs, const char *str, size_t len);
uint my_string_repertoire(CHARSET_INFO *cs, const char *str, ulong len);
my_bool my_charset_is_ascii_based(CHARSET_INFO *cs);
my_bool my_charset_is_8bit_pure_ascii(CHARSET_INFO *cs);
diff --git a/include/my_cpu.h b/include/my_cpu.h
new file mode 100644
index 00000000000..026b92c1b74
--- /dev/null
+++ b/include/my_cpu.h
@@ -0,0 +1,44 @@
+/* Copyright (c) 2013, MariaDB foundation Ab and SkySQL
+
+ 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
+ the Free Software Foundation; version 2 of the License.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
+*/
+
+/* instructions for specific cpu's */
+
+/*
+ Macros for adjusting thread priority (hardware multi-threading)
+ The defines are the same ones used by the linux kernel
+*/
+
+#if defined(__powerpc__)
+/* Very low priority */
+#define HMT_very_low() asm volatile("or 31,31,31")
+/* Low priority */
+#define HMT_low() asm volatile("or 1,1,1")
+/* Medium low priority */
+#define HMT_medium_low() asm volatile("or 6,6,6")
+/* Medium priority */
+#define HMT_medium() asm volatile("or 2,2,2")
+/* Medium high priority */
+#define HMT_medium_high() asm volatile("or 5,5,5")
+/* High priority */
+#define HMT_high() asm volatile("or 3,3,3")
+#else
+#define HMT_very_low()
+#define HMT_low()
+#define HMT_medium_low()
+#define HMT_medium()
+#define HMT_medium_high()
+#define HMT_high()
+#endif
diff --git a/include/my_sys.h b/include/my_sys.h
index 4b4e5b7a22f..9913ee8c79b 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -242,6 +242,11 @@ extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *default_charset_info;
extern MYSQL_PLUGIN_IMPORT CHARSET_INFO *all_charsets[MY_ALL_CHARSETS_SIZE];
extern struct charset_info_st compiled_charsets[];
+/* Collation properties and use statistics */
+extern my_bool my_collation_is_known_id(uint id);
+extern ulonglong my_collation_statistics_get_use_count(uint id);
+extern const char *my_collation_get_tailoring(uint id);
+
/* statistics */
extern ulong my_file_opened,my_stream_opened, my_tmp_file_created;
extern ulong my_file_total_opened;
diff --git a/include/myisam.h b/include/myisam.h
index 853fac20ae4..88ce401fabc 100644
--- a/include/myisam.h
+++ b/include/myisam.h
@@ -41,6 +41,12 @@ extern "C" {
#endif
#define MI_MAX_POSSIBLE_KEY_BUFF HA_MAX_POSSIBLE_KEY_BUFF
+/*
+ The following defines can be increased if necessary.
+ But beware the dependency of MI_MAX_POSSIBLE_KEY_BUFF and MI_MAX_KEY_LENGTH.
+*/
+#define MI_MAX_KEY_LENGTH 1000 /* Max length in bytes */
+#define MI_MAX_KEY_SEG 16 /* Max segments for key */
#define MI_NAME_IEXT ".MYI"
#define MI_NAME_DEXT ".MYD"
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index ca5b1ac05bf..6b60389acc3 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -49,9 +49,9 @@ enum enum_field_types { MYSQL_TYPE_DECIMAL, MYSQL_TYPE_TINY,
MYSQL_TYPE_DATETIME, MYSQL_TYPE_YEAR,
MYSQL_TYPE_NEWDATE, MYSQL_TYPE_VARCHAR,
MYSQL_TYPE_BIT,
- MYSQL_TYPE_TIMESTAMP2,
- MYSQL_TYPE_DATETIME2,
- MYSQL_TYPE_TIME2,
+ MYSQL_TYPE_TIMESTAMP2,
+ MYSQL_TYPE_DATETIME2,
+ MYSQL_TYPE_TIME2,
MYSQL_TYPE_NEWDECIMAL=246,
MYSQL_TYPE_ENUM=247,
MYSQL_TYPE_SET=248,
@@ -94,7 +94,7 @@ my_bool net_write_command(NET *net,unsigned char command,
const unsigned char *header, size_t head_len,
const unsigned char *packet, size_t len);
int net_real_write(NET *net,const unsigned char *packet, size_t len);
-unsigned long my_net_read(NET *net);
+unsigned long my_net_read_packet(NET *net, my_bool read_from_server);
struct sockaddr;
int my_connect(my_socket s, const struct sockaddr *name, unsigned int namelen,
unsigned int timeout);
@@ -553,7 +553,7 @@ int mysql_list_processes_cont(MYSQL_RES **ret, MYSQL *mysql,
int mysql_options(MYSQL *mysql,enum mysql_option option,
const void *arg);
int mysql_options4(MYSQL *mysql,enum mysql_option option,
- const void *arg1, const void *arg2);
+ const void *arg1, const void *arg2);
void mysql_free_result(MYSQL_RES *result);
int mysql_free_result_start(MYSQL_RES *result);
int mysql_free_result_cont(MYSQL_RES *result, int status);
diff --git a/include/mysql_com.h b/include/mysql_com.h
index 3a794b36c1e..0da24bc35a3 100644
--- a/include/mysql_com.h
+++ b/include/mysql_com.h
@@ -528,7 +528,8 @@ my_bool net_write_command(NET *net,unsigned char command,
const unsigned char *header, size_t head_len,
const unsigned char *packet, size_t len);
int net_real_write(NET *net,const unsigned char *packet, size_t len);
-unsigned long my_net_read(NET *net);
+unsigned long my_net_read_packet(NET *net, my_bool read_from_server);
+#define my_net_read(A) my_net_read_packet((A), 0)
#ifdef MY_GLOBAL_INCLUDED
void my_net_set_write_timeout(NET *net, uint timeout);
diff --git a/include/thread_pool_priv.h b/include/thread_pool_priv.h
index 449c8ded66b..4270c32c826 100644
--- a/include/thread_pool_priv.h
+++ b/include/thread_pool_priv.h
@@ -1,6 +1,6 @@
#error don't use
/*
- Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+ Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
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