From b9ecbb7e5c764158b81597b4197a926732c31004 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Oct 2007 21:26:06 +0500 Subject: Fixed bug #31036: Using order by with archive table crashes server. 1. Memory overrun have been fixed. 2. Server failure on assertion has been fixed. storage/archive/azio.c: Fixed bug #31036. The ha_archive::rnd_pos function has been modified to take into account the result of the azseek function and to return HA_ERR_CRASHED_ON_USAGE in case of seek error. storage/archive/ha_archive.cc: Fixed bug #31036. 1. Memory overrun has been fixed: maximal sizes of azio_stream::inbuf and azio_stream::outbuf was mixed. 2. Zero value of the output parameter of the azread function was incorrectly interpreted by the azseek function: after the first successful read attempt the execution of the azseek loop was interrupted and negative value was returned. (See ha_archive::rnd_pos: that negative value was silently ignored, and an incomplete data was used, for example, as a size of a packed record, and server failed with the assertion: "row_len <= record_buffer->length".) mysql-test/t/archive.test: Added test case for bug #31036. mysql-test/r/archive.result: Added test case for bug #31036. --- mysql-test/r/archive.result | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'mysql-test/r/archive.result') diff --git a/mysql-test/r/archive.result b/mysql-test/r/archive.result index 36b013703d8..803c102f6cf 100644 --- a/mysql-test/r/archive.result +++ b/mysql-test/r/archive.result @@ -12682,3 +12682,7 @@ check table t1 extended; Table Op Msg_type Msg_text test.t1 check status OK drop table t1; +CREATE TABLE t1(a VARCHAR(510)) ENGINE = ARCHIVE; +INSERT INTO t1(a) VALUES (''); +SELECT * FROM t1 ORDER BY a; +DROP TABLE t1; -- cgit v1.2.1