diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2009-05-18 09:21:25 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2009-05-18 09:21:25 +0500 |
commit | 9cc4cb0ea1f429983ce7ee8783504fa7fb5c2d7f (patch) | |
tree | 0cc46a52d78c3e50ef405932673b7269b7af6590 /sql/password.c | |
parent | 0b608e98bb190244136c109ea31762d672e634cd (diff) | |
download | mariadb-git-9cc4cb0ea1f429983ce7ee8783504fa7fb5c2d7f.tar.gz |
Bug #44768: SIGFPE crash when selecting rand from a view containing null
The RAND(N) function where the N is a field of "constant" table
(table of single row) failed with a SIGFPE.
Evaluation of RAND(N) rely on constant status of its argument.
Current server "seeded" random value for each constant argument
only once, in the Item_func_rand::fix_fields method.
Then the server skipped a call to seed_random() in the
Item_func_rand::val_real method for such constant arguments.
However, non-constant state of an argument may be changed
after the call to fix_fields, if an argument is a field of
"constant" table. Thus, pre-initialization of random value
in the fix_fields method is too early.
Initialization of random value by seed_random() has been
removed from Item_func_rand::fix_fields method.
The Item_func_rand::val_real method has been modified to
call seed_random() on the first evaluation of this method
if an argument is a function.
Diffstat (limited to 'sql/password.c')
0 files changed, 0 insertions, 0 deletions