summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorcbell/Chuck@mysql_cab_desk. <>2007-03-19 16:12:46 -0400
committercbell/Chuck@mysql_cab_desk. <>2007-03-19 16:12:46 -0400
commit825ad05e5fa65569eb2fcffb20fbf65e07d218ab (patch)
tree70756b7778df7e5d095aa99c24ba26961f49d8c0 /sql/sql_class.cc
parentf3e56b5adb2208f5db63c8821b9bf44f7568b4af (diff)
parentd44eb9f0c92dd1eb3263f68a26d6382fa205710d (diff)
downloadmariadb-git-825ad05e5fa65569eb2fcffb20fbf65e07d218ab.tar.gz
Merge mysql_cab_desk.:C:/source/c++/mysql-5.0-rpl
into mysql_cab_desk.:C:/source/c++/mysql-5.0_BUG_25543
Diffstat (limited to 'sql/sql_class.cc')
-rw-r--r--sql/sql_class.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_class.cc b/sql/sql_class.cc
index 8c276d40cdf..22bfa042eb2 100644
--- a/sql/sql_class.cc
+++ b/sql/sql_class.cc
@@ -613,6 +613,18 @@ void THD::cleanup_after_query()
clear_next_insert_id= 0;
next_insert_id= 0;
}
+ /*
+ Reset rand_used so that detection of calls to rand() will save random
+ seeds if needed by the slave.
+
+ Do not reset rand_used if inside a stored function or trigger because
+ only the call to these operations is logged. Thus only the calling
+ statement needs to detect rand() calls made by its substatements. These
+ substatements must not set rand_used to 0 because it would remove the
+ detection of rand() by the calling statement.
+ */
+ if (!in_sub_stmt)
+ rand_used= 0;
/* Free Items that were created during this execution */
free_items();
/* Reset where. */