summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorEugene Kosov <claprix@yandex.ru>2019-06-20 12:26:01 +0300
committerEugene Kosov <claprix@yandex.ru>2019-06-20 12:26:01 +0300
commitcf40393471b10ca68cc1d2804c22ab9203900978 (patch)
treea0d762185ff33d3e866b41aec383917331ac80d7 /mysql-test
parentd1fa6ba845aeaae5e4d8165bd6d7aeeb75d919b6 (diff)
parent15065a2398aa3ddc40625f150cf8646d505b692a (diff)
downloadmariadb-git-cf40393471b10ca68cc1d2804c22ab9203900978.tar.gz
Merge 5.5 into 10.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/lib/mtr_report.pm26
-rw-r--r--mysql-test/r/join_outer.result34
-rw-r--r--mysql-test/r/join_outer_jcl6.result34
-rw-r--r--mysql-test/t/join_outer.test23
4 files changed, 116 insertions, 1 deletions
diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm
index 8e040358e58..3701ad79b15 100644
--- a/mysql-test/lib/mtr_report.pm
+++ b/mysql-test/lib/mtr_report.pm
@@ -36,6 +36,21 @@ use POSIX qw[ _exit ];
use IO::Handle qw[ flush ];
use mtr_results;
+use Term::ANSIColor;
+
+my %color_map = qw/pass green
+ retry-pass green
+ fail red
+ retry-fail red
+ disabled bright_black
+ skipped yellow
+ reset reset/;
+sub xterm_color {
+ if (-t STDOUT and defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) {
+ syswrite STDOUT, color($color_map{$_[0]});
+ }
+}
+
my $tot_real_time= 0;
our $timestamp= 0;
@@ -498,7 +513,16 @@ sub mtr_print (@) {
sub mtr_report (@) {
if (defined $verbose)
{
- print _name(). join(" ", @_). "\n";
+ my @s = split /\[ (\S+) \]/, _name() . "@_\n";
+ if (@s > 1) {
+ print $s[0];
+ xterm_color($s[1]);
+ print "[ $s[1] ]";
+ xterm_color('reset');
+ print $s[2];
+ } else {
+ print $s[0];
+ }
}
}
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result
index 3120a6df81e..739216b1938 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -2512,6 +2512,40 @@ WHERE tb1.pk = 40
ORDER BY tb1.i1;
v2
DROP TABLE t1,t2;
+#
+# MDEV-19790 : IS NOT TRUE / IS NOT FALSE predicates over
+# inner tables of outer joins
+#
+create table t1 (a int);
+create table t2 (b int);
+insert into t1 values (3), (7), (1);
+insert into t2 values (7), (4), (3);
+select * from t1 left join t2 on a=b;
+a b
+3 3
+7 7
+1 NULL
+select * from t1 left join t2 on a=b where (b > 3) is not true;
+a b
+3 3
+1 NULL
+explain extended select * from t1 left join t2 on a=b where (b > 3) is not true;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`b` = `test`.`t1`.`a`)) where ((`test`.`t2`.`b` > 3) is not true)
+select * from t1 left join t2 on a=b where (b > 3) is not false;
+a b
+7 7
+1 NULL
+explain extended select * from t1 left join t2 on a=b where (b > 3) is not false;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`b` = `test`.`t1`.`a`)) where ((`test`.`t2`.`b` > 3) is not false)
+drop table t1,t2;
# end of 5.5 tests
#
# MDEV-19258: chained right joins all converted to inner joins
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 44250a96c05..568b832f874 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -2523,6 +2523,40 @@ WHERE tb1.pk = 40
ORDER BY tb1.i1;
v2
DROP TABLE t1,t2;
+#
+# MDEV-19790 : IS NOT TRUE / IS NOT FALSE predicates over
+# inner tables of outer joins
+#
+create table t1 (a int);
+create table t2 (b int);
+insert into t1 values (3), (7), (1);
+insert into t2 values (7), (4), (3);
+select * from t1 left join t2 on a=b;
+a b
+7 7
+3 3
+1 NULL
+select * from t1 left join t2 on a=b where (b > 3) is not true;
+a b
+3 3
+1 NULL
+explain extended select * from t1 left join t2 on a=b where (b > 3) is not true;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`b` = `test`.`t1`.`a`)) where ((`test`.`t2`.`b` > 3) is not true)
+select * from t1 left join t2 on a=b where (b > 3) is not false;
+a b
+7 7
+1 NULL
+explain extended select * from t1 left join t2 on a=b where (b > 3) is not false;
+id select_type table type possible_keys key key_len ref rows filtered Extra
+1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
+1 SIMPLE t2 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join)
+Warnings:
+Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t1` left join `test`.`t2` on((`test`.`t2`.`b` = `test`.`t1`.`a`)) where ((`test`.`t2`.`b` > 3) is not false)
+drop table t1,t2;
# end of 5.5 tests
#
# MDEV-19258: chained right joins all converted to inner joins
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 19cc5b8049a..b242b42710b 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -2040,6 +2040,29 @@ ORDER BY tb1.i1;
DROP TABLE t1,t2;
+--echo #
+--echo # MDEV-19790 : IS NOT TRUE / IS NOT FALSE predicates over
+--echo # inner tables of outer joins
+--echo #
+
+create table t1 (a int);
+create table t2 (b int);
+insert into t1 values (3), (7), (1);
+insert into t2 values (7), (4), (3);
+select * from t1 left join t2 on a=b;
+
+let $q=
+select * from t1 left join t2 on a=b where (b > 3) is not true;
+eval $q;
+eval explain extended $q;
+
+let $q=
+select * from t1 left join t2 on a=b where (b > 3) is not false;
+eval $q;
+eval explain extended $q;
+
+drop table t1,t2;
+
--echo # end of 5.5 tests
--echo #