summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 587b205886e..8b4b1b527ca 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -170,12 +170,13 @@ int mysql_delete(THD *thd,TABLE_LIST *table_list,COND *conds,ha_rows limit,
select=make_select(table,0,0,conds,&error);
if (error)
DBUG_RETURN(-1);
- if (select && select->check_quick(test(thd->options & SQL_SAFE_UPDATES),
- limit))
+ if ((select && select->check_quick(test(thd->options & SQL_SAFE_UPDATES),
+ limit)) ||
+ !limit)
{
delete select;
send_ok(&thd->net,0L);
- DBUG_RETURN(0);
+ DBUG_RETURN(0); // Nothing to delete
}
/* If running in safe sql mode, don't allow updates without keys */