Skip to content

Commit 9624b08

Browse files
committed
Merge branch '10.1' of https://github.com/MariaDB/server into ok-debpkg-10.1
2 parents c104e90 + 0671430 commit 9624b08

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+898
-515
lines changed

client/mysqltest.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
And many others
3434
*/
3535

36-
#define MTEST_VERSION "3.4"
36+
#define MTEST_VERSION "3.5"
3737

3838
#include "client_priv.h"
3939
#include <mysql_version.h>
@@ -121,7 +121,7 @@ static my_bool tty_password= 0;
121121
static my_bool opt_mark_progress= 0;
122122
static my_bool ps_protocol= 0, ps_protocol_enabled= 0;
123123
static my_bool sp_protocol= 0, sp_protocol_enabled= 0;
124-
static my_bool view_protocol= 0, view_protocol_enabled= 0;
124+
static my_bool view_protocol= 0, view_protocol_enabled= 0, wait_longer= 0;
125125
static my_bool cursor_protocol= 0, cursor_protocol_enabled= 0;
126126
static my_bool parsing_disabled= 0;
127127
static my_bool display_result_vertically= FALSE, display_result_lower= FALSE,
@@ -4657,7 +4657,7 @@ void do_sync_with_master2(struct st_command *command, long offset,
46574657
MYSQL_ROW row;
46584658
MYSQL *mysql= cur_con->mysql;
46594659
char query_buf[FN_REFLEN+128];
4660-
int timeout= 300; /* seconds */
4660+
int timeout= wait_longer ? 1500 : 300; /* seconds */
46614661

46624662
if (!master_pos.file[0])
46634663
die("Calling 'sync_with_master' without calling 'save_master_pos'");
@@ -5011,7 +5011,7 @@ static int my_kill(int pid, int sig)
50115011

50125012
void do_shutdown_server(struct st_command *command)
50135013
{
5014-
long timeout=60;
5014+
long timeout= wait_longer ? 60*5 : 60;
50155015
int pid;
50165016
DYNAMIC_STRING ds_pidfile_name;
50175017
MYSQL* mysql = cur_con->mysql;
@@ -5080,7 +5080,6 @@ void do_shutdown_server(struct st_command *command)
50805080
(void)my_kill(pid, 9);
50815081

50825082
DBUG_VOID_RETURN;
5083-
50845083
}
50855084

50865085

@@ -6953,6 +6952,9 @@ static struct my_option my_long_options[] =
69536952
"Number of seconds before connection timeout.",
69546953
&opt_connect_timeout, &opt_connect_timeout, 0, GET_UINT, REQUIRED_ARG,
69556954
120, 0, 3600 * 12, 0, 0, 0},
6955+
{"wait-longer-for-timeouts", 0,
6956+
"Wait longer for timeouts. Useful when running under valgrind",
6957+
&wait_longer, &wait_longer, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
69566958
{"plugin_dir", 0, "Directory for client-side plugins.",
69576959
&opt_plugin_dir, &opt_plugin_dir, 0,
69586960
GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},

include/my_sys.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1028,9 +1028,9 @@ extern size_t escape_quotes_for_mysql(CHARSET_INFO *charset_info,
10281028
char *to, size_t to_length,
10291029
const char *from, size_t length);
10301030

1031-
extern void thd_increment_bytes_sent(ulong length);
1032-
extern void thd_increment_bytes_received(ulong length);
1033-
extern void thd_increment_net_big_packet_count(ulong length);
1031+
extern void thd_increment_bytes_sent(void *thd, ulong length);
1032+
extern void thd_increment_bytes_received(void *thd, ulong length);
1033+
extern void thd_increment_net_big_packet_count(void *thd, ulong length);
10341034

10351035
#ifdef __WIN__
10361036
extern my_bool have_tcpip; /* Is set if tcpip is used */

include/mysql.h.pp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
my_bool thread_specific_malloc;
3030
my_bool compress;
3131
my_bool unused3;
32-
unsigned char *unused;
32+
void *thd;
3333
unsigned int last_errno;
3434
unsigned char error;
3535
my_bool unused4;
@@ -81,7 +81,7 @@
8181
MYSQL_OPTION_MULTI_STATEMENTS_ON,
8282
MYSQL_OPTION_MULTI_STATEMENTS_OFF
8383
};
84-
my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags);
84+
my_bool my_net_init(NET *net, Vio* vio, void *thd, unsigned int my_flags);
8585
void my_net_local_init(NET *net);
8686
void net_end(NET *net);
8787
void net_clear(NET *net, my_bool clear_buffer);

include/mysql_com.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,10 +386,7 @@ typedef struct st_net {
386386
queries in cache that have not stored its results yet
387387
*/
388388
#endif
389-
/*
390-
Unused, please remove with the next incompatible ABI change.
391-
*/
392-
unsigned char *unused;
389+
void *thd; /* Used by MariaDB server to avoid calling current_thd */
393390
unsigned int last_errno;
394391
unsigned char error;
395392
my_bool unused4; /* Please remove with the next incompatible ABI change. */
@@ -517,7 +514,7 @@ enum enum_mysql_set_option
517514
extern "C" {
518515
#endif
519516

520-
my_bool my_net_init(NET *net, Vio* vio, unsigned int my_flags);
517+
my_bool my_net_init(NET *net, Vio* vio, void *thd, unsigned int my_flags);
521518
void my_net_local_init(NET *net);
522519
void net_end(NET *net);
523520
void net_clear(NET *net, my_bool clear_buffer);

mysql-test/include/sync_with_master_gtid.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ let $_slave_timeout= $slave_timeout;
3434
if (!$_slave_timeout)
3535
{
3636
let $_slave_timeout= 120;
37+
if ($VALGRIND_TEST)
38+
{
39+
let $_slave_timeout= 1200;
40+
}
3741
}
3842

3943
--let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)`

mysql-test/mysql-test-run.pl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5472,6 +5472,12 @@ ($)
54725472
mtr_add_arg($args, "--max-connections=%d", $opt_max_connections);
54735473
}
54745474

5475+
if ( $opt_valgrind )
5476+
{
5477+
# Longer timeouts when running with valgrind
5478+
mtr_add_arg($args, "--wait-longer-for-timeouts");
5479+
}
5480+
54755481
if ( $opt_embedded_server )
54765482
{
54775483

mysql-test/r/ctype_binary.result

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,3 +3041,103 @@ _binary 0x7E _binary X'7E' _binary B'01111110'
30413041
#
30423042
# End of 10.0 tests
30433043
#
3044+
#
3045+
# Start of 10.1 tests
3046+
#
3047+
#
3048+
# MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
3049+
#
3050+
CREATE TABLE t1 (a VARBINARY(10));
3051+
INSERT INTO t1 VALUES ('a'),('a ');
3052+
SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE CRC32(a)=3904355907;
3053+
a LENGTH(a) CRC32(a)
3054+
a 1 3904355907
3055+
SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
3056+
a LENGTH(a) CRC32(a)
3057+
a 1 3904355907
3058+
# Okey to propagate 'a' into CRC32(a)
3059+
EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
3060+
id select_type table type possible_keys key key_len ref rows filtered Extra
3061+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3062+
Warnings:
3063+
Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
3064+
SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61';
3065+
a HEX(a)
3066+
a 61
3067+
SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
3068+
a HEX(a)
3069+
a 61
3070+
# Okey to propagate 'a' into HEX(a)
3071+
EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
3072+
id select_type table type possible_keys key key_len ref rows filtered Extra
3073+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3074+
Warnings:
3075+
Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
3076+
SELECT * FROM t1 WHERE a='a';
3077+
a
3078+
a
3079+
SELECT * FROM t1 WHERE LENGTH(a)=2;
3080+
a
3081+
a
3082+
SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
3083+
a
3084+
# Okey to propagate 'a' into LENGTH(a)
3085+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
3086+
id select_type table type possible_keys key key_len ref rows filtered Extra
3087+
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE
3088+
Warnings:
3089+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where 0
3090+
SELECT * FROM t1 WHERE a='a ';
3091+
a
3092+
a
3093+
SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2;
3094+
a
3095+
a
3096+
# Okey to propagate 'a ' into LENGTH(a)
3097+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a ' AND LENGTH(a)=2;
3098+
id select_type table type possible_keys key key_len ref rows filtered Extra
3099+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3100+
Warnings:
3101+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a ')
3102+
DROP TABLE t1;
3103+
#
3104+
# MDEV-8723 Wrong result for SELECT..WHERE COLLATION(a)='binary' AND a='a'
3105+
#
3106+
CREATE TABLE t1 (a VARBINARY(10));
3107+
INSERT INTO t1 VALUES ('a'),('A');
3108+
SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a';
3109+
a
3110+
a
3111+
SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a';
3112+
a
3113+
a
3114+
SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
3115+
a
3116+
a
3117+
SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
3118+
a
3119+
a
3120+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE COLLATION(a)='binary' AND a='a';
3121+
id select_type table type possible_keys key key_len ref rows filtered Extra
3122+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3123+
Warnings:
3124+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
3125+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE CHARSET(a)='binary' AND a='a';
3126+
id select_type table type possible_keys key key_len ref rows filtered Extra
3127+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3128+
Warnings:
3129+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
3130+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE COERCIBILITY(a)=2 AND a='a';
3131+
id select_type table type possible_keys key key_len ref rows filtered Extra
3132+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3133+
Warnings:
3134+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = 'a')
3135+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE WEIGHT_STRING(a)='a' AND a='a';
3136+
id select_type table type possible_keys key key_len ref rows filtered Extra
3137+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
3138+
Warnings:
3139+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (weight_string(`test`.`t1`.`a`) = 'a'))
3140+
DROP TABLE t1;
3141+
#
3142+
# End of 10.1 tests
3143+
#

mysql-test/r/ctype_latin1.result

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8103,5 +8103,51 @@ SELECT * FROM t1 WHERE a=b AND a=DATE'2001-01-01';
81038103
a b
81048104
DROP TABLE t1;
81058105
#
8106+
# MDEV-8695 Wrong result for SELECT..WHERE varchar_column='a' AND CRC32(varchar_column)=3904355907
8107+
#
8108+
CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
8109+
INSERT INTO t1 VALUES ('a'),('a ');
8110+
SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE CRC32(a)=3904355907;
8111+
a LENGTH(a) CRC32(a)
8112+
a 1 3904355907
8113+
SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
8114+
a LENGTH(a) CRC32(a)
8115+
a 1 3904355907
8116+
# 'a' should not be propagated into CRC32(a)
8117+
EXPLAIN EXTENDED SELECT a, LENGTH(a), CRC32(a) FROM t1 WHERE a='a' AND CRC32(a)=3904355907;
8118+
id select_type table type possible_keys key key_len ref rows filtered Extra
8119+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
8120+
Warnings:
8121+
Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)`,crc32(`test`.`t1`.`a`) AS `CRC32(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (crc32(`test`.`t1`.`a`) = 3904355907))
8122+
SELECT a, HEX(a) FROM t1 WHERE HEX(a)='61';
8123+
a HEX(a)
8124+
a 61
8125+
SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
8126+
a HEX(a)
8127+
a 61
8128+
# 'a' should not be propagated into HEX(a)
8129+
EXPLAIN EXTENDED SELECT *,HEX(a) FROM t1 WHERE a='a' AND HEX(a)='61';
8130+
id select_type table type possible_keys key key_len ref rows filtered Extra
8131+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
8132+
Warnings:
8133+
Note 1003 select `test`.`t1`.`a` AS `a`,hex(`test`.`t1`.`a`) AS `HEX(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (hex(`test`.`t1`.`a`) = '61'))
8134+
SELECT * FROM t1 WHERE a='a';
8135+
a
8136+
a
8137+
a
8138+
SELECT * FROM t1 WHERE LENGTH(a)=2;
8139+
a
8140+
a
8141+
SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
8142+
a
8143+
a
8144+
# 'a' should not be propagated into LENGTH(a)
8145+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='a' AND LENGTH(a)=2;
8146+
id select_type table type possible_keys key key_len ref rows filtered Extra
8147+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
8148+
Warnings:
8149+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (length(`test`.`t1`.`a`) = 2))
8150+
DROP TABLE t1;
8151+
#
81068152
# End of 10.1 tests
81078153
#

