summaryrefslogtreecommitdiff
path: root/sql/sql_insert.cc
diff options
context:
space:
mode:
authorjimw@mysql.com <>2005-12-12 10:11:56 -0800
committerjimw@mysql.com <>2005-12-12 10:11:56 -0800
commite18679c7ffa6e8781a046506d5fce4070c940e0b (patch)
treebbcd25d2b7951525f91290ea07d709f48525c788 /sql/sql_insert.cc
parentc34595c9754c4778f8c27695eb81e13d4707d6c1 (diff)
parentf7ff3d653a7aeeb327aafe244c330800ab5f0f78 (diff)
downloadmariadb-git-e18679c7ffa6e8781a046506d5fce4070c940e0b.tar.gz
Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into mysql.com:/home/jimw/my/mysql-5.0-clean
Diffstat (limited to 'sql/sql_insert.cc')
-rw-r--r--sql/sql_insert.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
index 8903f28be11..e5ea296afab 100644
--- a/sql/sql_insert.cc
+++ b/sql/sql_insert.cc
@@ -257,7 +257,7 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
*/
bool log_on= (thd->options & OPTION_BIN_LOG) ||
(!(thd->security_ctx->master_access & SUPER_ACL));
- bool transactional_table;
+ bool transactional_table, joins_freed= FALSE;
uint value_count;
ulong counter = 1;
ulonglong id;
@@ -513,6 +513,9 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->row_count++;
}
+ free_underlaid_joins(thd, &thd->lex->select_lex);
+ joins_freed= TRUE;
+
/*
Now all rows are inserted. Time to update logs and sends response to
user
@@ -611,7 +614,6 @@ bool mysql_insert(THD *thd,TABLE_LIST *table_list,
thd->row_count_func= info.copied+info.deleted+info.updated;
::send_ok(thd, (ulong) thd->row_count_func, id, buff);
}
- free_underlaid_joins(thd, &thd->lex->select_lex);
thd->abort_on_warning= 0;
DBUG_RETURN(FALSE);
@@ -620,7 +622,8 @@ abort:
if (lock_type == TL_WRITE_DELAYED)
end_delayed_insert(thd);
#endif
- free_underlaid_joins(thd, &thd->lex->select_lex);
+ if (!joins_freed)
+ free_underlaid_joins(thd, &thd->lex->select_lex);
thd->abort_on_warning= 0;
DBUG_RETURN(TRUE);
}