Skip to content

Commit c9cf6b1

Browse files
committed
Merge 10.3 into 10.4
2 parents b795adc + 33ae161 commit c9cf6b1

File tree

78 files changed

+1535
-1150
lines changed

Some content is hidden

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

78 files changed

+1535
-1150
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ language: cpp
1111
os:
1212
- linux
1313
- osx
14-
osx_image: xcode10.1
14+
osx_image: xcode12u
1515
compiler:
1616
- gcc
1717
- clang
@@ -20,8 +20,6 @@ cache:
2020
timeout: 500
2121
apt: true
2222
ccache: true
23-
directories:
24-
- /usr/local/Cellar # Fails do to permission error: https://github.com/travis-ci/travis-ci/issues/8092
2523

2624
env:
2725
matrix:

client/mysqlbinlog.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -968,8 +968,12 @@ static bool print_row_event(PRINT_EVENT_INFO *print_event_info, Log_event *ev,
968968
my_b_printf(body_cache, "'%s\n", print_event_info->delimiter);
969969

970970
// flush cache
971-
if ((copy_event_cache_to_file_and_reinit(&print_event_info->head_cache, result_file) ||
972-
copy_event_cache_to_file_and_reinit(&print_event_info->body_cache, result_file)))
971+
if ((copy_event_cache_to_file_and_reinit(&print_event_info->head_cache,
972+
result_file) ||
973+
copy_event_cache_to_file_and_reinit(&print_event_info->body_cache,
974+
result_file) ||
975+
copy_event_cache_to_file_and_reinit(&print_event_info->tail_cache,
976+
result_file)))
973977
return 1;
974978
}
975979
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[covering]
2+
innodb_prefix_index_cluster_optimization=on
3+
4+
[unoptimized]
5+
innodb_prefix_index_cluster_optimization=off
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
--source include/have_innodb.inc