mysql-test/r/max_statement_time.result

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ call pr();
166166
1
167167
1
168168
ERROR 70100: Query execution was interrupted (max_statement_time exceeded)
169+
set max_statement_time = 0;
169170
drop procedure pr;
170171
create procedure pr()
171172
begin

mysql-test/r/type_date.result

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,5 +495,21 @@ DROP TABLE t1;
495495
# End of MDEV-8373 Zero date can be inserted in strict no-zero mode through CREATE TABLE AS SELECT timestamp_field
496496
#
497497
#
498+
# MDEV-8722 The patch for MDEV-8688 disabled equal field propagation for temporal column and BETWEEN and IN
499+
#
500+
CREATE TABLE t1 (a DATE);
501+
INSERT INTO t1 VALUES ('2001-01-01'),('2001-01-02');
502+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a BETWEEN '2001-01-01' AND '2001-01-02';
503+
id select_type table type possible_keys key key_len ref rows filtered Extra
504+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
505+
Warnings:
506+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01')
507+
EXPLAIN EXTENDED SELECT * FROM t1 WHERE a='2001-01-01' AND a IN ('2001-01-01','2001-01-02');
508+
id select_type table type possible_keys key key_len ref rows filtered Extra
509+
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where
510+
Warnings:
511+
Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` where (`test`.`t1`.`a` = '2001-01-01')
512+
DROP TABLE t1;
513+
#
498514
# End of 10.1 tests
499515
#

0 commit comments

Comments
 (0)