summaryrefslogtreecommitdiff
path: root/sql/sql_delete.cc
diff options
context:
space:
mode:
authoristruewing@stella.local <>2008-03-26 10:56:03 +0100
committeristruewing@stella.local <>2008-03-26 10:56:03 +0100
commitc882b871100a73cda874d39fd0ec41b7ad4f94e4 (patch)
tree9e5ba5e508b636add1b3ab6b1fb7ca5124f9db4d /sql/sql_delete.cc
parent0eff6e7be5f290854e5810173b2239c41c7b75a5 (diff)
parent2d44db25e7a7687af75a94e8e5ff94071c6e05f5 (diff)
downloadmariadb-git-c882b871100a73cda874d39fd0ec41b7ad4f94e4.tar.gz
Merge stella.local:/home2/mydev/mysql-5.1-ateam
into stella.local:/home2/mydev/mysql-5.1-axmrg
Diffstat (limited to 'sql/sql_delete.cc')
-rw-r--r--sql/sql_delete.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc
index 4e0853dbbc4..1456b66638d 100644
--- a/sql/sql_delete.cc
+++ b/sql/sql_delete.cc
@@ -418,6 +418,19 @@ bool mysql_prepare_delete(THD *thd, TABLE_LIST *table_list, Item **conds)
DBUG_ENTER("mysql_prepare_delete");
List<Item> all_fields;
+ /*
+ Statement-based replication of DELETE ... LIMIT is not safe as order of
+ rows is not defined, so in mixed mode we go to row-based.
+
+ Note that we may consider a statement as safe if ORDER BY primary_key
+ is present. However it may confuse users to see very similiar statements
+ replicated differently.
+ */
+ if (thd->lex->current_select->select_limit)
+ {
+ thd->lex->set_stmt_unsafe();
+ thd->set_current_stmt_binlog_row_based_if_mixed();
+ }
thd->lex->allow_sum_func= 0;
if (setup_tables_and_check_access(thd, &thd->lex->select_lex.context,
&thd->lex->select_lex.top_join_list,