Skip to content

Commit a3df9bc

Browse files
committed
Merge branch '5.5' into 10.0
2 parents e6fcd72 + ad220b9 commit a3df9bc

18 files changed

+219
-36
lines changed

client/mysqltest.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6205,6 +6205,11 @@ void do_connect(struct st_command *command)
62056205
if (con_slot == next_con)
62066206
next_con++; /* if we used the next_con slot, advance the pointer */
62076207
}
6208+
else // Failed to connect. Free the memory.
6209+
{
6210+
mysql_close(con_slot->mysql);
6211+
con_slot->mysql= NULL;
6212+
}
62086213

62096214
dynstr_free(&ds_connection_name);
62106215
dynstr_free(&ds_host);

cmake/ssl.cmake

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,24 @@ MACRO (MYSQL_CHECK_SSL)
174174
OPENSSL_MAJOR_VERSION "${OPENSSL_VERSION_NUMBER}"
175175
)
176176
INCLUDE(CheckSymbolExists)
177+
INCLUDE(CheckCSourceCompiles)
177178
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
178179
CHECK_SYMBOL_EXISTS(SHA512_DIGEST_LENGTH "openssl/sha.h"
179180
HAVE_SHA512_DIGEST_LENGTH)
181+
CHECK_C_SOURCE_COMPILES("
182+
#include <openssl/dh.h>
183+
int main()
184+
{
185+
DH dh;
186+
return sizeof(dh.version);
187+
}" OLD_OPENSSL_API)
188+
180189
SET(OPENSSL_FOUND TRUE)
181190
ELSE()
182191
SET(OPENSSL_FOUND FALSE)
183192
ENDIF()
184193

185-
IF(OPENSSL_FOUND AND OPENSSL_MAJOR_VERSION STRLESS "101" AND
194+
IF(OPENSSL_FOUND AND OLD_OPENSSL_API AND
186195
HAVE_SHA512_DIGEST_LENGTH)
187196
MESSAGE(STATUS "OPENSSL_INCLUDE_DIR = ${OPENSSL_INCLUDE_DIR}")
188197
MESSAGE(STATUS "OPENSSL_LIBRARIES = ${OPENSSL_LIBRARIES}")

include/my_valgrind.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
4343
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
4444
#else
45-
# define MEM_UNDEFINED(a,len) ((void) 0)
45+
# define MEM_UNDEFINED(a,len) ((void) (a), (void) (len))
4646
# define MEM_NOACCESS(a,len) ((void) 0)
4747
# define MEM_CHECK_ADDRESSABLE(a,len) ((void) 0)
4848
# define MEM_CHECK_DEFINED(a,len) ((void) 0)
@@ -51,7 +51,7 @@
5151
#ifndef DBUG_OFF
5252
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
5353
#else
54-
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp __attribute__((unused))= (B); MEM_UNDEFINED(A,trash_tmp); } while (0)
54+
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
5555
#endif
5656
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
5757
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)

mysql-test/r/row-checksum-old.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,19 @@ checksum table t1 extended;
8585
Table Checksum
8686
test.t1 4108368782
8787
drop table t1;
88+
#
89+
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
90+
#
91+
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
92+
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
93+
# Important is that checksum is different from following
94+
CHECKSUM TABLE t1 EXTENDED;
95+
Table Checksum
96+
test.t1 2514025256
97+
UPDATE t1 SET c21='cat' WHERE c1=5;
98+
# Important is that checksum is different from above
99+
CHECKSUM TABLE t1 EXTENDED;
100+
Table Checksum
101+
test.t1 2326430205
102+
drop table t1;
103+
# End of 5.5 tests

mysql-test/r/row-checksum.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,19 @@ checksum table t1 extended;
8585
Table Checksum
8686
test.t1 3885665021
8787
drop table t1;
88+
#
89+
# MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
90+
#
91+
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
92+
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
93+
# Important is that checksum is different from following
94+
CHECKSUM TABLE t1 EXTENDED;
95+
Table Checksum
96+
test.t1 2514025256
97+
UPDATE t1 SET c21='cat' WHERE c1=5;
98+
# Important is that checksum is different from above
99+
CHECKSUM TABLE t1 EXTENDED;
100+
Table Checksum
101+
test.t1 2326430205
102+
drop table t1;
103+
# End of 5.5 tests

