diff options
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/install_test_db.sh | 11 | ||||
-rw-r--r-- | mysql-test/mysql-test-run.sh | 2 | ||||
-rw-r--r-- | mysql-test/r/create.result | 6 | ||||
-rw-r--r-- | mysql-test/r/func_math.result | 9 | ||||
-rw-r--r-- | mysql-test/r/multi_update.result | 14 | ||||
-rw-r--r-- | mysql-test/r/mysqlbinlog.result | 8 | ||||
-rw-r--r-- | mysql-test/t/create.test | 12 | ||||
-rw-r--r-- | mysql-test/t/func_math.test | 8 | ||||
-rw-r--r-- | mysql-test/t/multi_update.test | 14 |
9 files changed, 81 insertions, 3 deletions
diff --git a/mysql-test/install_test_db.sh b/mysql-test/install_test_db.sh index c87cf82088f..3b361b8afec 100644 --- a/mysql-test/install_test_db.sh +++ b/mysql-test/install_test_db.sh @@ -5,9 +5,16 @@ # This scripts creates the privilege tables db, host, user, tables_priv, # columns_priv in the mysql database, as well as the func table. -if [ x$1 = x"-bin" ]; then +if [ x$1 = x"--bin" ]; then shift 1 - execdir=../bin + +# Check if it's a binary distribution or a 'make install' +if test -x ../libexec/mysqld + then + execdir=../libexec + else + execdir=../bin +fi bindir=../bin BINARY_DIST=1 fix_bin=mysql-test diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index cbacedfedb4..a606a492058 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -487,7 +487,7 @@ else MYSQL_MANAGER_CLIENT="$BASEDIR/bin/mysqlmanagerc" MYSQL_MANAGER_PWGEN="$BASEDIR/bin/mysqlmanager-pwgen" MYSQL="$BASEDIR/bin/mysql" - INSTALL_DB="./install_test_db -bin" + INSTALL_DB="./install_test_db --bin" MYSQL_FIX_SYSTEM_TABLES="$BASEDIR/bin/mysql_fix_privilege_tables" if test -d "$BASEDIR/share/mysql/english" then diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index 627913939fb..22743782484 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -216,3 +216,9 @@ a b 0 2 3 4 drop table t1; +create table `t1 `(a int); +Incorrect table name 't1 ' +create database `db1 `; +Incorrect database name 'db1 ' +create table t1(`a ` int); +Incorrect column name 'a ' diff --git a/mysql-test/r/func_math.result b/mysql-test/r/func_math.result index 46ad7a14e25..04dabcb5481 100644 --- a/mysql-test/r/func_math.result +++ b/mysql-test/r/func_math.result @@ -59,3 +59,12 @@ ASIN(0.8+0.2) SELECT ASIN(1.2-0.2); ASIN(1.2-0.2) 1.570796 +select floor(log(4)/log(2)); +floor(log(4)/log(2)) +2 +select floor(log(8)/log(2)); +floor(log(8)/log(2)) +3 +select floor(log(16)/log(2)); +floor(log(16)/log(2)) +4 diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 21035c8bc60..12cb965f045 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -386,3 +386,17 @@ SELECT * from t2; a 1 DROP TABLE t1,t2; +create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); +create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); +insert into t1 values (0,'A01-Comp',1); +insert into t1 values (0,'B01-Comp',1); +insert into t2 values (0,1,'A Note',1); +update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; +select * from t1; +p_id p_code p_active +1 A01-Comp 1 +2 B01-Comp 1 +select * from t2; +c2_id c2_p_id c2_note c2_active +1 1 A Note 1 +drop table t1, t2; diff --git a/mysql-test/r/mysqlbinlog.result b/mysql-test/r/mysqlbinlog.result index df472eb9c80..79bf46280dd 100644 --- a/mysql-test/r/mysqlbinlog.result +++ b/mysql-test/r/mysqlbinlog.result @@ -14,6 +14,7 @@ insert into t1 values ("Alas"); flush logs; --- Local -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; create table t1 (word varchar(20)); @@ -31,19 +32,23 @@ LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-4-0' INTO TABLE `t1` FI LOAD DATA LOCAL INFILE 'MYSQL_TEST_DIR/var/tmp/words.dat-5-0' INTO TABLE `t1` FIELDS TERMINATED BY '\t' ENCLOSED BY '' ESCAPED BY '\\' LINES TERMINATED BY '\n' STARTING BY '' (word); --- Broken LOAD DATA -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); --- --database -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; SET INSERT_ID=1; --- --position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); --- Remote -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; create table t1 (word varchar(20)); @@ -64,14 +69,17 @@ SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); --- Broken LOAD DATA -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); --- --database -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; SET INSERT_ID=1; --- --position -- +/*!40019 SET @@session.max_insert_delayed_threads=0*/; use test; SET TIMESTAMP=1000000000; insert into t1 values ("Alas"); diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 8aee586268f..94c2f24dffc 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -179,3 +179,15 @@ create table if not exists t1 select 3 as 'a',4 as 'b'; create table if not exists t1 select 3 as 'a',3 as 'b'; select * from t1; drop table t1; + +# +# Test for Bug #2985 +# "Table truncated when creating another table name with Spaces" +# + +--error 1103 +create table `t1 `(a int); +--error 1102 +create database `db1 `; +--error 1166; +create table t1(`a ` int); diff --git a/mysql-test/t/func_math.test b/mysql-test/t/func_math.test index 2de692d4389..7057b0ca412 100644 --- a/mysql-test/t/func_math.test +++ b/mysql-test/t/func_math.test @@ -28,3 +28,11 @@ SELECT ACOS(0.2*5.0); SELECT ACOS(0.5*2.0); SELECT ASIN(0.8+0.2); SELECT ASIN(1.2-0.2); + +# +# Bug #3051 FLOOR returns invalid +# + +select floor(log(4)/log(2)); +select floor(log(8)/log(2)); +select floor(log(16)/log(2)); diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 283637912a1..39ea136bde1 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -325,3 +325,17 @@ DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2; SELECT * from t1; SELECT * from t2; DROP TABLE t1,t2; + +# +# Test update with const tables +# + +create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) ); +create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) ); +insert into t1 values (0,'A01-Comp',1); +insert into t1 values (0,'B01-Comp',1); +insert into t2 values (0,1,'A Note',1); +update t1 left join t2 on p_id = c2_p_id set c2_note = 'asdf-1' where p_id = 2; +select * from t1; +select * from t2; +drop table t1, t2; |