From ac4c0538529c0bf351d116b0b9d2c58c7fc3bc35 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 22 Aug 2004 00:06:19 +0500 Subject: Proposed fix for bug #5003 (subselect with MIN() and LIKE crashes server) We have next problem here: active_index is wrong in the subselect's handler on the second val_int() call. Optimizer sees that we can use index-read for that kind of condition, and matching_cond() (sql/opt_sum.cc) doesn't. I suspect, proper solution is to add appropriate code to the matching_cond() but now just added missed initialization. mysql-test/r/subselect.result: Appropriate test result mysql-test/t/subselect.test: Test case added sql/records.cc: index's initialization added --- sql/records.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sql') diff --git a/sql/records.cc b/sql/records.cc index 94634d30759..5a969ef9c20 100644 --- a/sql/records.cc +++ b/sql/records.cc @@ -101,6 +101,9 @@ void init_read_record(READ_RECORD *info,THD *thd, TABLE *table, else if (select && select->quick) { DBUG_PRINT("info",("using rr_quick")); + + if (!table->file->inited) + table->file->ha_index_init(select->quick->index); info->read_record=rr_quick; } else if (table->sort.record_pointers) -- cgit v1.2.1