summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/case.test9
-rw-r--r--mysql-test/t/insert.test2
-rw-r--r--mysql-test/t/multi_update.test10
-rw-r--r--mysql-test/t/rpl_log_pos.test4
-rw-r--r--mysql-test/t/variables.test6
5 files changed, 29 insertions, 2 deletions
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index 79511f5f546..3ba3a292c77 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -30,3 +30,12 @@ insert into t1 values(1),(2),(3),(4);
select case a when 1 then 2 when 2 then 3 else 0 end as fcase, count(*) from t1 group by fcase;
select case a when 1 then "one" when 2 then "two" else "nothing" end as fcase, count(*) from t1 group by fcase;
drop table t1;
+
+#
+# Test MAX(CASE ... ) that can return null
+#
+
+create table t1 (row int not null, col int not null, val varchar(255) not null);
+insert into t1 values (1,1,'orange'),(1,2,'large'),(2,1,'yellow'),(2,2,'medium'),(3,1,'green'),(3,2,'small');
+select max(case col when 1 then val else null end) as color from t1 group by row;
+drop table t1;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index 0bca8dc5890..9b06b522028 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -46,6 +46,8 @@ drop table t1;
create table t1 (sid char(20), id int(2) NOT NULL auto_increment, key(sid, id));
insert into t1 values ('skr',NULL),('skr',NULL),('test',NULL);
select * from t1;
+insert into t1 values ('rts',NULL),('rts',NULL),('test',NULL);
+select * from t1;
drop table t1;
#
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index ff456b710c1..088b355a17c 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -214,3 +214,13 @@ UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
select * from t1;
select * from t2;
drop table t1,t2;
+drop table if exists t1,t2,t3;
+CREATE TABLE t1 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
+INSERT INTO t1 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a'),(10,''),(11,''),(12,''),(13,'');
+CREATE TABLE t2 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
+INSERT INTO t2 VALUES (1,'jedan'),(2,'dva'),(3,'tri'),(4,'xxxxxxxxxx'),(5,'a');
+CREATE TABLE t3 ( broj int(4) unsigned NOT NULL default '0', naziv char(25) NOT NULL default 'NEPOZNAT', PRIMARY KEY (broj)) TYPE=MyISAM;
+INSERT INTO t3 VALUES (1,'jedan'),(2,'dva');
+update t1,t2 set t1.naziv="aaaa" where t1.broj=t2.broj;
+update t1,t2,t3 set t1.naziv="bbbb", t2.naziv="aaaa" where t1.broj=t2.broj and t2.broj=t3.broj;
+drop table if exists t1,t2,t3;
diff --git a/mysql-test/t/rpl_log_pos.test b/mysql-test/t/rpl_log_pos.test
index d320796edd3..03c86137ae0 100644
--- a/mysql-test/t/rpl_log_pos.test
+++ b/mysql-test/t/rpl_log_pos.test
@@ -6,7 +6,9 @@ show master status;
sync_slave_with_master;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
+slave stop;
change master to master_log_pos=73;
+slave start;
sleep 5;
stop slave;
@@ -17,6 +19,7 @@ start slave;
sleep 5;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
show slave status;
+slave stop;
change master to master_log_pos=173;
--replace_result 3306 MASTER_PORT 9306 MASTER_PORT 3334 MASTER_PORT 3336 MASTER_PORT
start slave;
@@ -31,6 +34,7 @@ create table t1 (n int);
insert into t1 values (1),(2),(3);
save_master_pos;
connection slave;
+slave stop;
change master to master_log_pos=79;
start slave;
sync_with_master;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index 552777743f8..5863cb97d57 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -34,13 +34,15 @@ drop table t1;
set max_join_size=100;
show variables like 'max_join_size';
-# Removed, because it has different value with/without BIG_TABLES
-#show global variables like 'max_join_size';
+--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
+show global variables like 'max_join_size';
set GLOBAL max_join_size=2000;
show global variables like 'max_join_size';
set max_join_size=DEFAULT;
+--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
show variables like 'max_join_size';
set GLOBAL max_join_size=DEFAULT;
+--replace_result 18446744073709551615 HA_POS_ERROR 4294967295 HA_POS_ERROR
show global variables like 'max_join_size';
set @@max_join_size=1000, @@global.max_join_size=2000;
select @@local.max_join_size, @@global.max_join_size;