summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorVicențiu Ciorbaru <vicentiu@mariadb.org>2017-09-19 01:02:01 +0300
committerVicențiu Ciorbaru <vicentiu@mariadb.org>2017-09-19 01:02:01 +0300
commitd6a7de2022756fc1eebe11e4b9e30f33ff541a25 (patch)
tree858b1151f3c171c0858661df0b7ebd790efb2eab /mysql-test
parenta8700998174de23cb0deeb75aba29f6afb17dedc (diff)
parente7bb818116d6fad5376452a7d0b326e8787f6a0e (diff)
downloadmariadb-git-d6a7de2022756fc1eebe11e4b9e30f33ff541a25.tar.gz
Merge branch '5.5' into 10.0
Diffstat (limited to 'mysql-test')
-rwxr-xr-xmysql-test/mysql-test-run.pl3
-rw-r--r--mysql-test/r/count_distinct.result25
-rw-r--r--mysql-test/r/log_tables-big.result9
-rw-r--r--mysql-test/r/view.result3
-rw-r--r--mysql-test/t/count_distinct.test29
-rw-r--r--mysql-test/t/log_tables-big.test9
-rw-r--r--mysql-test/t/view.test5
7 files changed, 66 insertions, 17 deletions
diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
index 635b1e8f7f9..33d9c7b4ee5 100755
--- a/mysql-test/mysql-test-run.pl
+++ b/mysql-test/mysql-test-run.pl
@@ -751,8 +751,7 @@ sub run_test_server ($$$) {
# Repeat test $opt_repeat number of times
my $repeat= $result->{repeat} || 1;
- # Don't repeat if test was skipped
- if ($repeat < $opt_repeat && $result->{'result'} ne 'MTR_RES_SKIPPED')
+ if ($repeat < $opt_repeat)
{
$result->{retries}= 0;
$result->{rep_failures}++ if $result->{failures};
diff --git a/mysql-test/r/count_distinct.result b/mysql-test/r/count_distinct.result
index d55a232c715..760b2710586 100644
--- a/mysql-test/r/count_distinct.result
+++ b/mysql-test/r/count_distinct.result
@@ -106,3 +106,28 @@ count(distinct user_id)
17
drop table t1;
set @@tmp_table_size = default;
+create table t1 (
+a VARCHAR(1020),
+b int
+);
+insert into t1 values
+( 0 , 1 ),
+( 1 , 2 ),
+( 2 , 3 ),
+( 3 , 4 ),
+( 4 , 5 ),
+( 5 , 6 ),
+( 6 , 7 ),
+( 7 , 8 ),
+( 8 , 9 ),
+( 9 , 10 ),
+( 0 , 11 ),
+( 1 , 12 ),
+( 2 , 13 ),
+( 3 , 14 );
+set @@tmp_table_size=1024;
+select count(distinct a) from t1;
+count(distinct a)
+10
+drop table t1;
+set @@tmp_table_size = default;
diff --git a/mysql-test/r/log_tables-big.result b/mysql-test/r/log_tables-big.result
index 1e189a7726f..4435d6d2723 100644
--- a/mysql-test/r/log_tables-big.result
+++ b/mysql-test/r/log_tables-big.result
@@ -1,3 +1,4 @@
+set @log_output.saved = @@global.log_output;
set @@global.log_output = 'TABLE';
set session long_query_time=10;
select get_lock('bug27638', 1);
@@ -7,25 +8,25 @@ set session long_query_time=1;
select get_lock('bug27638', 2);
get_lock('bug27638', 2)
0
-select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+select if (query_time >= '00:00:01', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 2)';
qt sql_text
OK select get_lock('bug27638', 2)
select get_lock('bug27638', 60);
get_lock('bug27638', 60)
0
-select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+select if (query_time >= '00:00:59', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 60)';
qt sql_text
OK select get_lock('bug27638', 60)
select get_lock('bug27638', 101);
get_lock('bug27638', 101)
0
-select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+select if (query_time >= '00:01:40', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 101)';
qt sql_text
OK select get_lock('bug27638', 101)
select release_lock('bug27638');
release_lock('bug27638')
1
-set @@global.log_output=default;
+set @@global.log_output = @log_output.saved;
diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result
index 1cff9f378f8..c9889d7190b 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -5627,9 +5627,6 @@ CREATE TABLE t3 (a INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
-EXECUTE stmt;
-ERROR HY000: Can not insert into join view 'test.v2' without fields list
-EXECUTE stmt;
ERROR HY000: Can not insert into join view 'test.v2' without fields list
drop view v1,v2;
drop table t3;
diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test
index a00574b6cba..86045e862e7 100644
--- a/mysql-test/t/count_distinct.test
+++ b/mysql-test/t/count_distinct.test
@@ -121,5 +121,34 @@ drop table t1;
set @@tmp_table_size = default;
#
+# MDEV-13457: Wrong result for aggregate function with distinct clause when the value for
+# tmp_table_size is small
+#
+
+create table t1 (
+a VARCHAR(1020),
+b int
+);
+insert into t1 values
+( 0 , 1 ),
+( 1 , 2 ),
+( 2 , 3 ),
+( 3 , 4 ),
+( 4 , 5 ),
+( 5 , 6 ),
+( 6 , 7 ),
+( 7 , 8 ),
+( 8 , 9 ),
+( 9 , 10 ),
+( 0 , 11 ),
+( 1 , 12 ),
+( 2 , 13 ),
+( 3 , 14 );
+set @@tmp_table_size=1024;
+select count(distinct a) from t1;
+drop table t1;
+set @@tmp_table_size = default;
+
+#
# End of 5.5 tests
#
diff --git a/mysql-test/t/log_tables-big.test b/mysql-test/t/log_tables-big.test
index 8936a163d73..fa8810ecd3b 100644
--- a/mysql-test/t/log_tables-big.test
+++ b/mysql-test/t/log_tables-big.test
@@ -7,6 +7,7 @@
# check that CSV engine was compiled in
--source include/have_csv.inc
+set @log_output.saved = @@global.log_output;
set @@global.log_output = 'TABLE';
connect (con1,localhost,root,,);
@@ -21,13 +22,13 @@ select get_lock('bug27638', 1);
connection con2;
set session long_query_time=1;
select get_lock('bug27638', 2);
-select if (query_time >= '00:00:01', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+select if (query_time >= '00:00:01', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 2)';
select get_lock('bug27638', 60);
-select if (query_time >= '00:00:59', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+select if (query_time >= '00:00:59', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 60)';
select get_lock('bug27638', 101);
-select if (query_time >= '00:01:40', 'OK', 'WRONG') as qt, sql_text from mysql.slow_log
+select if (query_time >= '00:01:40', 'OK', concat('WRONG: ',query_time)) as qt, sql_text from mysql.slow_log
where sql_text = 'select get_lock(\'bug27638\', 101)';
connection con1;
select release_lock('bug27638');
@@ -36,4 +37,4 @@ connection default;
disconnect con1;
disconnect con2;
-set @@global.log_output=default;
+set @@global.log_output = @log_output.saved;
diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test
index 89f9c744a5f..cbccbb5d656 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -5573,11 +5573,8 @@ drop table t1,t2,t3;
CREATE TABLE t3 (a INT);
CREATE ALGORITHM = MERGE VIEW v1 AS SELECT t2.a FROM t3 AS t1, t3 AS t2;
CREATE ALGORITHM = MERGE VIEW v2 AS SELECT * FROM v1;
-PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
---error ER_VIEW_NO_INSERT_FIELD_LIST
-EXECUTE stmt;
--error ER_VIEW_NO_INSERT_FIELD_LIST
-EXECUTE stmt;
+PREPARE stmt FROM 'REPLACE INTO v2 SELECT a FROM t3';
drop view v1,v2;
drop table t3;