mysql-test/r/subselect2.result

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,25 @@ select null in (select a from t1 where a < out3.a union select a from t2 where
394394
(select a from t3) +1 < out3.a+1) from t3 out3;
395395
ERROR 21000: Subquery returns more than 1 row
396396
drop table t1, t2, t3;
397+
CREATE TABLE t1(
398+
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
399+
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
400+
f1 int
401+
);
402+
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
403+
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
404+
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
405+
SELECT f1,
406+
(SELECT t.f21 from t2 t where max(
407+
q11+q12+q13+q14+q15+q16+q17+q18+q19+
408+
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
409+
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
410+
SELECT 1 LIMIT 1) AS test
411+
FROM t1 GROUP BY f1;
412+
f1 test
413+
1 1
414+
2 1
415+
Warnings:
416+
Warning 1292 Incorrect datetime value: '1'
417+
Warning 1292 Incorrect datetime value: '2'
418+
DROP TABLE t1,t2;

mysql-test/t/row-checksum.test

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,20 @@ checksum table t1;
6060
checksum table t1 quick;
6161
checksum table t1 extended;
6262
drop table t1;
63+
64+
--echo #
65+
--echo # MDEV-17085: CHECKSUM TABLE EXTENDED does not work correctly
66+
--echo #
67+
68+
CREATE TABLE t1 ( c1 int NOT NULL, c2 int NOT NULL, c4 varchar(20), c5 varchar(20), c6 varchar(20), c7 varchar(20), c8 varchar(20), c9 varchar(20), c10 varchar(20), c11 varchar(20), c12 varchar(20), c13 varchar(20), c14 varchar(20), c15 varchar(20), c16 varchar(20), c19 int NOT NULL, c20 int NOT NULL, c21 varchar(20), c22 VARCHAR(20), c23 varchar(20));
69+
70+
insert into t1 values (5,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,"dog",NULL,NULL);
71+
--echo # Important is that checksum is different from following
72+
CHECKSUM TABLE t1 EXTENDED;
73+
UPDATE t1 SET c21='cat' WHERE c1=5;
74+
--echo # Important is that checksum is different from above
75+
CHECKSUM TABLE t1 EXTENDED;
76+
77+
drop table t1;
78+
79+
--echo # End of 5.5 tests

mysql-test/t/subselect2.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,3 +411,23 @@ insert into t3 select a from t1;
411411
select null in (select a from t1 where a < out3.a union select a from t2 where
412412
(select a from t3) +1 < out3.a+1) from t3 out3;
413413
drop table t1, t2, t3;
414+
415+
#
416+
# Bug #28499924: INCORRECT BEHAVIOR WITH UNION IN SUBQUERY
417+
#
418+
CREATE TABLE t1(
419+
q11 int, q12 int, q13 int, q14 int, q15 int, q16 int, q17 int, q18 int, q19 int,
420+
q21 int, q22 int, q23 int, q24 int, q25 int, q26 int, q27 int, q28 int, q29 int,
421+
f1 int
422+
);
423+
CREATE TABLE t2(f2 int, f21 int, f3 timestamp, f4 int, f5 int, f6 int);
424+
INSERT INTO t1 (f1) VALUES (1),(1),(2),(2);
425+
INSERT INTO t2 VALUES (1,1,"2004-02-29 11:11:11",0,0,0), (2,2,"2004-02-29 11:11:11",0,0,0);
426+
SELECT f1,
427+
(SELECT t.f21 from t2 t where max(
428+
q11+q12+q13+q14+q15+q16+q17+q18+q19+
429+
q21+q22+q23+q24+q25+q26+q27+q28+q29) = t.f2 UNION
430+
SELECT t.f3 FROM t2 AS t WHERE t1.f1=t.f2 AND t.f3=MAX(t1.f1) UNION
431+
SELECT 1 LIMIT 1) AS test
432+
FROM t1 GROUP BY f1;
433+
DROP TABLE t1,t2;

scripts/mysql_install_db.sh

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ in_rpm=0
3636
ip_only=0
3737
cross_bootstrap=0
3838

39+
dirname0=`dirname $0 2>/dev/null`
40+
dirname0=`dirname $dirname0 2>/dev/null`
41+
3942
usage()
4043
{
4144
cat <<EOF
@@ -207,11 +210,6 @@ cannot_find_file()
207210
done
208211
fi
209212

210-
echo
211-
echo "If you compiled from source, you need to either run 'make install' to"
212-
echo "copy the software into the correct location ready for operation."
213-
echo "If you don't want to do a full install, you can use the --srcdir"
214-
echo "option to only install the mysql database and privilege tables"
215213
echo
216214
echo "If you compiled from source, you need to either run 'make install' to"
217215
echo "copy the software into the correct location ready for operation."
@@ -258,6 +256,9 @@ then
258256
cannot_find_file my_print_defaults $basedir/bin $basedir/extra
259257
exit 1
260258
fi
259+
elif test -n "$dirname0" -a -x "$dirname0/@bindir@/my_print_defaults"
260+
then
261+
print_defaults="$dirname0/@bindir@/my_print_defaults"
261262
else
262263
print_defaults="@bindir@/my_print_defaults"
263264
fi
@@ -309,6 +310,14 @@ then
309310
cannot_find_file fill_help_tables.sql @pkgdata_locations@
310311
exit 1
311312
fi
313+
# relative from where the script was run for a relocatable install
314+
elif test -n "$dirname0" -a -x "$dirname0/@INSTALL_SBINDIR@/mysqld"
315+
then
316+
basedir="$dirname0"
317+
bindir="$basedir/@INSTALL_SBINDIR@"
318+
resolveip="$bindir/resolveip"
319+
mysqld="$basedir/@INSTALL_SBINDIR@/mysqld"
320+
pkgdatadir="$basedir/@INSTALL_MYSQLSHAREDIR@"
312321
else
313322
basedir="@prefix@"
314323
bindir="@bindir@"

sql/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ IF(WIN32)
426426
COMPONENT Server
427427
)
428428
SET_TARGET_PROPERTIES(mysql_install_db PROPERTIES COMPILE_FLAGS -DINSTALL_PLUGINDIR=${INSTALL_PLUGINDIR})
429-
TARGET_LINK_LIBRARIES(mysql_install_db mysys)
429+
TARGET_LINK_LIBRARIES(mysql_install_db mysys shlwapi)
430430

431431
ADD_LIBRARY(winservice STATIC winservice.c)
432432
TARGET_LINK_LIBRARIES(winservice shell32)

0 commit comments

Comments
 (0)