summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2016-04-29 16:50:58 -0400
committerNirbhay Choubey <nirbhay@mariadb.com>2016-04-29 16:50:58 -0400
commit8a1efa1bdd29b756c93a3ddbd8ad6fadec1082bc (patch)
tree9827e75d29817f3ddbc2008ba2b5b21553c14c5e /mysys
parent7c42b47e67918104fddd121a1ca9fede28ed47cf (diff)
parent9eba34f08675c31b0796eeb127582be827773070 (diff)
downloadmariadb-git-8a1efa1bdd29b756c93a3ddbd8ad6fadec1082bc.tar.gz
Merge branch '10.0' into 10.0-galera
Diffstat (limited to 'mysys')
-rw-r--r--mysys/lf_alloc-pin.c9
-rw-r--r--mysys/ma_dyncol.c2
-rw-r--r--mysys/mf_iocache2.c2
-rw-r--r--mysys/mf_keycache.c2
-rw-r--r--mysys/my_copy.c1
-rw-r--r--mysys/my_default.c2
-rw-r--r--mysys/my_delete.c2
-rw-r--r--mysys/my_lock.c4
8 files changed, 15 insertions, 9 deletions
diff --git a/mysys/lf_alloc-pin.c b/mysys/lf_alloc-pin.c
index b599b455ff5..282433ea48d 100644
--- a/mysys/lf_alloc-pin.c
+++ b/mysys/lf_alloc-pin.c
@@ -103,6 +103,12 @@
#include <my_sys.h>
#include <lf.h>
+/*
+ when using alloca() leave at least that many bytes of the stack -
+ for functions we might be calling from within this stack frame
+*/
+#define ALLOCA_SAFETY_MARGIN 8192
+
#define LF_PINBOX_MAX_PINS 65536
static void _lf_pinbox_real_free(LF_PINS *pins);
@@ -349,7 +355,8 @@ static void _lf_pinbox_real_free(LF_PINS *pins)
{
int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
/* create a sorted list of pinned addresses, to speed up searches */
- if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size)
+ if (available_stack_size(&pinbox, *pins->stack_ends_here) >
+ alloca_size + ALLOCA_SAFETY_MARGIN)
{
struct st_harvester hv;
addr= (void **) alloca(alloca_size);
diff --git a/mysys/ma_dyncol.c b/mysys/ma_dyncol.c
index d7d4a127a75..7cd0c2b02df 100644
--- a/mysys/ma_dyncol.c
+++ b/mysys/ma_dyncol.c
@@ -4249,7 +4249,7 @@ mariadb_dyncol_unpack(DYNAMIC_COLUMN *str,
{
*names= my_malloc(sizeof(LEX_STRING) * header.column_count +
DYNCOL_NUM_CHAR * header.column_count, MYF(0));
- nm= (char *)(names + sizeof(LEX_STRING) * header.column_count);
+ nm= (char *)((*names) + header.column_count);
}
else
{
diff --git a/mysys/mf_iocache2.c b/mysys/mf_iocache2.c
index 06dfc9f2079..9e693209445 100644
--- a/mysys/mf_iocache2.c
+++ b/mysys/mf_iocache2.c
@@ -44,7 +44,7 @@
RETURN VALUE
0 All OK
- 1 An error occured
+ 1 An error occurred
*/
int
my_b_copy_to_file(IO_CACHE *cache, FILE *file)
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 16ac749fa09..0e7c43cc4c4 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -274,7 +274,7 @@ struct st_hash_link
};
/* simple states of a block */
-#define BLOCK_ERROR 1 /* an error occured when performing file i/o */
+#define BLOCK_ERROR 1 /* an error occurred when performing file i/o */
#define BLOCK_READ 2 /* file block is in the block buffer */
#define BLOCK_IN_SWITCH 4 /* block is preparing to read new page */
#define BLOCK_REASSIGNED 8 /* blk does not accept requests for old page */
diff --git a/mysys/my_copy.c b/mysys/my_copy.c
index 8af572b5518..bd23dfc48cd 100644
--- a/mysys/my_copy.c
+++ b/mysys/my_copy.c
@@ -18,7 +18,6 @@
#include "mysys_err.h"
#include <my_dir.h> /* for stat */
#include <m_string.h>
-#include "mysys_err.h"
#if defined(HAVE_UTIME_H)
#include <utime.h>
#elif defined(HAVE_SYS_UTIME_H)
diff --git a/mysys/my_default.c b/mysys/my_default.c
index c7ab8763e1f..1ad2fa2090d 100644
--- a/mysys/my_default.c
+++ b/mysys/my_default.c
@@ -373,7 +373,7 @@ err:
RETURN
0 - ok
- 1 - error occured
+ 1 - error occurred
*/
static int handle_default_option(void *in_ctx, const char *group_name,
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index e99c7ff5fcb..3dfe290dabe 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -110,7 +110,7 @@ static int my_win_unlink(const char *name)
if (handle != INVALID_HANDLE_VALUE)
{
/*
- We opened file without sharing flags (exclusive), noone else has this file
+ We opened file without sharing flags (exclusive), no one else has this file
opened, thus it is save to close handle to remove it. No renaming is
necessary.
*/
diff --git a/mysys/my_lock.c b/mysys/my_lock.c
index 0abbc6c3084..082d8e9f5a0 100644
--- a/mysys/my_lock.c
+++ b/mysys/my_lock.c
@@ -131,7 +131,7 @@ error:
RETURN VALUE
0 Success
- -1 An error has occured and 'my_errno' is set
+ -1 An error has occurred and 'my_errno' is set
to indicate the actual error code.
*/
@@ -203,7 +203,7 @@ int my_lock(File fd, int locktype, my_off_t start, my_off_t length,
== MY_FILEPOS_ERROR)
{
/*
- If an error has occured in my_seek then we will already
+ If an error has occurred in my_seek then we will already
have an error code in my_errno; Just return error code.
*/
DBUG_RETURN(-1);