summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/item_create.cc')
-rw-r--r--sql/item_create.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/sql/item_create.cc b/sql/item_create.cc
index e2aacf9a27d..89dbdd98262 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -4178,6 +4178,16 @@ Create_func_rand::create_native(THD *thd, LEX_STRING name,
if (item_list != NULL)
arg_count= item_list->elements;
+ /*
+ When RAND() is binlogged, the seed is binlogged too. So the
+ sequence of random numbers is the same on a replication slave as
+ on the master. However, if several RAND() values are inserted
+ into a table, the order in which the rows are modified may differ
+ between master and slave, because the order is undefined. Hence,
+ the statement is unsafe to log in statement format.
+ */
+ thd->lex->set_stmt_unsafe();
+
switch (arg_count) {
case 0:
{