MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:kgeorge Date:March 27 2006 8:42am
Subject:bk commit into 5.0 tree (gkodinov:1.2115) BUG#10102
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet
  1.2115 06/03/27 11:42:20 gkodinov@stripped +2 -0
  Test case for BUG#10102 : select distinct returns empty result, select count distinct > 0 (correct)
    Reproduced in 5.0.16-nt. Tested to work in 5.0.20
    

  mysql-test/t/group_min_max.test
    1.19 06/03/27 11:28:38 gkodinov@stripped +38 -0
    Test Case for BUG#15102 : select distinct returns empty result, select count distinct > 0 (correct)
      Reproduced in 5.0.16-nt. Tested to be fixed in 5.0.20

  mysql-test/r/group_min_max.result
    1.21 06/03/27 11:28:38 gkodinov@stripped +37 -0
    Test case for BUG#10102 : select distinct returns empty result, select count distinct > 0 (correct)
      Reproduced in 5.0.16-nt. Tested to be fixed in 5.0.20

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gkodinov
# Host:	rakia.progem.bg
# Root:	/home/kgeorge/mysql/5.0/B15102

--- 1.20/mysql-test/r/group_min_max.result	2006-02-06 21:35:05 +02:00
+++ 1.21/mysql-test/r/group_min_max.result	2006-03-27 11:28:38 +03:00
@@ -2070,3 +2070,40 @@
 a
 BB
 DROP TABLE t1;
+CREATE TABLE t1 (
+a int(11) NOT NULL DEFAULT '0',
+b varchar(16) COLLATE latin1_general_ci NOT NULL DEFAULT '',
+PRIMARY KEY  (a,b)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+CREATE PROCEDURE a(x INT)
+BEGIN
+DECLARE rnd INT;
+DECLARE cnt INT;
+WHILE x > 0 DO
+SET rnd= x % 100;
+SET cnt = (SELECT COUNT(*) FROM t1 WHERE a = rnd);
+INSERT INTO t1(a,b) VALUES (rnd, CAST(cnt AS CHAR));
+SET x= x - 1;
+END WHILE;
+END|
+CALL a(1000);
+SELECT a FROM t1 WHERE a=0;
+a
+0
+0
+0
+0
+0
+0
+0
+0
+0
+0
+SELECT DISTINCT a FROM t1 WHERE a=0;
+a
+0
+SELECT COUNT(DISTINCT a) FROM t1 WHERE a=0;
+COUNT(DISTINCT a)
+1
+DROP TABLE t1;
+DROP PROCEDURE a;

--- 1.18/mysql-test/t/group_min_max.test	2006-02-06 21:35:06 +02:00
+++ 1.19/mysql-test/t/group_min_max.test	2006-03-27 11:28:38 +03:00
@@ -736,3 +736,41 @@
 SELECT a FROM t1 WHERE a LIKE 'B%' GROUP BY a;
 
 DROP TABLE t1;
+
+
+#
+# Bug #15102: select distinct returns empty result, select count 
+#             distinct > 0 (correct)
+#
+
+CREATE TABLE t1 (
+   a int(11) NOT NULL DEFAULT '0',
+   b varchar(16) COLLATE latin1_general_ci NOT NULL DEFAULT '',
+   PRIMARY KEY  (a,b)
+ ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;
+
+delimiter |;
+
+CREATE PROCEDURE a(x INT)
+BEGIN
+  DECLARE rnd INT;
+  DECLARE cnt INT;
+
+  WHILE x > 0 DO
+    SET rnd= x % 100;
+    SET cnt = (SELECT COUNT(*) FROM t1 WHERE a = rnd);
+    INSERT INTO t1(a,b) VALUES (rnd, CAST(cnt AS CHAR));
+    SET x= x - 1;
+  END WHILE;
+END|
+
+DELIMITER ;|
+
+CALL a(1000);
+
+SELECT a FROM t1 WHERE a=0;
+SELECT DISTINCT a FROM t1 WHERE a=0;
+SELECT COUNT(DISTINCT a) FROM t1 WHERE a=0;
+
+DROP TABLE t1;
+DROP PROCEDURE a;
Thread
bk commit into 5.0 tree (gkodinov:1.2115) BUG#10102kgeorge27 Mar