summaryrefslogtreecommitdiff
path: root/sql/sql_select.cc
diff options
context:
space:
mode:
authoringo@mysql.com <>2005-01-19 21:20:55 +0100
committeringo@mysql.com <>2005-01-19 21:20:55 +0100
commitea8882be8060998510308c2528ce80229759edf1 (patch)
treec6d0c97d5f422270c1c63a8e94fbca2afd16bf64 /sql/sql_select.cc
parente906e861216d4f0f3c727934dd4e75845d3f446c (diff)
downloadmariadb-git-ea8882be8060998510308c2528ce80229759edf1.tar.gz
BUG#6034 - Error code 124: Wrong medium type.
Version for 5.0. Committed for merge. If the result table is one of the select tables in INSERT SELECT, we must not disable the result tables indexes before selecting. Now the preparation is split into two prepare methods. The first detects the situation and defers some preparations until the second phase.
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r--sql/sql_select.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc
index 94a2390324c..0fc4616749c 100644
--- a/sql/sql_select.cc
+++ b/sql/sql_select.cc
@@ -1164,6 +1164,7 @@ JOIN::exec()
DBUG_VOID_RETURN;
}
}
+ (void) result->prepare2(); // Currently, this cannot fail.
if (!tables_list)
{ // Only test of functions
@@ -13149,7 +13150,8 @@ bool JOIN::change_result(select_result *res)
{
DBUG_ENTER("JOIN::change_result");
result= res;
- if (!procedure && result->prepare(fields_list, select_lex->master_unit()))
+ if (!procedure && (result->prepare(fields_list, select_lex->master_unit()) ||
+ result->prepare2()))
{
DBUG_RETURN(TRUE);
}