You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafodion.apache.org by "Hans Zeller (JIRA)" <ji...@apache.org> on 2018/04/25 16:30:00 UTC

[jira] [Closed] (TRAFODION-3042) RAND() function is not always random

     [ https://issues.apache.org/jira/browse/TRAFODION-3042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hans Zeller closed TRAFODION-3042.
----------------------------------

> RAND() function is not always random
> ------------------------------------
>
>                 Key: TRAFODION-3042
>                 URL: https://issues.apache.org/jira/browse/TRAFODION-3042
>             Project: Apache Trafodion
>          Issue Type: Bug
>          Components: sql-exe
>    Affects Versions: 2.2.0
>            Reporter: Hans Zeller
>            Assignee: Hans Zeller
>            Priority: Major
>             Fix For: 2.3
>
>
> When trying the RAND() function, I found that it does not always behave as I would expect. I tried this example:
> {noformat}
> >>select rand(), rand(), rand() from dual;
> (EXPR)      (EXPR)      (EXPR)    
> ----------  ----------  ----------
>   78242471    78511383    78612225
> --- 1 row(s) selected.
> >>select rand(), rand(), rand() from dual;
> (EXPR)      (EXPR)      (EXPR)    
> ----------  ----------  ----------
> 1589208276  1589460381  1589561223
> --- 1 row(s) selected.
> >>select rand(), rand(), rand() from dual;
> (EXPR)      (EXPR)      (EXPR)    
> ----------  ----------  ----------
> 134371215   134724162   134858618
> --- 1 row(s) selected.
> >>
> {noformat}
> So, it seems that if we call rand() within a very short time, the value will be non-random.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)