summaryrefslogtreecommitdiff
path: root/mysql-test/r
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/r')
-rw-r--r--mysql-test/r/auto_increment.result10
-rw-r--r--mysql-test/r/create.result7
-rw-r--r--mysql-test/r/ctype_latin1_de.result210
-rw-r--r--mysql-test/r/delete.result15
-rw-r--r--mysql-test/r/func_like.result10
-rw-r--r--mysql-test/r/group_by.result5
-rw-r--r--mysql-test/r/have_openssl_1.require2
-rw-r--r--mysql-test/r/innodb.result17
-rw-r--r--mysql-test/r/join.result23
-rw-r--r--mysql-test/r/lock_multi.result9
-rw-r--r--mysql-test/r/openssl_1.result34
-rw-r--r--mysql-test/r/rpl000001.result2
-rw-r--r--mysql-test/r/rpl_loaddatalocal.result14
-rw-r--r--mysql-test/r/select.result11
-rw-r--r--mysql-test/r/type_datetime.result6
-rw-r--r--mysql-test/r/type_timestamp.result20
16 files changed, 287 insertions, 108 deletions
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result
index 66efd2ba567..e79e6aab56b 100644
--- a/mysql-test/r/auto_increment.result
+++ b/mysql-test/r/auto_increment.result
@@ -84,6 +84,16 @@ ordid ord
3 sdj
1 zzz
drop table t1;
+create table t1 (sid char(5), id int(2) NOT NULL auto_increment, key(sid, id));
+create table t2 (sid char(20), id int(2));
+insert into t2 values ('skr',NULL),('skr',NULL),('test',NULL);
+insert into t1 select * from t2;
+select * from t1;
+sid id
+skr 1
+skr 2
+test 1
+drop table t1,t2;
create table t1 (a int not null primary key auto_increment);
insert into t1 values (0);
update t1 set a=0;
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 5228ae50a83..2ec2759ad7a 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -62,6 +62,13 @@ a$1 $b c$
create table test_$1.test2$ (a int);
drop table test_$1.test2$;
drop database test_$1;
+create table `` (a int);
+Incorrect table name ''
+drop table if exists ``;
+Incorrect table name ''
+create table t1 (`` int);
+Incorrect column name ''
+drop table if exists t1;
create table t1 (a int auto_increment not null primary key, B CHAR(20));
insert into t1 (b) values ("hello"),("my"),("world");
create table t2 (key (b)) select * from t1;
diff --git a/mysql-test/r/ctype_latin1_de.result b/mysql-test/r/ctype_latin1_de.result
index e5ae6f249ee..b79bc67138c 100644
--- a/mysql-test/r/ctype_latin1_de.result
+++ b/mysql-test/r/ctype_latin1_de.result
@@ -1,93 +1,95 @@
drop table if exists t1;
-create table t1 (a char (20) not null, b int not null auto_increment, index (a,b),index(b));
+create table t1 (a char (20) not null, b int not null auto_increment, index (a,b));
insert into t1 (a) values ('ä'),('ac'),('ae'),('ad'),('Äc'),('aeb');
insert into t1 (a) values ('üc'),('uc'),('ue'),('ud'),('Ü'),('ueb'),('uf');
insert into t1 (a) values ('ö'),('oc'),('Öa'),('oe'),('od'),('Öc'),('oeb');
insert into t1 (a) values ('s'),('ss'),('ß'),('ßb'),('ssa'),('ssc'),('ßa');
insert into t1 (a) values ('eä'),('uü'),('öo'),('ää'),('ääa'),('aeae');
-insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É');
+insert into t1 (a) values ('q'),('a'),('u'),('o'),('é'),('É'),('a');
select a,b from t1 order by a,b;
a b
-a 35
-ac 2
-ad 4
+a 1
+a 2
+ac 1
+ad 1
ä 1
-ae 3
-ää 31
-aeae 33
-ääa 32
-aeb 6
-Äc 5
-é 38
-É 39
-eä 28
-o 37
-oc 15
-od 18
-ö 14
-oe 17
-Öa 16
-oeb 20
-Öc 19
-öo 30
-q 34
-s 21
-ss 22
-ß 23
-ssa 25
-ßa 27
-ßb 24
-ssc 26
-u 36
-uc 8
-ud 10
-ue 9
-Ü 11
-ueb 12
-üc 7
-uf 13
-uü 29
+ae 2
+ää 1
+aeae 2
+ääa 1
+aeb 1
+Äc 1
+é 1
+É 2
+eä 1
+o 1
+oc 1
+od 1
+ö 1
+oe 2
+Öa 1
+oeb 1
+Öc 1
+öo 1
+q 1
+s 1
+ss 1
+ß 2
+ssa 1
+ßa 2
+ßb 1
+ssc 1
+u 1
+uc 1
+ud 1
+ue 1
+Ü 2
+ueb 1
+üc 1
+uf 1
+uü 1
select a,b from t1 order by upper(a),b;
a b
-a 35
-ac 2
-ad 4
+a 1
+a 2
+ac 1
+ad 1
ä 1
-ae 3
-ää 31
-aeae 33
-ääa 32
-aeb 6
-Äc 5
-é 38
-É 39
-eä 28
-o 37
-oc 15
-od 18
-ö 14
-oe 17
-Öa 16
-oeb 20
-Öc 19
-öo 30
-q 34
-s 21
-ss 22
-ß 23
-ssa 25
-ßa 27
-ßb 24
-ssc 26
-u 36
-uc 8
-ud 10
-ue 9
-Ü 11
-ueb 12
-üc 7
-uf 13
-uü 29
+ae 2
+ää 1
+aeae 2
+ääa 1
+aeb 1
+Äc 1
+é 1
+É 2
+eä 1
+o 1
+oc 1
+od 1
+ö 1
+oe 2
+Öa 1
+oeb 1
+Öc 1
+öo 1
+q 1
+s 1
+ss 1
+ß 2
+ssa 1
+ßa 2
+ßb 1
+ssc 1
+u 1
+uc 1
+ud 1
+ue 1
+Ü 2
+ueb 1
+üc 1
+uf 1
+uü 1
select a from t1 order by a desc;
a
@@ -129,44 +131,46 @@ ae
ad
ac
a
+a
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
select * from t1 where a like "ö%";
a b
-ö 14
-Öa 16
-Öc 19
-öo 30
+ö 1
+Öa 1
+Öc 1
+öo 1
select * from t1 where a like binary "%É%";
a b
-É 39
+É 2
select * from t1 where a like "%Á%";
a b
-a 35
-ac 2
-ad 4
-ae 3
-aeae 33
-ääa 32
-aeb 6
-Öa 16
-ssa 25
-ßa 27
+a 1
+a 2
+ac 1
+ad 1
+ae 2
+aeae 2
+ääa 1
+aeb 1
+Öa 1
+ssa 1
+ßa 2
select * from t1 where a like "%U%";
a b
-u 36
-uc 8
-ud 10
-ue 9
-ueb 12
-uf 13
-uü 29
+u 1
+uc 1
+ud 1
+ue 1
+ueb 1
+uf 1
+uü 1
select * from t1 where a like "%ss%";
a b
-ss 22
-ssa 25
-ssc 26
+ss 1
+ssa 1
+ssc 1
drop table t1;
select strcmp('ä','ae'),strcmp('ae','ä'),strcmp('aeq','äq'),strcmp('äq','aeq');
strcmp('ä','ae') strcmp('ae','ä') strcmp('aeq','äq') strcmp('äq','aeq')
diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result
index 4fa85ea9cbc..ee0c3ce1219 100644
--- a/mysql-test/r/delete.result
+++ b/mysql-test/r/delete.result
@@ -32,3 +32,18 @@ PRIMARY KEY (`i`)
DELETE FROM t USING t WHERE post='1';
Unknown column 'post' in 'where clause'
drop table if exists t;
+CREATE TABLE t1 (
+bool char(0) default NULL,
+not_null varchar(20) binary NOT NULL default '',
+misc integer not null,
+PRIMARY KEY (not_null)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES (NULL,'a',4), (NULL,'b',5), (NULL,'c',6), (NULL,'d',7);
+select * from t1 where misc > 5 and bool is null;
+bool not_null misc
+NULL c 6
+NULL d 7
+delete from t1 where misc > 5 and bool is null;
+select * from t1 where misc > 5 and bool is null;
+bool not_null misc
+drop table t1;
diff --git a/mysql-test/r/func_like.result b/mysql-test/r/func_like.result
index c2085ba12da..f923c16b2ac 100644
--- a/mysql-test/r/func_like.result
+++ b/mysql-test/r/func_like.result
@@ -1,10 +1,20 @@
drop table if exists t1;
create table t1 (a varchar(10), key(a));
insert into t1 values ("a"),("abc"),("abcd"),("hello"),("test");
+explain select * from t1 where a like 'abc%';
+table type possible_keys key key_len ref rows Extra
+t1 range a a 11 NULL 1 Using where; Using index
+explain select * from t1 where a like concat('abc','%');
+table type possible_keys key key_len ref rows Extra
+t1 range a a 11 NULL 1 Using where; Using index
select * from t1 where a like "abc%";
a
abc
abcd
+select * from t1 where a like concat("abc","%");
+a
+abc
+abcd
select * from t1 where a like "ABC%";
a
abc
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index e6f3256d779..d13f31d6bef 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -305,6 +305,11 @@ score count(*)
2 1
1 2
drop table t1;
+create table t1 (a date default null, b date default null);
+insert t1 values ('1999-10-01','2000-01-10'), ('1997-01-01','1998-10-01');
+select a,min(b) c,count(distinct rand()) from t1 group by a having c<a + interval 1 day;
+a c count(distinct rand())
+drop table t1;
CREATE TABLE t1 (a char(1));
INSERT INTO t1 VALUES ('A'),('B'),('A'),('B'),('A'),('B'),(NULL),('a'),('b'),(NULL),('A'),('B'),(NULL);
SELECT a FROM t1 GROUP BY a;
diff --git a/mysql-test/r/have_openssl_1.require b/mysql-test/r/have_openssl_1.require
index dae48a472b5..032b60d544a 100644
--- a/mysql-test/r/have_openssl_1.require
+++ b/mysql-test/r/have_openssl_1.require
@@ -1,2 +1,2 @@
Variable_name Value
-have_openssl YES
+Ssl_cipher EDH-RSA-DES-CBC3-SHA
diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result
index 5bc21501eca..0021be10d85 100644
--- a/mysql-test/r/innodb.result
+++ b/mysql-test/r/innodb.result
@@ -1073,3 +1073,20 @@ id
select * from t2;
id t1_id
drop table t1,t2;
+DROP TABLE IF EXISTS t1,t2;
+CREATE TABLE t1(id INT NOT NULL, PRIMARY KEY (id)) TYPE=INNODB;
+CREATE TABLE t2(id INT PRIMARY KEY, t1_id INT, INDEX par_ind (t1_id) ) TYPE=INNODB;
+INSERT INTO t1 VALUES(1);
+INSERT INTO t2 VALUES(1, 1);
+SELECT * from t1;
+id
+1
+UPDATE t1,t2 SET t1.id=t1.id+1, t2.t1_id=t1.id+1;
+SELECT * from t1;
+id
+2
+UPDATE t1,t2 SET t1.id=t1.id+1 where t1.id!=t2.id;
+SELECT * from t1;
+id
+3
+DROP TABLE t1,t2;
diff --git a/mysql-test/r/join.result b/mysql-test/r/join.result
index 274a4dec85d..09b819888eb 100644
--- a/mysql-test/r/join.result
+++ b/mysql-test/r/join.result
@@ -251,3 +251,26 @@ t1_id t2_id type cost_unit min_value max_value t3_id item_id id name
22 1 Percent Cost 100 -1 6 291 1 s1
23 1 Percent Cost 100 -1 21 291 1 s1
drop table t1,t2;
+CREATE TABLE t1 (
+siteid varchar(25) NOT NULL default '',
+emp_id varchar(30) NOT NULL default '',
+rate_code varchar(10) default NULL,
+UNIQUE KEY site_emp (siteid,emp_id),
+KEY siteid (siteid)
+) TYPE=MyISAM;
+INSERT INTO t1 VALUES ('rivercats','psmith','cust'), ('rivercats','KWalker','cust');
+CREATE TABLE t2 (
+siteid varchar(25) NOT NULL default '',
+rate_code varchar(10) NOT NULL default '',
+base_rate float NOT NULL default '0',
+PRIMARY KEY (siteid,rate_code),
+FULLTEXT KEY rate_code (rate_code)
+) TYPE=MyISAM;
+INSERT INTO t2 VALUES ('rivercats','cust',20);
+SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE emp.emp_id = 'psmith' AND lr.siteid = 'rivercats';
+rate_code base_rate
+cust 20
+SELECT emp.rate_code, lr.base_rate FROM t1 AS emp LEFT JOIN t2 AS lr USING (siteid, rate_code) WHERE lr.siteid = 'rivercats' AND emp.emp_id = 'psmith';
+rate_code base_rate
+cust 20
+drop table t1,t2;
diff --git a/mysql-test/r/lock_multi.result b/mysql-test/r/lock_multi.result
index 20bc9b9572f..b808fca0acf 100644
--- a/mysql-test/r/lock_multi.result
+++ b/mysql-test/r/lock_multi.result
@@ -1,4 +1,4 @@
-drop table if exists t1;
+drop table if exists t1,t2;
create table t1(n int);
insert into t1 values (1);
lock tables t1 write;
@@ -17,3 +17,10 @@ unlock tables;
n
1
drop table t1;
+create table t1 (a int);
+create table t2 (a int);
+lock table t1 write, t2 write;
+ insert t1 select * from t2;
+drop table t2;
+Table 'test.t2' doesn't exist
+drop table t1;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index b5c67dfbcb0..65b882c0a9b 100644
--- a/mysql-test/r/openssl_1.result
+++ b/mysql-test/r/openssl_1.result
@@ -1,2 +1,32 @@
-SHOW STATUS LIKE 'SSL%';
-Variable_name Value
+drop table if exists t1;
+create table t1(f1 int);
+insert into t1 values (5);
+grant select on test.* to ssl_user1@localhost require SSL;
+grant select on test.* to ssl_user2@localhost require cipher "EDH-RSA-DES-CBC3-SHA";
+grant select on test.* to ssl_user3@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "EDH-RSA-DES-CBC3-SHA" AND SUBJECT "/C=RU/L=orenburg/O=MySQL AB/OU=client/CN=walrus/Email=walrus@mysql.com" ISSUER "/C=RU/ST=Some-State/L=Orenburg/O=MySQL AB/CN=Walrus/Email=walrus@mysql.com";
+flush privileges;
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user1@localhost' to database 'test'
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user2@localhost' to database 'test'
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user3@localhost' to database 'test'
+select * from t1;
+f1
+5
+delete from t1;
+Access denied for user: 'ssl_user4@localhost' to database 'test'
+delete from mysql.user where user='ssl_user%';
+delete from mysql.db where user='ssl_user%';
+flush privileges;
+drop table t1;
diff --git a/mysql-test/r/rpl000001.result b/mysql-test/r/rpl000001.result
index cc3df4730f2..8aa667df063 100644
--- a/mysql-test/r/rpl000001.result
+++ b/mysql-test/r/rpl000001.result
@@ -31,7 +31,7 @@ n
2
select sum(length(word)) from t1;
sum(length(word))
-1021
+1022
drop table t1,t3;
reset master;
stop slave;
diff --git a/mysql-test/r/rpl_loaddatalocal.result b/mysql-test/r/rpl_loaddatalocal.result
new file mode 100644
index 00000000000..dc98b1b5bfb
--- /dev/null
+++ b/mysql-test/r/rpl_loaddatalocal.result
@@ -0,0 +1,14 @@
+slave stop;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+reset master;
+reset slave;
+drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
+slave start;
+create table t1(a int);
+select * into outfile '../../var/master-data/rpl_loaddatalocal.select_outfile' from t1;
+truncate table t1;
+load data local infile './var/master-data/rpl_loaddatalocal.select_outfile' into table t1;
+select a,count(*) from t1 group by a;
+a count(*)
+1 10000
+drop table t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 9ed54f7c253..a2bf24cad54 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -3242,6 +3242,17 @@ t2 1 fld3 1 fld3 A NULL NULL NULL BTREE
drop table t4, t3, t2, t1;
DO 1;
DO benchmark(100,1+1),1,1;
+CREATE TABLE t1 (
+id mediumint(8) unsigned NOT NULL auto_increment,
+pseudo varchar(35) NOT NULL default '',
+PRIMARY KEY (id),
+UNIQUE KEY pseudo (pseudo)
+);
+INSERT INTO t1 (pseudo) VALUES ('test');
+INSERT INTO t1 (pseudo) VALUES ('test1');
+SELECT 1 as rnd1 from t1 where rand() > 2;
+rnd1
+DROP TABLE t1;
CREATE TABLE t1 (gvid int(10) unsigned default NULL, hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, mmid int(10) unsigned default NULL, hdid int(10) unsigned default NULL, fsid int(10) unsigned default NULL, ctid int(10) unsigned default NULL, dtid int(10) unsigned default NULL, cost int(10) unsigned default NULL, performance int(10) unsigned default NULL, serialnumber bigint(20) unsigned default NULL, monitored tinyint(3) unsigned default '1', removed tinyint(3) unsigned default '0', target tinyint(3) unsigned default '0', dt_modified timestamp(14) NOT NULL, name varchar(255) binary default NULL, description varchar(255) default NULL, UNIQUE KEY hmid (hmid,volid)) TYPE=MyISAM;
INSERT INTO t1 VALUES (200001,2,1,1,100,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\E$',''),(200002,2,2,1,101,1,1,1,0,0,0,1,0,1,20020425060057,'\\\\ARKIVIO-TESTPDC\\C$',''),(200003,1,3,2,NULL,NULL,NULL,NULL,NULL,NULL,NULL,1,0,1,20020425060427,'c:',NULL);
CREATE TABLE t2 ( hmid int(10) unsigned default NULL, volid int(10) unsigned default NULL, sampletid smallint(5) unsigned default NULL, sampletime datetime default NULL, samplevalue bigint(20) unsigned default NULL, KEY idx1 (hmid,volid,sampletid,sampletime)) TYPE=MyISAM;
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index cac8cd3d71e..5a9a8699d06 100644
--- a/mysql-test/r/type_datetime.result
+++ b/mysql-test/r/type_datetime.result
@@ -78,3 +78,9 @@ EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref expedition expedition 8 const 1 Using where
drop table t1;
+create table t1 (a datetime not null, b datetime not null);
+insert into t1 values (now(), now());
+insert into t1 values (now(), now());
+select * from t1 where a is null or b is null;
+a b
+drop table t1;
diff --git a/mysql-test/r/type_timestamp.result b/mysql-test/r/type_timestamp.result
index 26dedf544c4..959c69ff6e7 100644
--- a/mysql-test/r/type_timestamp.result
+++ b/mysql-test/r/type_timestamp.result
@@ -84,3 +84,23 @@ date date_time time_stamp
2005-01-01 2005-01-01 00:00:00 2005-01-01 00:00:00
2030-01-01 2030-01-01 00:00:00 2030-01-01 00:00:00
drop table t1;
+show variables like 'new';
+Variable_name Value
+new OFF
+create table t1 (t2 timestamp(2), t4 timestamp(4), t6 timestamp(6),
+t8 timestamp(8), t10 timestamp(10), t12 timestamp(12),
+t14 timestamp(14));
+insert t1 values (0,0,0,0,0,0,0),
+("1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
+"1997-12-31 23:47:59", "1997-12-31 23:47:59", "1997-12-31 23:47:59",
+"1997-12-31 23:47:59");
+select * from t1;
+t2 t4 t6 t8 t10 t12 t14
+00 0000 000000 00000000 0000000000 000000000000 00000000000000
+97 9712 971231 19971231 9712312347 971231234759 19971231234759
+set new=1;
+select * from t1;
+t2 t4 t6 t8 t10 t12 t14
+0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00 0000-00-00 00:00:00
+1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59 1997-12-31 23:47:59
+drop table t1;