summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/json_lib.h7
-rw-r--r--include/my_alloc.h5
-rw-r--r--include/my_sys.h4
-rw-r--r--include/mysql.h.pp5
4 files changed, 15 insertions, 6 deletions
diff --git a/include/json_lib.h b/include/json_lib.h
index bb649928eaa..6d802860cff 100644
--- a/include/json_lib.h
+++ b/include/json_lib.h
@@ -1,6 +1,8 @@
#ifndef JSON_LIB_INCLUDED
#define JSON_LIB_INCLUDED
+#include <my_sys.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -172,7 +174,7 @@ enum json_states {
enum json_value_types
{
- JSON_VALUE_UNINITALIZED=0,
+ JSON_VALUE_UNINITIALIZED=0,
JSON_VALUE_OBJECT=1,
JSON_VALUE_ARRAY=2,
JSON_VALUE_STRING=3,
@@ -431,6 +433,9 @@ int json_locate_key(const char *js, const char *js_end,
const char **key_start, const char **key_end,
int *comma_pos);
+int json_normalize(DYNAMIC_STRING *result,
+ const char *s, size_t size, CHARSET_INFO *cs);
+
#ifdef __cplusplus
}
#endif
diff --git a/include/my_alloc.h b/include/my_alloc.h
index 181f637c093..3001c4efcec 100644
--- a/include/my_alloc.h
+++ b/include/my_alloc.h
@@ -50,11 +50,12 @@ typedef struct st_mem_root
first free block in queue test counter (if it exceed
MAX_BLOCK_USAGE_BEFORE_DROP block will be dropped in 'used' list)
*/
- unsigned int first_block_usage;
+ unsigned short first_block_usage;
+ unsigned short flags;
void (*error_handler)(void);
- PSI_memory_key m_psi_key;
+ PSI_memory_key psi_key;
} MEM_ROOT;
#ifdef __cplusplus
diff --git a/include/my_sys.h b/include/my_sys.h
index f5cd3e7a461..dae4777db11 100644
--- a/include/my_sys.h
+++ b/include/my_sys.h
@@ -94,6 +94,7 @@ C_MODE_START
#define MY_SYNC_DIR 32768U /* my_create/delete/rename: sync directory */
#define MY_SYNC_FILESIZE 65536U /* my_sync(): safe sync when file is extended */
#define MY_THREAD_SPECIFIC 0x10000U /* my_malloc(): thread specific */
+#define MY_ROOT_USE_MPROTECT 0x20000U /* init_alloc_root: read only segments */
/* Tree that should delete things automatically */
#define MY_TREE_WITH_DELETE 0x40000U
@@ -284,6 +285,7 @@ extern my_bool my_disable_async_io,
extern my_bool my_disable_sync, my_disable_copystat_in_redel;
extern char wild_many,wild_one,wild_prefix;
extern const char *charsets_dir;
+extern size_t my_system_page_size;
enum cache_type
{
@@ -887,7 +889,6 @@ extern void my_free_lock(void *ptr);
#define my_free_lock(A) my_free((A))
#endif
#define alloc_root_inited(A) ((A)->min_malloc != 0)
-#define ALLOC_ROOT_MIN_BLOCK_SIZE (MALLOC_OVERHEAD + sizeof(USED_MEM) + 8)
#define clear_alloc_root(A) do { (A)->free= (A)->used= (A)->pre_alloc= 0; (A)->min_malloc=0;} while(0)
extern void init_alloc_root(PSI_memory_key key, MEM_ROOT *mem_root,
size_t block_size, size_t pre_alloc_size,
@@ -898,6 +899,7 @@ extern void free_root(MEM_ROOT *root, myf MyFLAGS);
extern void set_prealloc_root(MEM_ROOT *root, char *ptr);
extern void reset_root_defaults(MEM_ROOT *mem_root, size_t block_size,
size_t prealloc_size);
+extern void protect_root(MEM_ROOT *root, int prot);
extern char *strdup_root(MEM_ROOT *root,const char *str);
static inline char *safe_strdup_root(MEM_ROOT *root, const char *str)
{
diff --git a/include/mysql.h.pp b/include/mysql.h.pp
index 584276a7a08..4ffc271a644 100644
--- a/include/mysql.h.pp
+++ b/include/mysql.h.pp
@@ -259,9 +259,10 @@ typedef struct st_mem_root
size_t min_malloc;
size_t block_size;
unsigned int block_num;
- unsigned int first_block_usage;
+ unsigned short first_block_usage;
+ unsigned short flags;
void (*error_handler)(void);
- PSI_memory_key m_psi_key;
+ PSI_memory_key psi_key;
} MEM_ROOT;
}
typedef struct st_typelib {