summaryrefslogtreecommitdiff
path: root/sql/sql_class.cc
diff options
context:
space:
mode:
authorunknown <lars/lthalmann@mysql.com/dl145h.mysql.com>2007-03-29 12:25:28 +0200
committerunknown <lars/lthalmann@mysql.com/dl145h.mysql.com>2007-03-29 12:25:28 +0200
commite420488ee6e3b38a0524b391a96638af7edc06ce (patch)
tree1e6d9e2f685ac0edc110cb4b215d1c1d82f25289 /sql/sql_class.cc
parent8e1d4f725663d60b7efa7d5ec4271cbd924cad80 (diff)
parentee0475bf5d5b9256d599aa6b9dcc641d4857d301 (diff)
downloadmariadb-git-e420488ee6e3b38a0524b391a96638af7edc06ce.tar.gz
Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge sql/mysqld.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_select.cc: Auto merged
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 8dea9383f34..a94f903a47b 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. */