Skip to content

Commit 98ea806

Browse files
committed
Merge branch '5.5' into 10.0
2 parents b9e5718 + 11b77e9 commit 98ea806

File tree

6 files changed

+43
-15
lines changed

6 files changed

+43
-15
lines changed

client/mysqlcheck.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,6 @@ static int is_view(const char *table)
523523
{
524524
fprintf(stderr, "Failed to %s\n", query);
525525
fprintf(stderr, "Error: %s\n", mysql_error(sock));
526-
my_free(query);
527526
DBUG_RETURN(-1);
528527
}
529528
res= mysql_store_result(sock);

mysql-test/r/events_2.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
drop database if exists events_test;
22
create database events_test;
33
use events_test;
4-
create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
4+
create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
55
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
66
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
7-
events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP
7+
events_test e_26 set @a = 5 root@localhost 2027-01-01 00:00:00 DROP
88
drop event e_26;
99
create event e_26 on schedule at NULL disable do set @a = 5;
1010
ERROR HY000: Incorrect AT value: 'NULL'

mysql-test/suite/sys_vars/t/secure_file_priv.test

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,39 @@ CREATE TABLE t1 (c1 VARCHAR(50));
55
INSERT INTO t1 VALUES ("one"),("two"),("three"),("four"),("five");
66
SHOW VARIABLES LIKE 'secure_file_priv';
77
--disable_query_log
8+
89
# Atempt to create a file where we normally aren't allowed to create one.
10+
#
911
# Doing this in a portable manner is difficult but we should be able to
10-
# count on the depth of the directory hierarchy used. Three steps up from
11-
# the datadir is the 'mysql_test' directory.
12-
--let $PROTECTED_FILE=`SELECT concat(@@datadir,'/../../../bug50373.txt')`
13-
--eval SELECT * FROM t1 INTO OUTFILE '$PROTECTED_FILE';
14-
DELETE FROM t1;
15-
--eval LOAD DATA INFILE '$PROTECTED_FILE' INTO TABLE t1;
16-
SELECT * FROM t1;
17-
--eval SELECT load_file('$PROTECTED_FILE') AS loaded_file;
12+
# count on the directory hierarchy used. A step up from MYSQLTEST_VARDIR
13+
# should definitely lead us to a "protected" directory,
14+
# but at the same time should still be writable since MTR was able
15+
# to create the vardir itself there.
16+
# If we run tests normally, it will be mysql-test directory.
17+
# If we run tests with --mem, it will be /dev/shm.
18+
# If we run tests with --parallel, it will be mysql-test/var
19+
# (because MYSQLTEST_VARDIR in this case is mysql-test/var/N).
20+
21+
--perl
22+
use File::Basename;
23+
my $protected_file= dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
24+
open(FILE, ">", "$ENV{MYSQL_TMP_DIR}/bug50373.inc") or die;
25+
print FILE "SELECT * FROM t1 INTO OUTFILE '".$protected_file."';\n";
26+
print FILE "DELETE FROM t1;\n";
27+
print FILE "LOAD DATA INFILE '".$protected_file."' INTO TABLE t1;\n";
28+
print FILE "SELECT * FROM t1;\n";
29+
print FILE "SELECT load_file('",$protected_file,"') AS loaded_file;\n";
30+
close(FILE);
31+
EOF
32+
33+
--source $MYSQL_TMP_DIR/bug50373.inc
34+
--remove_file $MYSQL_TMP_DIR/bug50373.inc
1835
--enable_query_log
19-
remove_file $PROTECTED_FILE;
36+
2037
DROP TABLE t1;
2138

39+
--perl
40+
use File::Basename;
41+
unlink dirname($ENV{MYSQLTEST_VARDIR}).'/bug50373.txt';
42+
EOF
43+

mysql-test/t/events_2.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use events_test;
1313
# mysql.event intact checking end
1414
#
1515

16-
create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
16+
create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
1717
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
1818
drop event e_26;
1919
--error ER_WRONG_VALUE

mysys/lf_alloc-pin.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@
103103
#include <my_sys.h>
104104
#include <lf.h>
105105

106+
/*
107+
when using alloca() leave at least that many bytes of the stack -
108+
for functions we might be calling from within this stack frame
109+
*/
110+
#define ALLOCA_SAFETY_MARGIN 8192
111+
106112
#define LF_PINBOX_MAX_PINS 65536
107113

108114
static void _lf_pinbox_real_free(LF_PINS *pins);
@@ -349,7 +355,8 @@ static void _lf_pinbox_real_free(LF_PINS *pins)
349355
{
350356
int alloca_size= sizeof(void *)*LF_PINBOX_PINS*npins;
351357
/* create a sorted list of pinned addresses, to speed up searches */
352-
if (available_stack_size(&pinbox, *pins->stack_ends_here) > alloca_size)
358+
if (available_stack_size(&pinbox, *pins->stack_ends_here) >
359+
alloca_size + ALLOCA_SAFETY_MARGIN)
353360
{
354361
struct st_harvester hv;
355362
addr= (void **) alloca(alloca_size);

sql/gcalc_slicescan.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#ifndef GCALC_DBUG_OFF
2828
#define GCALC_DBUG_PRINT(b) DBUG_PRINT("Gcalc", b)
29-
#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc "a)
29+
#define GCALC_DBUG_ENTER(a) DBUG_ENTER("Gcalc " a)
3030
#define GCALC_DBUG_RETURN(r) DBUG_RETURN(r)
3131
#define GCALC_DBUG_VOID_RETURN DBUG_VOID_RETURN
3232
#define GCALC_DBUG_ASSERT(r) DBUG_ASSERT(r)

0 commit comments

Comments
 (0)