List:Commits« Previous MessageNext Message »
From:kgeorge Date:October 18 2007 1:40pm
Subject:bk commit into 5.0 tree (gkodinov:1.2546) BUG#30715
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@stripped, 2007-10-18 14:40:17+03:00, gkodinov@stripped +3 -0
  Bug #30715: Assertion failed: item_field->field->real_maybe_null(), 
    file .\opt_sum.cc, line
  The MIN(field) can return NULL when all the row values in the group
  are NULL-able or if there were no rows.
  Fixed the assertion to reflect the case when there are no rows.

  mysql-test/r/func_group.result@stripped, 2007-10-18 14:40:15+03:00, gkodinov@stripped +4
-0
    Bug #30715: test case

  mysql-test/t/func_group.test@stripped, 2007-10-18 14:40:15+03:00, gkodinov@stripped +8 -0
    Bug #30715: test case

  sql/opt_sum.cc@stripped, 2007-10-18 14:40:15+03:00, gkodinov@stripped +2 -1
    Bug #30715: the field can be NULL if no rows
     were found when searching for the next group.

diff -Nrup a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
--- a/mysql-test/r/func_group.result	2007-10-08 12:57:41 +03:00
+++ b/mysql-test/r/func_group.result	2007-10-18 14:40:15 +03:00
@@ -1387,4 +1387,8 @@ SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(
 1
 1
 DROP TABLE t1;
+CREATE TABLE t1 (a int, b date NOT NULL, KEY k1 (a,b));
+SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01';
+MIN(b)
+NULL
 End of 5.0 tests
diff -Nrup a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
--- a/mysql-test/t/func_group.test	2007-10-08 12:57:41 +03:00
+++ b/mysql-test/t/func_group.test	2007-10-18 14:40:15 +03:00
@@ -873,5 +873,13 @@ SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(
 
 DROP TABLE t1;
 
+#
+# Bug #30715: Assertion failed: item_field->field->real_maybe_null(), file
+# .\opt_sum.cc, line
+#
+
+CREATE TABLE t1 (a int, b date NOT NULL, KEY k1 (a,b));
+SELECT MIN(b) FROM t1 WHERE a=1 AND b>'2007-08-01';
+
 ###
 --echo End of 5.0 tests
diff -Nrup a/sql/opt_sum.cc b/sql/opt_sum.cc
--- a/sql/opt_sum.cc	2007-05-15 15:29:10 +03:00
+++ b/sql/opt_sum.cc	2007-10-18 14:40:15 +03:00
@@ -260,7 +260,8 @@ int opt_sum_query(TABLE_LIST *tables, Li
                   (error == HA_ERR_KEY_NOT_FOUND ||
                    key_cmp_if_same(table, ref.key_buff, ref.key, prefix_len)))
               {
-                DBUG_ASSERT(item_field->field->real_maybe_null());
+                DBUG_ASSERT(error == HA_ERR_KEY_NOT_FOUND ||
+                            item_field->field->real_maybe_null());
                 error= table->file->index_read(table->record[0], ref.key_buff,
                                                ref.key_length, 
                                                HA_READ_KEY_EXACT);
Thread
bk commit into 5.0 tree (gkodinov:1.2546) BUG#30715kgeorge18 Oct