List:Commits« Previous MessageNext Message »
From:igor Date:April 7 2006 12:29am
Subject:bk commit into 5.0 tree (igor:1.2141) BUG#15917
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 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.2141 06/04/06 15:29:15 igor@stripped +3 -0
  Fixed bug #15917: unexpected complain for a NIST test case.
  The problem was due to the fact that with --lower-case-table-names set to 1 
  the function find_field_in_group did not convert the prefix 'HU' in
  HU.PROJ.CITY into lower case when looking for it in the group list. Yet the
  names in the group list were extended by the database name in lower case.

  sql/item.cc
    1.214 06/04/06 15:29:09 igor@stripped +9 -0
    Fixed bug #15917: unexpected complain for a NIST test case.
    The problem was due to the fact that with --lower-case-table-names set to 1 
    the function find_field_in_group did not convert the prefix 'HU' in
    HU.PROJ.CITY into lower case when looking for it in the group list. Yet the
    names in the group list were extended by the database name in lower case.
    The needed conversion was added to the code of find_field_in_group.
    

  mysql-test/t/having.test
    1.19 06/04/06 15:29:09 igor@stripped +44 -0
    Added a test case for bug #15917.

  mysql-test/r/having.result
    1.22 06/04/06 15:29:09 igor@stripped +35 -0
    Added a test case for bug #15917.

# 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-5.0-0

--- 1.213/sql/item.cc	2006-04-03 21:07:19 -07:00
+++ 1.214/sql/item.cc	2006-04-06 15:29:09 -07:00
@@ -3054,6 +3054,7 @@
   int         found_match_degree= 0;
   Item_ident *cur_field;
   int         cur_match_degree= 0;
+  char        name_buff[NAME_LEN+1];
 
   if (find_item->type() == Item::FIELD_ITEM ||
       find_item->type() == Item::REF_ITEM)
@@ -3064,6 +3065,14 @@
   }
   else
     return NULL;
+
+  if (db_name && lower_case_table_names)
+  {
+    /* Convert database to lower case for comparison */
+    strmake(name_buff, db_name, sizeof(name_buff)-1);
+    my_casedn_str(files_charset_info, name_buff);
+    db_name= name_buff;
+  }
 
   DBUG_ASSERT(field_name != 0);
 

--- 1.21/mysql-test/r/having.result	2006-03-31 21:26:10 -08:00
+++ 1.22/mysql-test/r/having.result	2006-04-06 15:29:09 -07:00
@@ -359,3 +359,38 @@
 s1	count(s1)
 y	1
 drop table t1;
+DROP SCHEMA IF EXISTS HU;
+Warnings:
+Note	1008	Can't drop database 'HU'; database doesn't exist
+CREATE SCHEMA HU ;
+USE HU ;
+CREATE TABLE STAFF
+(EMPNUM   CHAR(3) NOT NULL UNIQUE,
+EMPNAME  CHAR(20),
+GRADE    DECIMAL(4),
+CITY     CHAR(15));
+CREATE TABLE PROJ
+(PNUM     CHAR(3) NOT NULL UNIQUE,
+PNAME    CHAR(20),
+PTYPE    CHAR(6),
+BUDGET   DECIMAL(9),
+CITY     CHAR(15));
+INSERT INTO STAFF VALUES ('E1','Alice',12,'Deale');
+INSERT INTO STAFF VALUES ('E2','Betty',10,'Vienna');
+INSERT INTO STAFF VALUES ('E3','Carmen',13,'Vienna');
+INSERT INTO STAFF VALUES ('E4','Don',12,'Deale');
+INSERT INTO STAFF VALUES ('E5','Ed',13,'Akron');
+INSERT INTO PROJ VALUES  ('P1','MXSS','Design',10000,'Deale');
+INSERT INTO PROJ VALUES  ('P2','CALM','Code',30000,'Vienna');
+INSERT INTO PROJ VALUES  ('P3','SDP','Test',30000,'Tampa');
+INSERT INTO PROJ VALUES  ('P4','SDP','Design',20000,'Deale');
+INSERT INTO PROJ VALUES  ('P5','IRM','Test',10000,'Vienna');
+INSERT INTO PROJ VALUES  ('P6','PAYR','Design',50000,'Deale');
+SELECT EMPNUM, GRADE*1000
+FROM HU.STAFF WHERE GRADE * 1000 > 
+ANY (SELECT SUM(BUDGET) FROM HU.PROJ
+GROUP BY CITY, PTYPE
+HAVING HU.PROJ.CITY = HU.STAFF.CITY);
+EMPNUM	GRADE*1000
+E3	13000
+DROP SCHEMA HU;

--- 1.18/mysql-test/t/having.test	2006-02-02 20:39:19 -08:00
+++ 1.19/mysql-test/t/having.test	2006-04-06 15:29:09 -07:00
@@ -347,3 +347,47 @@
 # MySQL returns: 1 row, with count(s1) = 1
 
 drop table t1;
+
+
+#
+# Bug #15917: unexpected complain for a name in having clause
+# when the server is run on Windows or with --lower-case-table-names=1
+#
+
+DROP SCHEMA IF EXISTS HU;
+CREATE SCHEMA HU ;
+USE HU ;
+
+CREATE TABLE STAFF
+ (EMPNUM   CHAR(3) NOT NULL UNIQUE,
+  EMPNAME  CHAR(20),
+  GRADE    DECIMAL(4),
+  CITY     CHAR(15));
+
+CREATE TABLE PROJ
+ (PNUM     CHAR(3) NOT NULL UNIQUE,
+  PNAME    CHAR(20),
+  PTYPE    CHAR(6),
+  BUDGET   DECIMAL(9),
+  CITY     CHAR(15));
+
+INSERT INTO STAFF VALUES ('E1','Alice',12,'Deale');
+INSERT INTO STAFF VALUES ('E2','Betty',10,'Vienna');
+INSERT INTO STAFF VALUES ('E3','Carmen',13,'Vienna');
+INSERT INTO STAFF VALUES ('E4','Don',12,'Deale');
+INSERT INTO STAFF VALUES ('E5','Ed',13,'Akron');
+
+INSERT INTO PROJ VALUES  ('P1','MXSS','Design',10000,'Deale');
+INSERT INTO PROJ VALUES  ('P2','CALM','Code',30000,'Vienna');
+INSERT INTO PROJ VALUES  ('P3','SDP','Test',30000,'Tampa');
+INSERT INTO PROJ VALUES  ('P4','SDP','Design',20000,'Deale');
+INSERT INTO PROJ VALUES  ('P5','IRM','Test',10000,'Vienna');
+INSERT INTO PROJ VALUES  ('P6','PAYR','Design',50000,'Deale');
+
+SELECT EMPNUM, GRADE*1000
+  FROM HU.STAFF WHERE GRADE * 1000 > 
+                  ANY (SELECT SUM(BUDGET) FROM HU.PROJ
+                         GROUP BY CITY, PTYPE
+                           HAVING HU.PROJ.CITY = HU.STAFF.CITY);
+
+DROP SCHEMA HU;
Thread
bk commit into 5.0 tree (igor:1.2141) BUG#15917igor7 Apr