diff options
author | konstantin@mysql.com <> | 2004-10-14 02:53:59 +0400 |
---|---|---|
committer | konstantin@mysql.com <> | 2004-10-14 02:53:59 +0400 |
commit | 5abc3de22bbef2e9818a890a61f840fb5daaf1b7 (patch) | |
tree | 27ce02a5ecb8610d69b81dc15a3d96a62126e80a /sql/item_func.h | |
parent | cc57252bb76feab94caf3035a2ca083b0734222f (diff) | |
download | mariadb-git-5abc3de22bbef2e9818a890a61f840fb5daaf1b7.tar.gz |
A fix and test case for Bug#5985 ""prepare stmt from "select rand(?)"
crashes server." The fix makes Item_func_rand prepared-statements
aware plus it fixes the case when RAND is used in prepared
statements and replication is on (as well as several similar issues).
Until now we did not reset THD before every execution of a prepared
statement, so if some execution had set thd->time_zone_used
or thd->rand_used they would not be reset until next mysql_parse.
Some of post-review fixes done.
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 4889ca78a77..e61459cfbd8 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -512,13 +512,13 @@ class Item_func_rand :public Item_real_func { struct rand_struct *rand; public: - Item_func_rand(Item *a) :Item_real_func(a) {} - Item_func_rand() :Item_real_func() {} + Item_func_rand(Item *a) :Item_real_func(a), rand(0) {} + Item_func_rand() :Item_real_func() {} double val(); const char *func_name() const { return "rand"; } bool const_item() const { return 0; } void update_used_tables(); - void fix_length_and_dec(); + bool fix_fields(THD *thd, struct st_table_list *tables, Item **ref); }; |