matt,
Sunday, May 19, 2002, 6:14:17 PM, you wrote:

m>Description:

m> mysql> describe DLSummary;
m> +------------+------------------+------+-----+---------+-------+
m> | Field      | Type             | Null | Key | Default | Extra |
m> +------------+------------------+------+-----+---------+-------+
m> | DownloadID | int(10) unsigned | YES  | MUL | NULL    |       |
m> | Year       | int(10) unsigned | YES  | MUL | NULL    |       |
m> | YDay       | int(10) unsigned | YES  |     | NULL    |       |
m> | Count      | int(10) unsigned | YES  |     | NULL    |       |
m> +------------+------------------+------+-----+---------+-------+
m> 4 rows in set (0.00 sec)

m> mysql> show keys from DLSummary;
m> 
+-----------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
m> | Table     | Non_unique | Key_name   | Seq_in_index | Column_name | Collation | 
Cardinality | Sub_part | Packed | Null | Index_type
m> | Comment |
m> 
+-----------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
m> | DLSummary |          1 | Date       |            1 | Year        | A         |    
       1 |     NULL | NULL   | YES  | BTREE
m> |         |
m> | DLSummary |          1 | Date       |            2 | YDay        | A         |    
     377 |     NULL | NULL   | YES  | BTREE
m> |         |
m> | DLSummary |          1 | DownloadID |            1 | DownloadID  | A         |    
   15378 |     NULL | NULL   | YES  | BTREE
m> |         |
m> 
+-----------+------------+------------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
m> 3 rows in set (0.01 sec)

m> **** BUG ****
m> mysql> select Year,YDay,sum(Count) from DLSummary group by Year,YDay;
m> ERROR 1062: Duplicate entry '2001-125' for key 1
m> **** BUG ****

m> mysql> select Year,YDay,sum(Count) from DLSummary group by concat(Year,YDay);
m> +------+------+------------+
m> | Year | YDay | sum(Count) |
m> +------+------+------------+
m> | 2001 |  124 |       2140 |
m> | 2001 |  125 |      10302 |
m> .....

m> This seems rather odd. GROUP BY Year,YDay is documented to be topologically 
m> equivalent to GROUP BY CONCAT(Year,YDay) (well, more or less) but has
m> functional difference.

m> Bug tested in 4.0.2 @ BK 1.1272 (May 17th) and also on 4.0.2 as of around 
m> March 2nd, so it's nothing recent.

It was fixed. Here is a patch for 4.0.2 from Sinisa Milivojevic.


*** tmp/sql_select.cc   Wed May 22 19:55:01 2002
--- sql/sql_select.cc   Wed May 22 15:11:33 2002
***************
*** 3824,3829 ****
--- 3824,3830 ----
          key_part_info->null_offset= (uint) (field->null_ptr -
                                              (uchar*) table->record[0]);
          group->field->move_field((char*) ++group->buff);
+         ++group_buff;
        }
        else
          group->field->move_field((char*) group_buff);
>




-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to