summaryrefslogtreecommitdiff
path: root/sql/item_create.cc
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-01-19 19:36:14 +0300
committerAlexander Nozdrin <alik@sun.com>2010-01-19 19:36:14 +0300
commita6667f8577b0830f27dfbafb48561c23aee08ebd (patch)
tree688c26274e23ab44604f2f276f6a5c78e49241bf /sql/item_create.cc
parent40271e4f5edacc6fe90ed74a087e5ff25daea899 (diff)
parent0835775b7c3b074332800ee92112d68b28cec083 (diff)
downloadmariadb-git-a6667f8577b0830f27dfbafb48561c23aee08ebd.tar.gz
Manual merge from mysql-trunk-merge.
Conflicts: - configure.in - include/m_string.h - mysql-test/extra/rpl_tests/rpl_row_func003.test - mysql-test/r/mysqlbinlog.result - mysql-test/r/union.result - mysql-test/suite/binlog/r/binlog_killed_simulate.result - mysql-test/suite/binlog/r/binlog_row_mix_innodb_myisam.result - mysql-test/suite/binlog/r/binlog_unsafe.result - mysql-test/suite/binlog/t/binlog_unsafe.test - mysql-test/suite/rpl/r/rpl_loaddata_fatal.result - mysql-test/suite/rpl/r/rpl_loaddata_map.result - mysql-test/suite/rpl/r/rpl_stm_loaddata_concurrent.result - mysql-test/suite/rpl/r/rpl_stm_log.result - mysql-test/suite/rpl/t/rpl_optimize.test - mysql-test/t/mysqlbinlog.test - mysql-test/t/union.test - sql/rpl_utility.h - sql/sql_union.cc - strings/Makefile.am
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 7d36481a23b..a393c886483 100644
--- a/sql/item_create.cc
+++ b/sql/item_create.cc
@@ -4218,6 +4218,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(LEX::BINLOG_STMT_UNSAFE_SYSTEM_FUNCTION);
+
switch (arg_count) {
case 0:
{