diff options
author | unknown <lars/lthalmann@mysql.com/dl145h.mysql.com> | 2007-10-01 11:23:44 +0200 |
---|---|---|
committer | unknown <lars/lthalmann@mysql.com/dl145h.mysql.com> | 2007-10-01 11:23:44 +0200 |
commit | ec75be400b78b70f8c68f89cc2a0741f6f1593b6 (patch) | |
tree | 3a28a9d2838b6a9c8ef0d588e85dad944eef728a | |
parent | a46fc5d8371e06bf77010503c90349d871b65950 (diff) | |
parent | 7a2bb241bd0a80303385ef251ccb422c99c33a0b (diff) | |
download | mariadb-git-ec75be400b78b70f8c68f89cc2a0741f6f1593b6.tar.gz |
Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-4.1-rpl
into mysql.com:/nfsdisk1/lars/MERGE/mysql-4.1-merge
-rwxr-xr-x | libmysqld/ha_blackhole.cc | 0 | ||||
-rw-r--r-- | mysql-test/r/delete.result | 11 | ||||
-rw-r--r-- | mysql-test/t/delete.test | 13 | ||||
-rw-r--r-- | scripts/mysql_config.sh | 2 | ||||
-rw-r--r-- | sql/opt_range.cc | 3 |
5 files changed, 27 insertions, 2 deletions
diff --git a/libmysqld/ha_blackhole.cc b/libmysqld/ha_blackhole.cc deleted file mode 100755 index e69de29bb2d..00000000000 --- a/libmysqld/ha_blackhole.cc +++ /dev/null diff --git a/mysql-test/r/delete.result b/mysql-test/r/delete.result index a5c22e66569..5dd37e6b98d 100644 --- a/mysql-test/r/delete.result +++ b/mysql-test/r/delete.result @@ -193,4 +193,15 @@ select @a; @a 1 drop table t1; +CREATE TABLE t1 ( +`date` date , +`time` time , +`seq` int(10) unsigned NOT NULL auto_increment, +PRIMARY KEY (`seq`), +KEY `seq` (`seq`), +KEY `time` (`time`), +KEY `date` (`date`) +); +DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1; +drop table t1; End of 4.1 tests diff --git a/mysql-test/t/delete.test b/mysql-test/t/delete.test index 301b2cdbb99..fdbb96e0c2f 100644 --- a/mysql-test/t/delete.test +++ b/mysql-test/t/delete.test @@ -184,4 +184,17 @@ delete from t1 where (@a:= f1) order by f1 limit 1; select @a; drop table t1; +# BUG#30385 "Server crash when deleting with order by and limit" +CREATE TABLE t1 ( + `date` date , + `time` time , + `seq` int(10) unsigned NOT NULL auto_increment, + PRIMARY KEY (`seq`), + KEY `seq` (`seq`), + KEY `time` (`time`), + KEY `date` (`date`) +); +DELETE FROM t1 ORDER BY date ASC, time ASC LIMIT 1; +drop table t1; + --echo End of 4.1 tests diff --git a/scripts/mysql_config.sh b/scripts/mysql_config.sh index 1fcad16affb..addc3a10474 100644 --- a/scripts/mysql_config.sh +++ b/scripts/mysql_config.sh @@ -122,7 +122,7 @@ done cflags=`echo "$cflags"|sed -e 's/ *\$//'` # Same for --libs(_r) -for remove in lmtmalloc static-libcxa i-static +for remove in lmtmalloc static-libcxa i-static static-intel do # We know the strings starts with a space libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` diff --git a/sql/opt_range.cc b/sql/opt_range.cc index 01b366077b0..a8ba609f9dc 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -825,6 +825,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit) if (!(table->keys_in_use_for_query.is_set(idx))) continue; KEY_PART_INFO *keyinfo= table->key_info[idx].key_part; + uint n_parts= table->key_info[idx].key_parts; uint partno= 0; /* @@ -834,7 +835,7 @@ uint get_index_for_order(TABLE *table, ORDER *order, ha_rows limit) */ if (!(table->file->index_flags(idx, 0, 1) & HA_READ_ORDER)) continue; - for (ord= order; ord; ord= ord->next, partno++) + for (ord= order; ord && partno < n_parts; ord= ord->next, partno++) { Item *item= order->item[0]; if (!(item->type() == Item::FIELD_ITEM && |