summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2005-07-03 14:17:52 +0300
committerunknown <monty@mysql.com>2005-07-03 14:17:52 +0300
commiteeee5fb10b59f6580ebcb08ebd82d0b75c66aa8f (patch)
treebf06496ea5d097316e5972a5cf4c4d5f674fb90b /mysql-test/t
parent6d9bc9c8b71acd82aa79ae580271e7dc4012e5a4 (diff)
parentc7ab92c28a535d2419ffa906042fff7e476df972 (diff)
downloadmariadb-git-eeee5fb10b59f6580ebcb08ebd82d0b75c66aa8f.tar.gz
Merge with 4.1
Makefile.am: Auto merged myisam/mi_create.c: Auto merged myisam/mi_open.c: Auto merged mysql-test/r/ctype_utf8.result: Auto merged mysys/thr_alarm.c: Auto merged VC++Files/sql/mysqld.dsp: Keep old client/mysqldump.c: Manual merge client/mysqltest.c: Automatic merge configure.in: Manual merge mysql-test/r/ctype_ucs.result: Auto merge mysql-test/r/func_str.result: Auto merge mysql-test/r/group_by.result: Auto merge mysql-test/r/insert_select.result: Auto merge mysql-test/r/insert_update.result: Auto merge mysql-test/r/lowercase_table2.result: Auto merge mysql-test/r/select.result: Manual merge mysql-test/r/variables.result: Auto merge mysql-test/t/ctype_ucs.test: Auto merge mysql-test/t/func_str.test: Auto merge mysql-test/t/group_by.test: Auto merge mysql-test/t/insert_select.test: Auto merge mysql-test/t/insert_update.test: Auto merge mysql-test/t/ndb_alter_table.test: Auto merge mysql-test/t/select.test: Auto merge mysql-test/t/variables.test: Auto merge mysys/my_access.c: Auto merge scripts/make_win_src_distribution.sh: Auto merge sql/field.cc: Manual merge sql/ha_ndbcluster.cc: Auto merge sql/handler.cc: Auto merge sql/item.cc: Auto merge sql/item.h: Manual merge sql/item_cmpfunc.h: Auto merge sql/item_strfunc.cc: Auto merge sql/item_strfunc.h: Auto merge sql/mysql_priv.h: manual merge sql/mysqld.cc: manual merge sql/opt_range.cc: manual merge sql/set_var.cc: Auto merge sql/sql_base.cc: manual merge Restore processing of ON DUPLICATE KEY UPDATE sql/sql_insert.cc: manual merge Restore processing of ON DUPLICATE KEY UPDATE Simplify mysql_prepare_insert by using local variable for select_lex and save old values just before they are changed sql/sql_parse.cc: Restore processing of ON DUPLICATE KEY UPDATE sql/sql_prepare.cc: New ON DUPLICATE KEY UPDATE handling sql/sql_select.cc: manual merge sql/sql_table.cc: auto merge sql/sql_yacc.yy: auto merge strings/ctype-ucs2.c: auto merge strings/ctype-utf8.c: auto merge
Diffstat (limited to 'mysql-test/t')
-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_encrypt_nossl.test1
-rw-r--r--mysql-test/t/func_str.test56
-rw-r--r--mysql-test/t/group_by.test12
-rw-r--r--mysql-test/t/insert_select.test22
-rw-r--r--mysql-test/t/insert_update.test10
-rw-r--r--mysql-test/t/lowercase_table2.test3
-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
11 files changed, 147 insertions, 13 deletions
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 2722e8572b0..f4327536795 100644
--- a/mysql-test/t/ctype_ucs.test
+++ b/mysql-test/t/ctype_ucs.test
@@ -408,6 +408,18 @@ 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;
+
+#
# Conversion from an UCS2 string to a decimal column
#
CREATE TABLE t1 (a varchar(64) character set ucs2, b decimal(10,3));
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_encrypt_nossl.test b/mysql-test/t/func_encrypt_nossl.test
index 0e9d93f5968..95c104ce046 100644
--- a/mysql-test/t/func_encrypt_nossl.test
+++ b/mysql-test/t/func_encrypt_nossl.test
@@ -9,6 +9,7 @@ select des_encrypt("test", 1);
select des_encrypt("test", 9);
select des_encrypt("test", 100);
select des_encrypt("test", NULL);
+select des_encrypt(NULL, NULL);
select des_decrypt("test", 'anotherkeystr');
select des_decrypt(1, 1);
select des_decrypt(des_encrypt("test", 'thekey'));
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 617de1b3cc5..2cb7dfe4824 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -543,3 +543,59 @@ 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 9f920a1dd83..aa7ea9bb6cb 100644
--- a/mysql-test/t/group_by.test
+++ b/mysql-test/t/group_by.test
@@ -543,6 +543,18 @@ SELECT hostname, COUNT(DISTINCT user_id) as no FROM t1
DROP TABLE t1;
#
+
+#
+# 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;
+
# Test for bug #8614: GROUP BY 'const' with DISTINCT
#
diff --git a/mysql-test/t/insert_select.test b/mysql-test/t/insert_select.test
index a6468c52645..92e8c7f1231 100644
--- a/mysql-test/t/insert_select.test
+++ b/mysql-test/t/insert_select.test
@@ -3,7 +3,7 @@
#
--disable_warnings
-drop table if exists t1,t2;
+drop table if exists t1,t2,t3;
--enable_warnings
create table t1 (bandID MEDIUMINT UNSIGNED NOT NULL PRIMARY KEY, payoutID SMALLINT UNSIGNED NOT NULL);
@@ -180,10 +180,24 @@ drop table t1, t2;
#
create table t1 (a int unique);
create table t2 (a int, b int);
+create table t3 (c int, d int);
insert into t1 values (1),(2);
insert into t2 values (1,2);
+insert into t3 values (1,6),(3,7);
select * from t1;
-insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
+insert into t1 select a from t2 on duplicate key update a= t1.a + t2.b;
select * from t1;
-drop table t1;
-drop table t2;
+insert into t1 select a+1 from t2 on duplicate key update t1.a= t1.a + t2.b+1;
+select * from t1;
+insert into t1 select t3.c from t3 on duplicate key update a= a + t3.d;
+select * from t1;
+insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= a + 10;
+
+#Some error cases
+--error 1052
+insert into t1 select t2.a from t2 on duplicate key update a= a + t2.b;
+--error 1109
+insert into t1 select t2.a from t2 on duplicate key update t2.a= a + t2.b;
+--error 1109
+insert into t1 select t2.a from t2 group by t2.a on duplicate key update a= t1.a + t2.b;
+drop table t1,t2,t3;
diff --git a/mysql-test/t/insert_update.test b/mysql-test/t/insert_update.test
index 7653fd8dd42..64a76aafa5e 100644
--- a/mysql-test/t/insert_update.test
+++ b/mysql-test/t/insert_update.test
@@ -72,11 +72,13 @@ CREATE TABLE t2 (a INT, b INT, c INT, d INT);
# column names deliberately clash with columns in t1 (Bug#8147)
INSERT t2 VALUES (5,6,30,1), (7,4,40,1), (8,9,60,1);
INSERT t2 VALUES (2,1,11,2), (7,4,40,2);
-INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=c+100;
+INSERT t1 SELECT a,b,c FROM t2 WHERE d=1 ON DUPLICATE KEY UPDATE c=t1.c+100;
SELECT * FROM t1;
INSERT t1 SET a=5 ON DUPLICATE KEY UPDATE b=0;
SELECT * FROM t1;
+--error 1052
INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=c+VALUES(a);
+INSERT t1 SELECT a,b,c FROM t2 WHERE d=2 ON DUPLICATE KEY UPDATE c=t1.c+VALUES(t1.a);
SELECT *, VALUES(a) FROM t1;
DROP TABLE t1;
DROP TABLE t2;
@@ -89,10 +91,12 @@ create table t1 (a int not null unique) engine=myisam;
insert into t1 values (1),(2);
insert ignore into t1 select 1 on duplicate key update a=2;
select * from t1;
-insert ignore into t1 select a from t1 on duplicate key update a=a+1 ;
+insert ignore into t1 select a from t1 as t2 on duplicate key update a=t1.a+1 ;
select * from t1;
insert into t1 select 1 on duplicate key update a=2;
select * from t1;
---error 1062
+--error 1052
insert into t1 select a from t1 on duplicate key update a=a+1 ;
+--error 1052
+insert ignore into t1 select a from t1 on duplicate key update a=t1.a+1 ;
drop table t1;
diff --git a/mysql-test/t/lowercase_table2.test b/mysql-test/t/lowercase_table2.test
index 51c6f6b5ac3..5e38c59386d 100644
--- a/mysql-test/t/lowercase_table2.test
+++ b/mysql-test/t/lowercase_table2.test
@@ -10,9 +10,10 @@ show variables like "lower_case_table_names";
enable_query_log;
--disable_warnings
-DROP TABLE IF EXISTS t1,t2,t3;
+DROP TABLE IF EXISTS t1,t2,t3,t2aA,t1Aa;
DROP DATABASE IF EXISTS `TEST_$1`;
DROP DATABASE IF EXISTS `test_$1`;
+DROP DATABASE mysqltest_LC2;
--enable_warnings
CREATE TABLE T1 (a int);
diff --git a/mysql-test/t/ndb_alter_table.test b/mysql-test/t/ndb_alter_table.test
index 1e5c31da98e..2e5e2293b5c 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
@@ -92,10 +99,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 e131c3d0517..da08c7253a4 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -2007,6 +2007,21 @@ 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;
# Test for bug #6474
#
diff --git a/mysql-test/t/variables.test b/mysql-test/t/variables.test
index f8d833b6b73..c3ffdc79c16 100644
--- a/mysql-test/t/variables.test
+++ b/mysql-test/t/variables.test
@@ -373,9 +373,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';
#