summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2005-07-04 01:36:55 +0300
committerunknown <bell@sanja.is.com.ua>2005-07-04 01:36:55 +0300
commitfbdfcae6a97749e9037a173103f9a5a3e30139d9 (patch)
tree2b655fd149ab34595524445832c75f7ec91137c2 /mysql-test
parentb17793f5b554f6d78ab279507aa5937a1ee13432 (diff)
parentc7ab92c28a535d2419ffa906042fff7e476df972 (diff)
downloadmariadb-git-fbdfcae6a97749e9037a173103f9a5a3e30139d9.tar.gz
Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug_qc-4.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/ctype_ucs.result11
-rw-r--r--mysql-test/r/ctype_utf8.result11
-rw-r--r--mysql-test/r/func_str.result61
-rw-r--r--mysql-test/r/group_by.result6
-rw-r--r--mysql-test/r/select.result9
-rw-r--r--mysql-test/r/variables.result4
-rw-r--r--mysql-test/t/ctype_ucs.test12
-rw-r--r--mysql-test/t/ctype_utf8.test12
-rw-r--r--mysql-test/t/func_str.test70
-rw-r--r--mysql-test/t/group_by.test12
-rw-r--r--mysql-test/t/ndb_alter_table.test11
-rw-r--r--mysql-test/t/select.test15
-rw-r--r--mysql-test/t/variables.test6
13 files changed, 233 insertions, 7 deletions
diff --git a/mysql-test/r/ctype_ucs.result b/mysql-test/r/ctype_ucs.result
index 5902dd247ce..6d00f13737d 100644
--- a/mysql-test/r/ctype_ucs.result
+++ b/mysql-test/r/ctype_ucs.result
@@ -630,3 +630,14 @@ Warnings:
Warning 1265 Data truncated for column 'Field1' at row 1
DROP TABLE t1;
SET NAMES latin1;
+CREATE TABLE t1 (
+a varchar(255) NOT NULL default '',
+KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE ucs2_general_ci;
+insert into t1 values (0x803d);
+insert into t1 values (0x005b);
+select hex(a) from t1;
+hex(a)
+005B
+803D
+drop table t1;
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 12ef8dfb8e8..3a8265b01f7 100644
--- a/mysql-test/r/ctype_utf8.result
+++ b/mysql-test/r/ctype_utf8.result
@@ -939,3 +939,14 @@ content msisdn
ERR Имри.Афимим.Аеимимримдмримрмрирор имримримримр имридм ирбднримрфмририримрфмфмим.Ад.Д имдимримрад.Адимримримрмдиримримримр м.Дадимфшьмримд им.Адимимрн имадми 1234567890
11 g 1234567890
DROP TABLE t1,t2;
+CREATE TABLE t1 (
+a varchar(255) NOT NULL default '',
+KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
+insert into t1 values (_utf8 0xe880bd);
+insert into t1 values (_utf8 0x5b);
+select hex(a) from t1;
+hex(a)
+5B
+E880BD
+drop table t1;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index ea1efbc7c0a..cbedf4370ff 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -789,3 +789,64 @@ field(0,NULL,1,0) field("",NULL,"bar","") field(0.0,NULL,1.0,0.0)
select field(NULL,1,2,NULL), field(NULL,1,2,0);
field(NULL,1,2,NULL) field(NULL,1,2,0)
0 0
+CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
+CREATE TABLE t2 (num int primary key);
+INSERT INTO t1 VALUES ('notnumber');
+INSERT INTO t2 VALUES (0), (1);
+SELECT * FROM t1, t2 WHERE num=str;
+str num
+notnumber 0
+SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
+str num
+notnumber 0
+DROP TABLE t1,t2;
+CREATE TABLE t1(
+id int(11) NOT NULL auto_increment,
+pc int(11) NOT NULL default '0',
+title varchar(20) default NULL,
+PRIMARY KEY (id)
+);
+INSERT INTO t1 VALUES
+(1, 0, 'Main'),
+(2, 1, 'Toys'),
+(3, 1, 'Games');
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
+id col1
+1 Main
+2 Main->Toys
+3 Main->Games
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+LEFT JOIN t1 AS t3 ON t2.pc=t3.id
+WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
+id col1
+2 Main->Toys
+DROP TABLE t1;
+CREATE TABLE t1(
+trackid int(10) unsigned NOT NULL auto_increment,
+trackname varchar(100) NOT NULL default '',
+PRIMARY KEY (trackid)
+);
+CREATE TABLE t2(
+artistid int(10) unsigned NOT NULL auto_increment,
+artistname varchar(100) NOT NULL default '',
+PRIMARY KEY (artistid)
+);
+CREATE TABLE t3(
+trackid int(10) unsigned NOT NULL,
+artistid int(10) unsigned NOT NULL,
+PRIMARY KEY (trackid,artistid)
+);
+INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
+INSERT INTO t2 VALUES (1, 'Vernon Duke');
+INSERT INTO t3 VALUES (1,1);
+SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
+FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
+LEFT JOIN t2 ON t2.artistid=t3.artistid
+WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
+trackname artistname
+April In Paris Vernon Duke Vernon Duke
+Autumn In New York NULL
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/r/group_by.result b/mysql-test/r/group_by.result
index 7f78b8bda9b..295663fe1d3 100644
--- a/mysql-test/r/group_by.result
+++ b/mysql-test/r/group_by.result
@@ -751,3 +751,9 @@ COUNT(DISTINCT(t1.id)) err_comment
1 NULL
1 a problem
DROP TABLE t1, t2;
+CREATE TABLE t1 (n int);
+INSERT INTO t1 VALUES (1);
+SELECT n+1 AS n FROM t1 GROUP BY n;
+n
+2
+DROP TABLE t1;
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index f828759672a..abf5c8c87ad 100644
--- a/mysql-test/r/select.result
+++ b/mysql-test/r/select.result
@@ -2515,3 +2515,12 @@ SELECT b FROM t1 WHERE b=0x8000000000000000;
b
9223372036854775808
DROP TABLE t1;
+CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
+CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
+INSERT INTO `t2` VALUES (0,'READ');
+CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
+INSERT INTO `t3` VALUES (1,'fs');
+select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
+id name gid uid ident level
+1 fs NULL NULL 0 READ
+drop table t1,t2,t3;
diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result
index 602750d5033..e370202cc9f 100644
--- a/mysql-test/r/variables.result
+++ b/mysql-test/r/variables.result
@@ -482,10 +482,10 @@ t1 CREATE TABLE `t1` (
`c3` longtext
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
-SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
+SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
Variable_name Value
-myisam_data_pointer_size 8
+myisam_data_pointer_size 7
SET GLOBAL table_cache=-1;
SHOW VARIABLES LIKE 'table_cache';
Variable_name Value
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 6c72c409463..8dd8d02d018 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -404,3 +404,15 @@ CREATE TABLE t1 (Field1 int(10) unsigned default '0');
INSERT INTO t1 VALUES ('-1');
DROP TABLE t1;
SET NAMES latin1;
+
+#
+# Bug#9557 MyISAM utf8 table crash
+#
+CREATE TABLE t1 (
+ a varchar(255) NOT NULL default '',
+ KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=ucs2 COLLATE ucs2_general_ci;
+insert into t1 values (0x803d);
+insert into t1 values (0x005b);
+select hex(a) from t1;
+drop table t1;
diff --git a/mysql-test/t/ctype_utf8.test b/mysql-test/t/ctype_utf8.test
index 343b7c867e7..0a847057258 100644
--- a/mysql-test/t/ctype_utf8.test
+++ b/mysql-test/t/ctype_utf8.test
@@ -788,3 +788,15 @@ INSERT INTO t2 VALUES ('1234567890',2,'2005-05-24 13:53:25');
SELECT content, t2.msisdn FROM t1, t2 WHERE t1.msisdn = '1234567890';
DROP TABLE t1,t2;
+
+#
+# Bug#9557 MyISAM utf8 table crash
+#
+CREATE TABLE t1 (
+ a varchar(255) NOT NULL default '',
+ KEY a (a)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE utf8_general_ci;
+insert into t1 values (_utf8 0xe880bd);
+insert into t1 values (_utf8 0x5b);
+select hex(a) from t1;
+drop table t1;
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index a5536f7a0be..f5f9ddac3b5 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -527,3 +527,73 @@ DROP TABLE t1, t2;
#
select field(0,NULL,1,0), field("",NULL,"bar",""), field(0.0,NULL,1.0,0.0);
select field(NULL,1,2,NULL), field(NULL,1,2,0);
+
+#
+# Bug #10124: access by integer index with a string key that is not a number
+#
+
+CREATE TABLE t1 (str varchar(20) PRIMARY KEY);
+CREATE TABLE t2 (num int primary key);
+INSERT INTO t1 VALUES ('notnumber');
+INSERT INTO t2 VALUES (0), (1);
+
+SELECT * FROM t1, t2 WHERE num=str;
+SELECT * FROM t1, t2 WHERE num=substring(str from 1 for 6);
+
+DROP TABLE t1,t2;
+
+#
+# Bug #11469: NOT NULL optimization wrongly used for arguments of CONCAT_WS
+#
+
+CREATE TABLE t1(
+ id int(11) NOT NULL auto_increment,
+ pc int(11) NOT NULL default '0',
+ title varchar(20) default NULL,
+ PRIMARY KEY (id)
+);
+
+INSERT INTO t1 VALUES
+ (1, 0, 'Main'),
+ (2, 1, 'Toys'),
+ (3, 1, 'Games');
+
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+ FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+ LEFT JOIN t1 AS t3 ON t2.pc=t3.id;
+SELECT t1.id, CONCAT_WS('->', t3.title, t2.title, t1.title) as col1
+ FROM t1 LEFT JOIN t1 AS t2 ON t1.pc=t2.id
+ LEFT JOIN t1 AS t3 ON t2.pc=t3.id
+ WHERE CONCAT_WS('->', t3.title, t2.title, t1.title) LIKE '%Toys%';
+
+DROP TABLE t1;
+
+
+CREATE TABLE t1(
+ trackid int(10) unsigned NOT NULL auto_increment,
+ trackname varchar(100) NOT NULL default '',
+ PRIMARY KEY (trackid)
+);
+
+CREATE TABLE t2(
+ artistid int(10) unsigned NOT NULL auto_increment,
+ artistname varchar(100) NOT NULL default '',
+ PRIMARY KEY (artistid)
+);
+
+CREATE TABLE t3(
+ trackid int(10) unsigned NOT NULL,
+ artistid int(10) unsigned NOT NULL,
+ PRIMARY KEY (trackid,artistid)
+);
+
+INSERT INTO t1 VALUES (1, 'April In Paris'), (2, 'Autumn In New York');
+INSERT INTO t2 VALUES (1, 'Vernon Duke');
+INSERT INTO t3 VALUES (1,1);
+
+SELECT CONCAT_WS(' ', trackname, artistname) trackname, artistname
+ FROM t1 LEFT JOIN t3 ON t1.trackid=t3.trackid
+ LEFT JOIN t2 ON t2.artistid=t3.artistid
+ WHERE CONCAT_WS(' ', trackname, artistname) LIKE '%In%';
+
+DROP TABLE t1,t2,t3;
diff --git a/mysql-test/t/group_by.test b/mysql-test/t/group_by.test
index 694aa8d7411..23d51b0f297 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -580,3 +580,15 @@ SELECT COUNT(DISTINCT(t1.id)), LEFT(err_comment, 256) AS err_comment
FROM t1 LEFT JOIN t2 ON t1.id=t2.id GROUP BY err_comment;
DROP TABLE t1, t2;
+
+#
+# Test for bug #11414: crash on Windows for a simple GROUP BY query
+#
+
+CREATE TABLE t1 (n int);
+INSERT INTO t1 VALUES (1);
+
+SELECT n+1 AS n FROM t1 GROUP BY n;
+
+DROP TABLE t1;
+
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 9cc1426554f..d6a1ef5e25f 100644
--- a/mysql-test/t/ndb_alter_table.test
+++ b/mysql-test/t/ndb_alter_table.test
@@ -7,6 +7,13 @@ DROP TABLE IF EXISTS t1;
drop database if exists mysqltest;
--enable_warnings
+connect (con1,localhost,root,,test);
+connect (con2,localhost,root,,test);
+
+connection con2;
+-- sleep 2
+connection con1;
+
#
# Basic test to show that the ALTER TABLE
# is working
@@ -88,10 +95,6 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (9410,9412);
-connect (con1,localhost,,,test);
-connect (con2,localhost,,,test);
-
-connection con1;
ALTER TABLE t1 ADD COLUMN c int not null;
select * from t1 order by a;
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 3877e67de41..baaab6e4189 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2060,3 +2060,18 @@ CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
INSERT INTO t1 VALUES (0x8000000000000000);
SELECT b FROM t1 WHERE b=0x8000000000000000;
DROP TABLE t1;
+
+#
+# IN with outer join condition (BUG#9393)
+#
+CREATE TABLE `t1` ( `gid` int(11) default NULL, `uid` int(11) default NULL);
+
+CREATE TABLE `t2` ( `ident` int(11) default NULL, `level` char(16) default NULL);
+INSERT INTO `t2` VALUES (0,'READ');
+
+CREATE TABLE `t3` ( `id` int(11) default NULL, `name` char(16) default NULL);
+INSERT INTO `t3` VALUES (1,'fs');
+
+select * from t3 left join t1 on t3.id = t1.uid, t2 where t2.ident in (0, t1.gid, t3.id, 0);
+
+drop table t1,t2,t3;
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index e45218a9ed7..b8a12323cf9 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -363,9 +363,13 @@ drop table t1;
#
# Bug #6993: myisam_data_pointer_size
+# Wrong bug report, data pointer size must be restricted to 7,
+# setting to 8 will not work on all computers, myisamchk and
+# the server may see a wrong value, such as 0 or negative number
+# if 8 bytes is set.
#
-SET GLOBAL MYISAM_DATA_POINTER_SIZE= 8;
+SET GLOBAL MYISAM_DATA_POINTER_SIZE= 7;
SHOW VARIABLES LIKE 'MYISAM_DATA_POINTER_SIZE';
#