mysql-test/main/fast_prefix_index_fetch_innodb.result

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
drop table if exists prefixinno;
1+
SET @save_opt= @@GLOBAL.innodb_prefix_index_cluster_optimization;
22
set global innodb_prefix_index_cluster_optimization = ON;
33
show variables like 'innodb_prefix_index_cluster_optimization';
44
Variable_name Value
@@ -346,10 +346,10 @@ f1
346346
🐱🌑
347347
select @cluster_lookups;
348348
@cluster_lookups
349-
2
349+
1
350350
select @cluster_lookups_avoided;
351351
@cluster_lookups_avoided
352-
0
352+
1
353353
# Eligible - record length is shorter than prefix length
354354
SELECT f1 FROM t1 FORCE INDEX (`f1`) WHERE f1 like '🌑%';
355355
f1
@@ -366,10 +366,10 @@ f1
366366
🌒
367367
select @cluster_lookups;
368368
@cluster_lookups
369-
1
369+
0
370370
select @cluster_lookups_avoided;
371371
@cluster_lookups_avoided
372-
1
372+
2
373373
DROP TABLE t1;
374374
CREATE TABLE t1(
375375
col1 INT,
@@ -398,4 +398,60 @@ select @cluster_lookups_avoided;
398398
@cluster_lookups_avoided
399399
0
400400
DROP TABLE t1;
401-
set global innodb_prefix_index_cluster_optimization = OFF;
401+
#
402+
# MDEV-20464 Division by 0 in row_search_with_covering_prefix()
403+
#
404+
CREATE TABLE t1 (f1 INT, f2 INT AS (f1), f3 INT AS (f1), f4 INT AS (f1),
405+
KEY (f1,f2,f3)) ENGINE=InnoDB;
406+
INSERT INTO t1 (f1) VALUES (NULL),(0);
407+
SELECT f1, MAX(f3), COUNT(f4) FROM t1 GROUP BY f1;
408+
f1 MAX(f3) COUNT(f4)
409+
NULL NULL 0
410+
0 0 1
411+
DROP TABLE t1;
412+
#
413+
# MDEV-23600 Division by 0 in row_search_with_covering_prefix()
414+
#
415+
CREATE TABLE t(c POINT UNIQUE) ENGINE=InnoDB;
416+
INSERT t SET c=POINT(1,1);
417+
SELECT * FROM t WHERE c > (SELECT MAX(c) FROM t);
418+
c
419+
DROP TABLE t;
420+
#
421+
# MDEV-12486 Wrong results with innodb_prefix_index_cluster_optimization
422+
#
423+
CREATE TABLE wp_blogs (
424+
blog_id bigint(20) NOT NULL auto_increment,
425+
site_id bigint(20) NOT NULL default '0',
426+
domain varchar(200) NOT NULL default '',
427+
path varchar(100) NOT NULL default '',
428+
registered datetime NOT NULL default '0000-00-00 00:00:00',
429+
last_updated datetime NOT NULL default '0000-00-00 00:00:00',
430+
public tinyint(2) NOT NULL default '1',
431+
archived tinyint(2) NOT NULL default '0',
432+
mature tinyint(2) NOT NULL default '0',
433+
spam tinyint(2) NOT NULL default '0',
434+
deleted tinyint(2) NOT NULL default '0',
435+
lang_id int(11) NOT NULL default '0',
436+
PRIMARY KEY (blog_id),
437+
KEY domain (domain(50),path(5)),
438+
KEY lang_id (lang_id)
439+
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
440+
INSERT INTO wp_blogs (domain, path) VALUES
441+
('domain.no', '/fondsinvesteringer/'), ('domain.no', '/'),
442+
('foo', 'bar'), ('bar', 'foo'), ('foo', 'foo'), ('bar', 'bar'),
443+
('foo', 'foobar'), ('bar', 'foobar'), ('foobar', 'foobar');
444+
SET GLOBAL innodb_prefix_index_cluster_optimization=off;
445+
SELECT blog_id FROM wp_blogs WHERE domain IN ('domain.no')
446+
AND path IN ( '/fondsinvesteringer/', '/' );
447+
blog_id
448+
2
449+
1
450+
SET GLOBAL innodb_prefix_index_cluster_optimization=on;
451+
SELECT blog_id FROM wp_blogs WHERE domain IN ('domain.no')
452+
AND path IN ( '/fondsinvesteringer/', '/' );
453+
blog_id
454+
2
455+
1
456+
DROP TABLE wp_blogs;
457+
SET GLOBAL innodb_prefix_index_cluster_optimization = @save_opt;

mysql-test/main/fast_prefix_index_fetch_innodb.test

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
-- source include/have_innodb.inc
22

3-
--disable_warnings
4-
drop table if exists prefixinno;
5-
--enable_warnings
6-
3+
SET @save_opt= @@GLOBAL.innodb_prefix_index_cluster_optimization;
74
set global innodb_prefix_index_cluster_optimization = ON;
85
show variables like 'innodb_prefix_index_cluster_optimization';
96

@@ -665,4 +662,58 @@ select @cluster_lookups;
665662
select @cluster_lookups_avoided;
666663

667664
DROP TABLE t1;
668-
set global innodb_prefix_index_cluster_optimization = OFF;
665+
666+
--echo #
667+
--echo # MDEV-20464 Division by 0 in row_search_with_covering_prefix()
668+
--echo #
669+
CREATE TABLE t1 (f1 INT, f2 INT AS (f1), f3 INT AS (f1), f4 INT AS (f1),
670+
KEY (f1,f2,f3)) ENGINE=InnoDB;
671+
INSERT INTO t1 (f1) VALUES (NULL),(0);
672+
SELECT f1, MAX(f3), COUNT(f4) FROM t1 GROUP BY f1;
673+
DROP TABLE t1;
674+
675+
--echo #
676+
--echo # MDEV-23600 Division by 0 in row_search_with_covering_prefix()
677+
--echo #
678+
CREATE TABLE t(c POINT UNIQUE) ENGINE=InnoDB;
679+
INSERT t SET c=POINT(1,1);
680+
SELECT * FROM t WHERE c > (SELECT MAX(c) FROM t);
681+
DROP TABLE t;
682+
683+
--echo #
684+
--echo # MDEV-12486 Wrong results with innodb_prefix_index_cluster_optimization
685+
--echo #
686+
CREATE TABLE wp_blogs (
687+
blog_id bigint(20) NOT NULL auto_increment,
688+
site_id bigint(20) NOT NULL default '0',
689+
domain varchar(200) NOT NULL default '',
690+
path varchar(100) NOT NULL default '',
691+
registered datetime NOT NULL default '0000-00-00 00:00:00',
692+
last_updated datetime NOT NULL default '0000-00-00 00:00:00',
693+
public tinyint(2) NOT NULL default '1',
694+
archived tinyint(2) NOT NULL default '0',
695+
mature tinyint(2) NOT NULL default '0',
696+
spam tinyint(2) NOT NULL default '0',
697+
deleted tinyint(2) NOT NULL default '0',
698+
lang_id int(11) NOT NULL default '0',
699+
PRIMARY KEY (blog_id),
700+
KEY domain (domain(50),path(5)),
701+
KEY lang_id (lang_id)
702+
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
703+
704+
INSERT INTO wp_blogs (domain, path) VALUES
705+
('domain.no', '/fondsinvesteringer/'), ('domain.no', '/'),
706+
('foo', 'bar'), ('bar', 'foo'), ('foo', 'foo'), ('bar', 'bar'),
707+
('foo', 'foobar'), ('bar', 'foobar'), ('foobar', 'foobar');
708+
709+
SET GLOBAL innodb_prefix_index_cluster_optimization=off;
710+
SELECT blog_id FROM wp_blogs WHERE domain IN ('domain.no')
711+
AND path IN ( '/fondsinvesteringer/', '/' );
712+
713+
SET GLOBAL innodb_prefix_index_cluster_optimization=on;
714+
SELECT blog_id FROM wp_blogs WHERE domain IN ('domain.no')
715+
AND path IN ( '/fondsinvesteringer/', '/' );
716+
717+
DROP TABLE wp_blogs;
718+
719+
SET GLOBAL innodb_prefix_index_cluster_optimization = @save_opt;

0 commit comments

Comments
 (0)