summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-01-23 13:22:05 +0100
committerLuis Soares <luis.soares@sun.com>2009-01-23 13:22:05 +0100
commitdf8543868db346fcddad5dad356fb70bdaa679d7 (patch)
tree62fe82ffb4b2f249d2e0c6686acb8c060ed5f0bd /mysql-test/t/select.test
parentbb42e1ab05f9ebe166524d7d8a25c55a69e65dfa (diff)
parentaec81abb3b127e9a6c68bfe9562fd3d7cd385e0b (diff)
downloadmariadb-git-df8543868db346fcddad5dad356fb70bdaa679d7.tar.gz
merge: 5.1 -> 5.1-rpl
conflicts: Text conflict in client/mysqltest.cc Text conflict in mysql-test/include/wait_until_connected_again.inc Text conflict in mysql-test/lib/mtr_report.pm Text conflict in mysql-test/mysql-test-run.pl Text conflict in mysql-test/r/events_bugs.result Text conflict in mysql-test/r/log_state.result Text conflict in mysql-test/r/myisam_data_pointer_size_func.result Text conflict in mysql-test/r/mysqlcheck.result Text conflict in mysql-test/r/query_cache.result Text conflict in mysql-test/r/status.result Text conflict in mysql-test/suite/binlog/r/binlog_index.result Text conflict in mysql-test/suite/binlog/r/binlog_innodb.result Text conflict in mysql-test/suite/rpl/r/rpl_packet.result Text conflict in mysql-test/suite/rpl/t/rpl_packet.test Text conflict in mysql-test/t/disabled.def Text conflict in mysql-test/t/events_bugs.test Text conflict in mysql-test/t/log_state.test Text conflict in mysql-test/t/myisam_data_pointer_size_func.test Text conflict in mysql-test/t/mysqlcheck.test Text conflict in mysql-test/t/query_cache.test Text conflict in mysql-test/t/rpl_init_slave_func.test Text conflict in mysql-test/t/status.test
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test69
1 files changed, 69 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 30abb797e83..ccdb53ec11f 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -3690,6 +3690,42 @@ SELECT DISTINCT b FROM t1 LEFT JOIN t2 USING(a) WHERE c <= 3;
SHOW STATUS LIKE 'Handler_read%';
DROP TABLE t1, t2;
+#
+# Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
+#
+CREATE TABLE t1 (f1 bigint(20) NOT NULL default '0',
+ f2 int(11) NOT NULL default '0',
+ f3 bigint(20) NOT NULL default '0',
+ f4 varchar(255) NOT NULL default '',
+ PRIMARY KEY (f1),
+ KEY key1 (f4),
+ KEY key2 (f2));
+CREATE TABLE t2 (f1 int(11) NOT NULL default '0',
+ f2 enum('A1','A2','A3') NOT NULL default 'A1',
+ f3 int(11) NOT NULL default '0',
+ PRIMARY KEY (f1),
+ KEY key1 (f3));
+CREATE TABLE t3 (f1 bigint(20) NOT NULL default '0',
+ f2 datetime NOT NULL default '1980-01-01 00:00:00',
+ PRIMARY KEY (f1));
+
+insert into t1 values (1, 1, 1, 'abc');
+insert into t1 values (2, 1, 2, 'def');
+insert into t1 values (3, 1, 2, 'def');
+insert into t2 values (1, 'A1', 1);
+insert into t3 values (1, '1980-01-01');
+
+SELECT a.f3, cr.f4, count(*) count
+FROM t2 a
+STRAIGHT_JOIN t1 cr ON cr.f2 = a.f1
+LEFT JOIN
+(t1 cr2
+ JOIN t3 ae2 ON cr2.f3 = ae2.f1
+) ON a.f1 = cr2.f2 AND ae2.f2 < now() - INTERVAL 7 DAY AND
+cr.f4 = cr2.f4
+GROUP BY a.f3, cr.f4;
+
+drop table t1, t2, t3;
--echo End of 5.0 tests
#
@@ -3701,3 +3737,36 @@ SELECT a FROM t1 ORDER BY a LIMIT 2;
SELECT a FROM t1 ORDER BY a LIMIT 2,4294967296;
SELECT a FROM t1 ORDER BY a LIMIT 2,4294967297;
DROP TABLE t1;
+
+#
+# Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store ,
+# Field_varstring::store
+#
+
+CREATE TABLE A (date_key date);
+
+CREATE TABLE C (
+ pk int,
+ int_nokey int,
+ int_key int,
+ date_key date NOT NULL,
+ date_nokey date,
+ varchar_key varchar(1)
+);
+
+INSERT INTO C VALUES
+(1,1,1,'0000-00-00',NULL,NULL),
+(1,1,1,'0000-00-00',NULL,NULL);
+
+SELECT 1 FROM C WHERE pk > ANY (SELECT 1 FROM C);
+
+SELECT COUNT(DISTINCT 1) FROM C
+ WHERE date_key = (SELECT 1 FROM A WHERE C.date_key IS NULL) GROUP BY pk;
+SELECT date_nokey FROM C
+ WHERE int_key IN (SELECT 1 FROM A)
+ HAVING date_nokey = '10:41:7'
+ ORDER BY date_key;
+
+DROP TABLE A,C;
+
+--echo End of 5.1 tests