List:Commits« Previous MessageNext Message »
From:Mattias Jonsson Date:November 24 2008 10:55pm
Subject:bzr commit into mysql-6.0-backup branch (mattias.jonsson:2747)
View as plain text  
#At file:///Users/mattiasj/clones/bzrroot/topush-60-bugteam/

 2747 Mattias Jonsson	2008-11-24 [merge]
      merge
modified:
  mysql-test/r/partition.result
  mysql-test/t/partition.test
  sql/ha_partition.cc

=== modified file 'mysql-test/r/partition.result'
--- a/mysql-test/r/partition.result	2008-11-06 16:18:25 +0000
+++ b/mysql-test/r/partition.result	2008-11-24 22:54:28 +0000
@@ -1,4 +1,16 @@
 drop table if exists t1, t2;
+CREATE TABLE t1 (
+pk INT NOT NULL AUTO_INCREMENT,
+PRIMARY KEY (pk)
+)
+/*!50100 PARTITION BY HASH (pk)
+PARTITIONS 2 */;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
+pk
+DROP TABLE t1;
 CREATE TABLE t1 (a INT)
 ENGINE=NonExistentEngine;
 Warnings:

=== modified file 'mysql-test/t/partition.test'
--- a/mysql-test/t/partition.test	2008-11-06 16:18:25 +0000
+++ b/mysql-test/t/partition.test	2008-11-24 22:54:28 +0000
@@ -15,6 +15,21 @@ drop table if exists t1, t2;
 --enable_warnings
 
 #
+# Bug#40954: Crash if range search and order by.
+#
+CREATE TABLE t1 (
+  pk INT NOT NULL AUTO_INCREMENT,
+  PRIMARY KEY (pk)
+)
+/*!50100 PARTITION BY HASH (pk)
+PARTITIONS 2 */;
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+INSERT INTO t1 VALUES (NULL);
+SELECT * FROM t1 WHERE pk < 0 ORDER BY pk;
+DROP TABLE t1;
+
+#
 # Bug#35765: ALTER TABLE produces wrong error when non-existent storage engine
 # used
 CREATE TABLE t1 (a INT)

=== modified file 'sql/ha_partition.cc'
--- a/sql/ha_partition.cc	2008-11-15 00:34:27 +0000
+++ b/sql/ha_partition.cc	2008-11-24 22:54:28 +0000
@@ -4505,7 +4505,8 @@ int ha_partition::handle_ordered_index_s
         This can only read record to table->record[0], as it was set when
         the table was being opened. We have to memcpy data ourselves.
       */
-      error= file->read_range_first(&m_start_key, end_range, eq_range, TRUE);
+      error= file->read_range_first(m_start_key.key? &m_start_key: NULL,
+                                    end_range, eq_range, TRUE);
       memcpy(rec_buf_ptr, table->record[0], m_rec_length);
       reverse_order= FALSE;
       break;

Thread
bzr commit into mysql-6.0-backup branch (mattias.jonsson:2747)Mattias Jonsson24 Nov