summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorSeppo Jaakola <seppo.jaakola@codership.com>2013-07-13 13:01:13 +0300
committerSeppo Jaakola <seppo.jaakola@codership.com>2013-07-13 13:01:13 +0300
commit0a9216835f406947fb4d492616da4cda75e5e113 (patch)
tree7fbf5059c59fa86ca255452f3ce312aece492652 /sql/item_func.cc
parent58926b5e1990d3245b55081ba511fbabe2604e17 (diff)
downloadmariadb-git-0a9216835f406947fb4d492616da4cda75e5e113.tar.gz
Initial merge result with mariaDB 10: lp:maria
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index d0fca63688a..a231b245b53 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -2596,7 +2596,19 @@ void Item_func_rand::seed_random(Item *arg)
TODO: do not do reinit 'rand' for every execute of PS/SP if
args[0] is a constant.
*/
+#ifdef WITH_WSREP
+ uint32 tmp;
+ if (WSREP(current_thd))
+ {
+ if (current_thd->wsrep_exec_mode==REPL_RECV)
+ tmp= current_thd->wsrep_rand;
+ else
+ tmp= current_thd->wsrep_rand= (uint32) arg->val_int();
+ } else
+ tmp= (uint32) arg->val_int();
+#else
uint32 tmp= (uint32) arg->val_int();
+#endif /* WITH_WSREP */
my_rnd_init(rand, (uint32) (tmp*0x10001L+55555555L),
(uint32) (tmp*0x10000001L));
}