List:Internals« Previous MessageNext Message »
From:igor Date:June 20 2005 7:49pm
Subject:bk commit into 4.1 tree (igor:1.2302) BUG#11385
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of igor. When igor 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.2302 05/06/20 10:49:04 igor@stripped +3 -0
  group_by.result:
    Added  a test case for bug #11385.
  group_by.test:
    Added  a test case for bug #11385.
  field.h:
    Fixed bug #11385.
    The bug was due to not defined method decimals for the class
    Field_datetime.

  mysql-test/r/group_by.result
    1.48 05/06/20 10:47:24 igor@stripped +9 -0
    Added  a test case for bug #11385.

  mysql-test/t/group_by.test
    1.38 05/06/20 10:46:33 igor@stripped +14 -1
    Added  atest case for bug #11385.

  sql/field.h
    1.129 05/06/20 10:44:01 igor@stripped +2 -0
    Fixed bug #11385.
    The bug was due to not defined method decimals for the class
    Field_datetime.

# 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:	igor
# Host:	rurik.mysql.com
# Root:	/home/igor/dev/mysql-4.1-1

--- 1.128/sql/field.h	Wed May  4 06:05:53 2005
+++ 1.129/sql/field.h	Mon Jun 20 10:44:01 2005
@@ -25,6 +25,7 @@
 #endif
 
 #define NOT_FIXED_DEC			31
+#define DATETIME_DEC                     6
 
 class Send_field;
 class Protocol;
@@ -861,6 +862,7 @@
   enum ha_base_keytype key_type() const { return HA_KEYTYPE_ULONGLONG; }
 #endif
   enum Item_result cmp_type () const { return INT_RESULT; }
+  uint decimals() const { return DATETIME_DEC; }
   int  store(const char *to,uint length,CHARSET_INFO *charset);
   int  store(double nr);
   int  store(longlong nr);

--- 1.47/mysql-test/r/group_by.result	Thu Jun 16 09:45:10 2005
+++ 1.48/mysql-test/r/group_by.result	Mon Jun 20 10:47:24 2005
@@ -732,3 +732,12 @@
 a	b
 1	2
 DROP TABLE t1;
+CREATE TABLE t1 (id INT, dt DATETIME);
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
+f	id
+20050501123000	1
+DROP TABLE t1;

--- 1.37/mysql-test/t/group_by.test	Thu Jun 16 09:44:42 2005
+++ 1.38/mysql-test/t/group_by.test	Mon Jun 20 10:46:33 2005
@@ -543,12 +543,25 @@
 DROP TABLE t1;
 
 #
-# Test for bug #8614: GROUP BY 'const with DISTINCT  
+# Test for bug #8614: GROUP BY 'const' with DISTINCT  
 #
 
 CREATE TABLE t1 (a  int, b int);
 INSERT INTO t1 VALUES (1,2), (1,3);
 SELECT a, b FROM t1 GROUP BY 'const';
 SELECT DISTINCT a, b FROM t1 GROUP BY 'const';
+
+DROP TABLE t1;
+
+#
+# Test for bug #11385: GROUP BY for datetime converted to decimals  
+#
+
+CREATE TABLE t1 (id INT, dt DATETIME);
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+INSERT INTO t1 VALUES ( 1, '2005-05-01 12:30:00' );
+SELECT dt DIV 1 AS f, id FROM t1 GROUP BY f;
 
 DROP TABLE t1;
Thread
bk commit into 4.1 tree (igor:1.2302) BUG#11385igor20 Jun