Commit 3c1e153a authored by Guilhem Bichot's avatar Guilhem Bichot

Manually applying the patch for BUG40954 "Crash in MyISAM index code with...

Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
so that it stops crashing pushbuild2/5.1-maria and we can see the other failures which it hid.

mysql-test/r/partition.result:
  Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
mysql-test/t/partition.test:
  Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
sql/ha_partition.cc:
  Manually applying the patch for BUG40954 "Crash in MyISAM index code with concurrency test using partitioned tables"
parent d55161b7
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 NOT NULL, KEY(a))
PARTITION BY RANGE(a)
(PARTITION p1 VALUES LESS THAN (200), PARTITION pmax VALUES LESS THAN MAXVALUE);
......
......@@ -14,6 +14,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#40494: Crash MYSQL server crashes on range access with partitioning
# and order by
......
......@@ -4457,7 +4457,8 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment