summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/ansi.test12
-rw-r--r--mysql-test/t/auto_increment.test21
-rw-r--r--mysql-test/t/date_formats.test30
-rw-r--r--mysql-test/t/disabled.def1
-rw-r--r--mysql-test/t/func_misc.test40
-rw-r--r--mysql-test/t/information_schema.test9
-rw-r--r--mysql-test/t/information_schema_chmod.test20
-rw-r--r--mysql-test/t/innodb_mysql.test56
-rw-r--r--mysql-test/t/mysqldump.test31
-rw-r--r--mysql-test/t/ndb_condition_pushdown.test37
-rw-r--r--mysql-test/t/openssl_1.test42
-rw-r--r--mysql-test/t/rpl_user_variables.test9
12 files changed, 289 insertions, 19 deletions
diff --git a/mysql-test/t/ansi.test b/mysql-test/t/ansi.test
index 444bf982b8a..fa7f999954e 100644
--- a/mysql-test/t/ansi.test
+++ b/mysql-test/t/ansi.test
@@ -26,4 +26,16 @@ drop table t1;
SET @@SQL_MODE="";
+# Bug#14515
+
+CREATE TABLE t1 (i int auto_increment NOT NULL, PRIMARY KEY (i));
+SHOW CREATE TABLE t1;
+SET @@SQL_MODE="MYSQL323";
+SHOW CREATE TABLE t1;
+SET @@SQL_MODE="MYSQL40";
+SHOW CREATE TABLE t1;
+SET @@SQL_MODE="NO_FIELD_OPTIONS";
+SHOW CREATE TABLE t1;
+DROP TABLE t1;
+
# End of 4.1 tests
diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test
index b20fe80303d..26b103b0107 100644
--- a/mysql-test/t/auto_increment.test
+++ b/mysql-test/t/auto_increment.test
@@ -219,7 +219,26 @@ INSERT INTO t1 (b) VALUES ('bbbb');
CHECK TABLE t1;
DROP TABLE IF EXISTS t1;
-# End of 4.1 tests
+# BUG #19025:
+
+CREATE TABLE `t1` (
+ t1_name VARCHAR(255) DEFAULT NULL,
+ t1_id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
+ KEY (t1_name),
+ PRIMARY KEY (t1_id)
+) AUTO_INCREMENT = 1000;
+
+INSERT INTO t1 (t1_name) VALUES('MySQL');
+INSERT INTO t1 (t1_name) VALUES('MySQL');
+INSERT INTO t1 (t1_name) VALUES('MySQL');
+
+SELECT * from t1;
+
+SHOW CREATE TABLE `t1`;
+
+DROP TABLE `t1`;
+
+--echo End of 4.1 tests
#
# Bug #11080 & #11005 Multi-row REPLACE fails on a duplicate key error
diff --git a/mysql-test/t/date_formats.test b/mysql-test/t/date_formats.test
index 2e1af51efa7..39a530ba733 100644
--- a/mysql-test/t/date_formats.test
+++ b/mysql-test/t/date_formats.test
@@ -280,3 +280,33 @@ select str_to_date( 1, NULL );
select str_to_date( NULL, 1 );
select str_to_date( 1, IF(1=1,NULL,NULL) );
# End of 4.1 tests
+
+#
+# Bug#11326
+# TIME_FORMAT using "%r" returns wrong hour using 24:00:00 in TIME column
+#
+# This tests that 24:00:00 does not return PM, when it should be AM.
+# Some other values are being tested same time.
+#
+
+SELECT TIME_FORMAT("24:00:00", '%r');
+SELECT TIME_FORMAT("00:00:00", '%r');
+SELECT TIME_FORMAT("12:00:00", '%r');
+SELECT TIME_FORMAT("15:00:00", '%r');
+SELECT TIME_FORMAT("01:00:00", '%r');
+SELECT TIME_FORMAT("25:00:00", '%r');
+
+#
+# Bug#11324
+# TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column
+#
+# This tests that 24:00:00 does not change to "36:00 AM". Testing
+# some other values same time.
+#
+
+SELECT TIME_FORMAT("00:00:00", '%l %p');
+SELECT TIME_FORMAT("01:00:00", '%l %p');
+SELECT TIME_FORMAT("12:00:00", '%l %p');
+SELECT TIME_FORMAT("23:00:00", '%l %p');
+SELECT TIME_FORMAT("24:00:00", '%l %p');
+SELECT TIME_FORMAT("25:00:00", '%l %p');
diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def
index 288d060b2b5..43ce4157cdb 100644
--- a/mysql-test/t/disabled.def
+++ b/mysql-test/t/disabled.def
@@ -35,7 +35,6 @@ rpl_row_blob_innodb : BUG#18980 2006-04-10 kent Test fails randomly
rpl_row_func003 : BUG#19074 2006-13-04 andrei test failed
rpl_row_inexist_tbl : BUG#18948 2006-03-09 mats Disabled since patch makes this test wait forever
rpl_sp : BUG#16456 2006-02-16 jmiller
-udf : BUG#18564 2006-03-27 ian (Permission by Brian)
# the below testcase have been reworked to avoid the bug, test contains comment, keep bug open
#ndb_binlog_ddl_multi : BUG#18976 2006-04-10 kent CRBR: multiple binlog, second binlog may miss schema log events
diff --git a/mysql-test/t/func_misc.test b/mysql-test/t/func_misc.test
index 4a618a56483..0475dd4bdb6 100644
--- a/mysql-test/t/func_misc.test
+++ b/mysql-test/t/func_misc.test
@@ -38,6 +38,46 @@ select a from t1 where mid(a+0,6,3) = ( mid(20040106123400,6,3) );
drop table t1;
+
+#
+# Bug#16501: IS_USED_LOCK does not appear to work
+#
+--disable_warnings
+DROP TABLE IF EXISTS t1;
+--enable_warnings
+
+CREATE TABLE t1 (conn CHAR(7), connection_id INT);
+INSERT INTO t1 VALUES ('default', CONNECTION_ID());
+
+SELECT GET_LOCK('bug16501',600);
+
+connect (con1,localhost,root,,);
+INSERT INTO t1 VALUES ('con1', CONNECTION_ID());
+SELECT IS_USED_LOCK('bug16501') = connection_id
+FROM t1
+WHERE conn = 'default';
+send SELECT GET_LOCK('bug16501',600);
+
+connection default;
+SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
+SELECT RELEASE_LOCK('bug16501');
+connection con1;
+reap;
+connection default;
+SELECT IS_USED_LOCK('bug16501') = connection_id
+FROM t1
+WHERE conn = 'con1';
+
+connection con1;
+SELECT IS_USED_LOCK('bug16501') = CONNECTION_ID();
+SELECT RELEASE_LOCK('bug16501');
+SELECT IS_USED_LOCK('bug16501');
+
+disconnect con1;
+connection default;
+
+DROP TABLE t1;
+
# End of 4.1 tests
#
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index b7151b03ae1..edb376bc73b 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -797,15 +797,6 @@ DROP VIEW v1;
DROP FUNCTION func1;
DROP FUNCTION func2;
-#
-# Bug #15851 Unlistable directories yield no info from information_schema
-#
-create database mysqltest;
-create table mysqltest.t1(a int);
---exec chmod -r $MYSQLTEST_VARDIR/master-data/mysqltest
-select table_schema from information_schema.tables where table_schema='mysqltest';
---exec chmod +r $MYSQLTEST_VARDIR/master-data/mysqltest
-drop database mysqltest;
#
# Bug#15307 GROUP_CONCAT() with ORDER BY returns empty set on information_schema
diff --git a/mysql-test/t/information_schema_chmod.test b/mysql-test/t/information_schema_chmod.test
new file mode 100644
index 00000000000..fb850b8e38d
--- /dev/null
+++ b/mysql-test/t/information_schema_chmod.test
@@ -0,0 +1,20 @@
+#
+# Due to "Bug#18474 Unlistable directories yield no info from
+# information_schema, part2" this test can't be run on Window with our
+# current test framework. When "chmod -r" is done within cygwin the
+# MySQL Server can still read the directory.
+# Manual testing shows the functionalty to skip unlistable directories
+# works on windows
+#
+--source include/not_windows.inc
+
+
+#
+# Bug #15851 Unlistable directories yield no info from information_schema
+#
+create database mysqltest;
+create table mysqltest.t1(a int);
+--exec chmod -r $MYSQLTEST_VARDIR/master-data/mysqltest
+select table_schema from information_schema.tables where table_schema='mysqltest';
+--exec chmod +r $MYSQLTEST_VARDIR/master-data/mysqltest
+drop database mysqltest;
diff --git a/mysql-test/t/innodb_mysql.test b/mysql-test/t/innodb_mysql.test
index b942b9fbc0d..f31e4d64789 100644
--- a/mysql-test/t/innodb_mysql.test
+++ b/mysql-test/t/innodb_mysql.test
@@ -1,5 +1,59 @@
-- source include/have_innodb.inc
--disable_warnings
-drop table if exists t1;
+drop table if exists t1,t2;
--enable_warnings
+
+# BUG#16798: Uninitialized row buffer reads in ref-or-null optimizer
+# (repeatable only w/innodb).
+create table t1 (
+ c_id int(11) not null default '0',
+ org_id int(11) default null,
+ unique key contacts$c_id (c_id),
+ key contacts$org_id (org_id)
+) engine=innodb;
+insert into t1 values
+ (2,null),(120,null),(141,null),(218,7), (128,1),
+ (151,2),(234,2),(236,2),(243,2),(255,2),(259,2),(232,3),(235,3),(238,3),
+ (246,3),(253,3),(269,3),(285,3),(291,3),(293,3),(131,4),(230,4),(231,4);
+
+create table t2 (
+ slai_id int(11) not null default '0',
+ owner_tbl int(11) default null,
+ owner_id int(11) default null,
+ sla_id int(11) default null,
+ inc_web int(11) default null,
+ inc_email int(11) default null,
+ inc_chat int(11) default null,
+ inc_csr int(11) default null,
+ inc_total int(11) default null,
+ time_billed int(11) default null,
+ activedate timestamp null default null,
+ expiredate timestamp null default null,
+ state int(11) default null,
+ sla_set int(11) default null,
+ unique key t2$slai_id (slai_id),
+ key t2$owner_id (owner_id),
+ key t2$sla_id (sla_id)
+) engine=innodb;
+insert into t2(slai_id, owner_tbl, owner_id, sla_id) values
+ (1,3,1,1), (3,3,10,2), (4,3,3,6), (5,3,2,5), (6,3,8,3), (7,3,9,7),
+ (8,3,6,8), (9,3,4,9), (10,3,5,10), (11,3,11,11), (12,3,7,12);
+
+flush tables;
+select si.slai_id
+from t1 c join t2 si on
+ ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+ ( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
+ c.c_id = 218 and expiredate is null;
+
+select * from t1 where org_id is null;
+select si.slai_id
+from t1 c join t2 si on
+ ((si.owner_tbl = 3 and si.owner_id = c.org_id) or
+ ( si.owner_tbl = 2 and si.owner_id = c.c_id))
+where
+ c.c_id = 218 and expiredate is null;
+
+drop table t1, t2;
diff --git a/mysql-test/t/mysqldump.test b/mysql-test/t/mysqldump.test
index c5c3f88d8c8..8a276aa56fe 100644
--- a/mysql-test/t/mysqldump.test
+++ b/mysql-test/t/mysqldump.test
@@ -721,7 +721,36 @@ insert into t1 values ('','');
--exec $MYSQL_DUMP --skip-comments --hex-blob test t1
drop table t1;
-# End of 4.1 tests
+#
+# BUG #19025 mysqldump doesn't correctly dump "auto_increment = [int]"
+#
+create table `t1` (
+ t1_name varchar(255) default null,
+ t1_id int(10) unsigned not null auto_increment,
+ key (t1_name),
+ primary key (t1_id)
+) auto_increment = 1000 default charset=latin1;
+
+insert into t1 (t1_name) values('bla');
+insert into t1 (t1_name) values('bla');
+insert into t1 (t1_name) values('bla');
+
+select * from t1;
+
+show create table `t1`;
+
+--exec $MYSQL_DUMP --skip-comments test t1 > $MYSQLTEST_VARDIR/tmp/bug19025.sql
+DROP TABLE `t1`;
+
+--exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/bug19025.sql
+
+select * from t1;
+
+show create table `t1`;
+
+drop table `t1`;
+
+--echo End of 4.1 tests
#
# dump of view
diff --git a/mysql-test/t/ndb_condition_pushdown.test b/mysql-test/t/ndb_condition_pushdown.test
index 44740c1a486..3b53f7b3431 100644
--- a/mysql-test/t/ndb_condition_pushdown.test
+++ b/mysql-test/t/ndb_condition_pushdown.test
@@ -1649,5 +1649,42 @@ set engine_condition_pushdown = on;
explain select * from t5 where b like '%jo%';
select * from t5 where b like '%jo%' order by a;
+# bug#17421 -1
+drop table t1;
+create table t1 (a int, b varchar(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+# in TUP the constants 'ab' 'abc' were expected in varchar format
+# "like" returned error which became "false"
+# scan filter negates "or" which exposes the bug
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+
+# bug#17421 -2
+drop table t1;
+create table t1 (a int, b char(3), primary key using hash(a))
+engine=ndb;
+insert into t1 values (1,'a'), (2,'ab'), (3,'abc');
+# test that incorrect MySQL behaviour is preserved
+# 'ab ' LIKE 'ab' is true in MySQL
+set engine_condition_pushdown = off;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+set engine_condition_pushdown = on;
+select * from t1 where b like 'ab';
+select * from t1 where b like 'ab' or b like 'ab';
+select * from t1 where b like 'abc';
+select * from t1 where b like 'abc' or b like 'abc';
+
set engine_condition_pushdown = @old_ecpd;
DROP TABLE t1,t2,t3,t4,t5;
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index 4cc9113048f..afee381f5b7 100644
--- a/mysql-test/t/openssl_1.test
+++ b/mysql-test/t/openssl_1.test
@@ -10,8 +10,8 @@ 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 "DHE-RSA-AES256-SHA";
-grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com";
-grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/Email=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/Email=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user3@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com";
+grant select on test.* to ssl_user4@localhost require cipher "DHE-RSA-AES256-SHA" AND SUBJECT "/C=SE/L=Uppsala/O=MySQL AB/CN=MySQL Client/emailAddress=abstract.mysql.developer@mysql.com" ISSUER "/C=SE/L=Uppsala/O=MySQL AB/CN=Abstract MySQL Developer/emailAddress=abstract.mysql.developer@mysql.com";
flush privileges;
connect (con1,localhost,ssl_user1,,,,,SSL);
@@ -54,3 +54,41 @@ ssl_user3@localhost, ssl_user4@localhost;
drop table t1;
# End of 4.1 tests
+
+#
+# Test that we can't open connection to server if we are using
+# a different cacert
+#
+--exec echo "this query should not execute;" > $MYSQLTEST_VARDIR/tmp/test.sql
+--error 1
+--exec $MYSQL_TEST --ssl-ca=$MYSQL_TEST_DIR/std_data/untrusted-cacert.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+#
+# Test that we can't open connection to server if we are using
+# a blank ca
+#
+--error 1
+--exec $MYSQL_TEST --ssl-ca= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+#
+# Test that we can't open connection to server if we are using
+# a nonexistent ca file
+#
+--error 1
+--exec $MYSQL_TEST --ssl-ca=nonexisting_file.pem --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+#
+# Test that we can't open connection to server if we are using
+# a blank client-key
+#
+--error 1
+--exec $MYSQL_TEST --ssl-key= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+#
+# Test that we can't open connection to server if we are using
+# a blank client-cert
+#
+--error 1
+--exec $MYSQL_TEST --ssl-cert= --max-connect-retries=1 < $MYSQLTEST_VARDIR/tmp/test.sql 2>&1
+
+
diff --git a/mysql-test/t/rpl_user_variables.test b/mysql-test/t/rpl_user_variables.test
index cb2a1e1d853..b079c8993b6 100644
--- a/mysql-test/t/rpl_user_variables.test
+++ b/mysql-test/t/rpl_user_variables.test
@@ -1,8 +1,4 @@
###################################
-# Change Author: JBM
-# Change Date: 2006-01-17
-# Change: Added order by
-###################################
#
# Test of replicating user variables
#
@@ -54,7 +50,12 @@ insert into t1 values (@a),(@a),(@a*5);
SELECT * FROM t1 ORDER BY n;
sync_slave_with_master;
SELECT * FROM t1 ORDER BY n;
+#
+# BUG19136: Crashing log-bin and uninitialized user variables in a derived table
+# just to check nothing bad happens anymore
+#
connection master;
+insert into t1 select * FROM (select @var1 union select @var2) AS t2;
drop table t1;
sync_slave_with_master;
stop slave;