summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2004-08-12 15:34:29 +0300
committerunknown <marko@hundin.mysql.fi>2004-08-12 15:34:29 +0300
commita953bb4b70ea20d806136772214d522b7cfb31f5 (patch)
treebb9e7a2f52bc05c36df82116c7b5f3f6cf36f116 /mysql-test
parent4b390e98c7c454cf1a8046df11c9b48c8c9d1c4e (diff)
parentfe19bd924da6b1f809b3b66260ad939f45da1c71 (diff)
downloadmariadb-git-a953bb4b70ea20d806136772214d522b7cfb31f5.tar.gz
Merge marko@build.mysql.com:/home/bk/mysql-4.1
into hundin.mysql.fi:/home/marko/k/mysql-4.1
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/mysql-test-run.sh2
-rw-r--r--mysql-test/r/ctype_recoding.result24
-rw-r--r--mysql-test/r/ctype_uca.result110
-rw-r--r--mysql-test/r/func_gconcat.result30
-rw-r--r--mysql-test/r/func_str.result3
-rw-r--r--mysql-test/t/ctype_recoding.test14
-rw-r--r--mysql-test/t/ctype_uca.test2
-rw-r--r--mysql-test/t/func_gconcat.test35
-rw-r--r--mysql-test/t/func_str.test6
-rw-r--r--mysql-test/t/grant_cache.test3
10 files changed, 226 insertions, 3 deletions
diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh
index 0c46fa17e1f..ff0b187051f 100644
--- a/mysql-test/mysql-test-run.sh
+++ b/mysql-test/mysql-test-run.sh
@@ -1449,7 +1449,7 @@ then
if [ -z "$USE_RUNNING_NDBCLUSTER" ]
then
echo "Starting ndbcluster"
- ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --diskless --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
+ ./ndb/ndbcluster --port-base=$NDBCLUSTER_PORT --small --initial --data-dir=$MYSQL_TEST_DIR/var || exit 1
NDB_CONNECTSTRING="host=localhost:$NDBCLUSTER_PORT"
export NDB_CONNECTSTRING
else
diff --git a/mysql-test/r/ctype_recoding.result b/mysql-test/r/ctype_recoding.result
index 805f731f0ec..be792c007fc 100644
--- a/mysql-test/r/ctype_recoding.result
+++ b/mysql-test/r/ctype_recoding.result
@@ -136,6 +136,30 @@ SET character_set_connection=binary;
SELECT 'тест' as s;
s
тест
+SET NAMES latin1;
+CREATE TABLE t1 (`` CHAR(128) DEFAULT '', `1` ENUM('1','2') DEFAULT '2');
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `` char(128) default '',
+ `1` enum('1','2') default '2'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+ char(128) YES
+1 enum('1','2') YES 2
+SET NAMES binary;
+SHOW CREATE TABLE t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `ä` char(128) default 'ä',
+ `ä1` enum('ä1','ä2') default 'ä2'
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+SHOW COLUMNS FROM t1;
+Field Type Null Key Default Extra
+ä char(128) YES ä
+ä1 enum('ä1','ä2') YES ä2
+DROP TABLE t1;
SET NAMES binary;
CREATE TABLE `good` (a int);
ERROR HY000: Invalid utf8 character string: ''
diff --git a/mysql-test/r/ctype_uca.result b/mysql-test/r/ctype_uca.result
index 2fd654da434..94fe15fed26 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -1548,6 +1548,116 @@ Z,z,Ź,ź,Ż,ż
ǁ
ǂ
ǃ
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
+group_concat(c1 order by c1)
+A,a,À,Á,Â,Ã,Å,à,á,â,ã,å,Ā,ā,Ă,ă,Ą,ą,Ǎ,ǎ,Ǟ,ǟ,Ǡ,ǡ,Ǻ,ǻ
+AA,Aa,aA,aa
+Ä,ä
+Æ,æ,Ǣ,ǣ,Ǽ,ǽ
+B,b
+Ƃ,ƃ
+C,c,Ç,ç,Ć,ć,Ĉ,ĉ,Ċ,ċ
+cH
+Č,č
+Ƈ,ƈ
+D,d,Ď,ď
+DZ,Dz,dZ,dz,DŽ,Dž,dž,DZ,Dz,dz
+Đ,đ
+Ƌ,ƌ
+Ð,ð
+E,e,È,É,Ê,Ë,è,é,ê,ë,Ē,ē,Ĕ,ĕ,Ė,ė,Ę,ę,Ě,ě
+Ǝ,ǝ
+F,f
+Ƒ,ƒ
+G,g,Ĝ,ĝ,Ğ,ğ,Ġ,ġ,Ģ,ģ,Ǧ,ǧ,Ǵ,ǵ
+Ǥ,ǥ
+Ƣ,ƣ
+H,h,Ĥ,ĥ
+CH,Ch,ch
+ƕ,Ƕ
+Ħ,ħ
+I,i,Ì,Í,Î,Ï,ì,í,î,ï,Ĩ,ĩ,Ī,ī,Ĭ,ĭ,Į,į,İ,Ǐ,ǐ
+IJ,Ij,iJ,ij,IJ,ij
+J,j,Ĵ,ĵ,ǰ
+K,k,Ķ,ķ,Ǩ,ǩ
+Ƙ,ƙ
+L,l,Ĺ,ĺ,Ļ,ļ,Ľ,ľ
+Ŀ,ŀ
+LJ,Lj,lJ,lj,LJ,Lj,lj
+LL,Ll,lL,ll
+Ł,ł
+M,m
+N,n,Ñ,ñ,Ń,ń,Ņ,ņ,Ň,ň,Ǹ,ǹ
+NJ,Nj,nJ,nj,NJ,Nj,nj
+Ŋ,ŋ
+O,o,Ò,Ó,Õ,Ö,ò,ó,õ,ö,Ō,ō,Ŏ,ŏ,Ő,ő,Ơ,ơ,Ǒ,ǒ,Ǫ,ǫ,Ǭ,ǭ
+OE,Oe,oE,oe,Œ,œ
+Ô,ô
+Ø,ø,Ǿ,ǿ
+P,p
+Ƥ,ƥ
+Q,q
+R,r,Ŕ,ŕ,Ŗ,ŗ,Ř,ř
+RR,Rr,rR,rr
+S,s,Ś,ś,Ŝ,ŝ,Ş,ş,ſ
+SS,Ss,sS,ss,ß
+Š,š
+T,t,Ţ,ţ,Ť,ť
+Ŧ,ŧ
+Ƭ,ƭ
+U,u,Ù,Ú,Û,Ü,ù,ú,û,ü,Ũ,ũ,Ū,ū,Ŭ,ŭ,Ů,ů,Ű,ű,Ų,ų,Ư,ư,Ǔ,ǔ,Ǖ,ǖ,Ǘ,ǘ,Ǚ,ǚ,Ǜ,ǜ
+V,v
+W,w,Ŵ,ŵ
+X,x
+Y,y,Ý,ý,ÿ,Ŷ,ŷ,Ÿ
+Ƴ,ƴ
+Z,z,Ź,ź,Ż,ż
+Ž,ž
+Ƶ,ƶ
+Ʒ,Ǯ,ǯ
+Ƹ,ƹ
+Þ,þ
+ƿ,Ƿ
+Ƨ,ƨ
+Ƽ,ƽ
+Ƅ,ƅ
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
group_concat(c1 order by c1)
÷
diff --git a/mysql-test/r/func_gconcat.result b/mysql-test/r/func_gconcat.result
index 0c8054c1f03..1ddbc18d965 100644
--- a/mysql-test/r/func_gconcat.result
+++ b/mysql-test/r/func_gconcat.result
@@ -321,3 +321,33 @@ HAVING LEFT(names, 1) ='J';
names
John###Anna###Bill
DROP TABLE t1;
+CREATE TABLE t1 ( a int, b TEXT );
+INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row');
+SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;
+GROUP_CONCAT(b ORDER BY b)
+First Row
+Second Row
+DROP TABLE t1;
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
+CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+a_id b_list
+1 1,2,3
+2 4,5
+3 NULL
+DROP TABLE t2;
+DROP TABLE t1;
+CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
+INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
+CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
+INSERT INTO t2 VALUES (1,'A'),(1,'B'),(3,'F');
+SELECT t1.A_ID, GROUP_CONCAT(t2.B_DESC) AS B_DESC FROM t1 LEFT JOIN t2 ON t1.A_ID=t2.A_ID GROUP BY t1.A_ID ORDER BY t1.A_DESC;
+A_ID B_DESC
+1 A,B
+2 NULL
+3 F
+DROP TABLE t1;
+DROP TABLE t2;
diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result
index e07ee4f0add..345832387bd 100644
--- a/mysql-test/r/func_str.result
+++ b/mysql-test/r/func_str.result
@@ -673,3 +673,6 @@ c1 c2
2147483647 4294967295
-2147483648 0
drop table t1;
+select left(1234, 3) + 0;
+left(1234, 3) + 0
+123
diff --git a/mysql-test/t/ctype_recoding.test b/mysql-test/t/ctype_recoding.test
index de6332f272c..82d0643b577 100644
--- a/mysql-test/t/ctype_recoding.test
+++ b/mysql-test/t/ctype_recoding.test
@@ -98,6 +98,20 @@ SET NAMES utf8;
SET character_set_connection=binary;
SELECT 'тест' as s;
+# Bug#4417, another aspect:
+# Check that both "SHOW CREATE TABLE" and "SHOW COLUMNS"
+# return column names and default values in UTF8 after "SET NAMES BINARY"
+
+SET NAMES latin1;
+CREATE TABLE t1 (`` CHAR(128) DEFAULT '', `1` ENUM('1','2') DEFAULT '2');
+SHOW CREATE TABLE t1;
+SHOW COLUMNS FROM t1;
+SET NAMES binary;
+SHOW CREATE TABLE t1;
+SHOW COLUMNS FROM t1;
+DROP TABLE t1;
+
+
#
# Test that we allow only well-formed UTF8 identitiers
#
diff --git a/mysql-test/t/ctype_uca.test b/mysql-test/t/ctype_uca.test
index 0ab46a5a637..187d21f9ab7 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -176,7 +176,7 @@ select group_concat(c1 order by c1) from t1 group by c1 collate utf8_turkish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_czech_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_danish_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_lithuanian_ci;
---select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
+select group_concat(c1 order by c1) from t1 group by c1 collate utf8_slovak_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_spanish2_ci;
select group_concat(c1 order by c1) from t1 group by c1 collate utf8_roman_ci;
diff --git a/mysql-test/t/func_gconcat.test b/mysql-test/t/func_gconcat.test
index 62343fa2af8..d27e5d7d77f 100644
--- a/mysql-test/t/func_gconcat.test
+++ b/mysql-test/t/func_gconcat.test
@@ -201,3 +201,38 @@ SELECT GROUP_CONCAT(a SEPARATOR '||') AS names FROM t1
SELECT GROUP_CONCAT(a SEPARATOR '###') AS names FROM t1
HAVING LEFT(names, 1) ='J';
DROP TABLE t1;
+
+#
+# check blobs
+#
+
+CREATE TABLE t1 ( a int, b TEXT );
+INSERT INTO t1 VALUES (1,'First Row'), (2,'Second Row');
+SELECT GROUP_CONCAT(b ORDER BY b) FROM t1 GROUP BY a;
+DROP TABLE t1;
+
+#
+# check null values #1
+#
+
+CREATE TABLE t1 (a_id tinyint(4) NOT NULL default '0', PRIMARY KEY (a_id)) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t1 VALUES (1),(2),(3);
+CREATE TABLE t2 (b_id tinyint(4) NOT NULL default '0',b_a tinyint(4) NOT NULL default '0', PRIMARY KEY (b_id), KEY (b_a),
+ CONSTRAINT fk_b_a FOREIGN KEY (b_a) REFERENCES t1 (a_id) ON DELETE CASCADE ON UPDATE NO ACTION) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+INSERT INTO t2 VALUES (1,1),(2,1),(3,1),(4,2),(5,2);
+SELECT * FROM (SELECT t1.*,GROUP_CONCAT(t2.b_id SEPARATOR ',') as b_list FROM (t1 LEFT JOIN (t2) on t1.a_id = t2.b_a) GROUP BY t1.a_id ) AS xyz;
+DROP TABLE t2;
+DROP TABLE t1;
+
+#
+# check null values #2
+#
+
+CREATE TABLE t1 (A_ID INT NOT NULL,A_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID));
+INSERT INTO t1 VALUES (1,'ABC'), (2,'EFG'), (3,'HIJ');
+CREATE TABLE t2 (A_ID INT NOT NULL,B_DESC CHAR(3) NOT NULL,PRIMARY KEY (A_ID,B_DESC));
+INSERT INTO t2 VALUES (1,'A'),(1,'B'),(3,'F');
+SELECT t1.A_ID, GROUP_CONCAT(t2.B_DESC) AS B_DESC FROM t1 LEFT JOIN t2 ON t1.A_ID=t2.A_ID GROUP BY t1.A_ID ORDER BY t1.A_DESC;
+DROP TABLE t1;
+DROP TABLE t2;
+
diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test
index 61d0326f7dd..e7852df40b3 100644
--- a/mysql-test/t/func_str.test
+++ b/mysql-test/t/func_str.test
@@ -402,3 +402,9 @@ insert into t1 values ('-21474836461','-21474836461');
show warnings;
select * from t1;
drop table t1;
+
+#
+# Bug #4878: LEFT() in integer/float context
+#
+
+select left(1234, 3) + 0;
diff --git a/mysql-test/t/grant_cache.test b/mysql-test/t/grant_cache.test
index a82cd732802..e5bde977bb7 100644
--- a/mysql-test/t/grant_cache.test
+++ b/mysql-test/t/grant_cache.test
@@ -67,7 +67,8 @@ show status like "Qcache_queries_in_cache";
show status like "Qcache_hits";
show status like "Qcache_not_cached";
-connect (unkuser,localhost,,,,$MASTER_MYPORT,master.sock);
+# Don't use '' as user because it will pick Unix login
+connect (unkuser,localhost,unkuser,,,$MASTER_MYPORT,master.sock);
connection unkuser;
show grants for current_user();