List:Commits« Previous MessageNext Message »
From:Sergey Petrunia Date:November 16 2007 4:59pm
Subject:bk commit into 6.0 tree (sergefp:1.2634) BUG#32262
View as plain text  
Below is the list of changes that have just been committed into a local
6.0 repository of psergey. When psergey 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-11-16 18:59:44+03:00, sergefp@stripped +3 -0
  Merging Gleb's fix:
  Fixed bug #32262: crash with decimal column.
  
  The server crashed on optimization of queries
  with a comparison of an indexed decimal column with
  a string value.

  mysql-test/r/range.result@stripped, 2007-11-16 18:59:33+03:00, sergefp@stripped +14 -0
    Gleb's fix: Added test case for bug #32262.

  mysql-test/t/range.test@stripped, 2007-11-16 18:59:33+03:00, sergefp@stripped +10 -0
    Gleb's fix: Added test case for bug #32262.

  sql/opt_range.cc@stripped, 2007-11-16 18:59:33+03:00, sergefp@stripped +2 -0
    Gleb's fix:
    Fixed bug #32262.
    The check_quick_select function has been changed to
    check input parameter for NULL value.

diff -Nrup a/mysql-test/r/range.result b/mysql-test/r/range.result
--- a/mysql-test/r/range.result	2007-06-28 02:31:22 +04:00
+++ b/mysql-test/r/range.result	2007-11-16 18:59:33 +03:00
@@ -1149,3 +1149,17 @@ explain select * from t2 where a=1000 an
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
 1	SIMPLE	t2	ref	a	a	5	const	502	Using index condition
 drop table t1, t2;
+End of 5.1 tests
+CREATE TABLE t1 (c1 DECIMAL(10,0),INDEX(c1));
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT c1 FROM t1 WHERE c1 >= 'A' GROUP BY 1;
+c1
+1
+2
+3
+Warnings:
+Warning	1366	Incorrect decimal value: 'A' for column 'c1' at row 1
+Warning	1292	Truncated incorrect DOUBLE value: 'A'
+Warning	1292	Truncated incorrect DOUBLE value: 'A'
+Warning	1292	Truncated incorrect DOUBLE value: 'A'
+DROP TABLE t1;
diff -Nrup a/mysql-test/t/range.test b/mysql-test/t/range.test
--- a/mysql-test/t/range.test	2007-03-31 03:12:28 +04:00
+++ b/mysql-test/t/range.test	2007-11-16 18:59:33 +03:00
@@ -963,3 +963,13 @@ explain select * from t2 where a=1000 an
 
 drop table t1, t2;
 
+--echo End of 5.1 tests
+
+#
+# BUG#32262 fix: crash with decimal column...
+#
+
+CREATE TABLE t1 (c1 DECIMAL(10,0),INDEX(c1));
+INSERT INTO t1 VALUES (1),(2),(3);
+SELECT c1 FROM t1 WHERE c1 >= 'A' GROUP BY 1;
+DROP TABLE t1;
diff -Nrup a/sql/opt_range.cc b/sql/opt_range.cc
--- a/sql/opt_range.cc	2007-10-09 11:21:18 +04:00
+++ b/sql/opt_range.cc	2007-11-16 18:59:33 +03:00
@@ -7410,6 +7410,8 @@ ha_rows check_quick_select(PARAM *param,
   DBUG_ENTER("check_quick_select");
   
   /* Handle cases when we don't have a valid non-empty list of range */
+  if (!tree)
+    DBUG_RETURN(HA_POS_ERROR);
   if (tree->type == SEL_ARG::IMPOSSIBLE)
     DBUG_RETURN(0L);
   if (tree->type != SEL_ARG::KEY_RANGE || tree->part != 0)
Thread
bk commit into 6.0 tree (sergefp:1.2634) BUG#32262Sergey Petrunia16 Nov