Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
mariadb
Commits
ef90dbc4
Commit
ef90dbc4
authored
20 years ago
by
unknown
Browse files
Options
Download
Email Patches
Plain Diff
A fix (bug #7281: RAND(RAND) crashes server).
parent
b3ef5f8e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
1 deletion
+11
-1
mysql-test/r/func_math.result
mysql-test/r/func_math.result
+2
-0
mysql-test/t/func_math.test
mysql-test/t/func_math.test
+7
-0
sql/item_func.cc
sql/item_func.cc
+2
-1
No files found.
mysql-test/r/func_math.result
View file @
ef90dbc4
...
...
@@ -124,3 +124,5 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No tables used
Warnings:
Note 1003 select degrees(pi()) AS `degrees(pi())`,radians(360) AS `radians(360)`
select rand(rand);
ERROR 42S22: Unknown column 'rand' in 'field list'
This diff is collapsed.
Click to expand it.
mysql-test/t/func_math.test
View file @
ef90dbc4
...
...
@@ -51,3 +51,10 @@ SELECT ASIN(1.2-0.2);
#select floor(log(16)/log(2));
explain
extended
select
degrees
(
pi
()),
radians
(
360
);
#
# Bug #7281: problem with rand()
#
--
error
1054
select
rand
(
rand
);
This diff is collapsed.
Click to expand it.
sql/item_func.cc
View file @
ef90dbc4
...
...
@@ -1091,7 +1091,8 @@ double Item_func_round::val()
bool
Item_func_rand
::
fix_fields
(
THD
*
thd
,
struct
st_table_list
*
tables
,
Item
**
ref
)
{
Item_real_func
::
fix_fields
(
thd
,
tables
,
ref
);
if
(
Item_real_func
::
fix_fields
(
thd
,
tables
,
ref
))
return
TRUE
;
used_tables_cache
|=
RAND_TABLE_BIT
;
if
(
arg_count
)
{
// Only use argument once in query
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment