[MCOL-3760] rand() returns different results in 1.4 vs 1.2 Created: 2020-02-04 Updated: 2020-11-12 Resolved: 2020-03-30 |
|
| Status: | Closed |
| Project: | MariaDB ColumnStore |
| Component/s: | ExeMgr |
| Affects Version/s: | 1.4.2 |
| Fix Version/s: | 1.4.4, 1.5.1 |
| Type: | Bug | Priority: | Major |
| Reporter: | David Hall (Inactive) | Assignee: | Daniel Lee (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Sprint: | 2020-2, 2020-3, 2020-4, 2020-5, 2020-6 | ||||||||
| Description |
|
See /home/calpont/mariadb-columnstore-regression-test/mysql/queries/working_tpch1/qa_fe_cnxFunctions/bug3506.sql The query: Expected output: Actual output: |
| Comments |
| Comment by David Hall (Inactive) [ 2020-02-13 ] | ||||||||||||||||||||||||||||||||||||
|
'select rand(2) from region' gives the expected result. It's only when the second rand() is added to the order by that things get broken. | ||||||||||||||||||||||||||||||||||||
| Comment by Jose Rojas (Inactive) [ 2020-02-13 ] | ||||||||||||||||||||||||||||||||||||
|
After investigating I added some regression tests inside working_tpch1/qa_fe_cnxFunctions/RAND.sql that will be of great help when testing this. | ||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2020-03-30 ] | ||||||||||||||||||||||||||||||||||||
|
Builds verified: 1.4.4-1 source, 1.5.0-1 BB 1.4.4-1 /root/ColumnStore/buildColumnstoreFromGithubSource/server /root/ColumnStore/buildColumnstoreFromGithubSource/server/engine Merge pull request #1117 from drrtuy/ MariaDB [tpch1]> select rand(0) from region;
---------------------
--------------------- MariaDB [tpch1]> select rand(-2) from region order by 1;
---------------------
--------------------- MariaDB [tpch1]> select rand(2) from region order by rand(1);
---------------------
--------------------- MariaDB [tpch1]> select * from (select n_nationkey, rand(1) from nation limit 1) x;
------------
------------ MariaDB [tpch1]> select * from (select n_nationkey from nation order by rand(1) limit 1 )a;
-------------
------------- MariaDB [tpch1]> select rand(r_regionkey) from region;
---------------------
--------------------- MariaDB [tpch1]> select rand(r_name) from region;
---------------------
--------------------- | ||||||||||||||||||||||||||||||||||||
| Comment by Daniel Lee (Inactive) [ 2020-03-30 ] | ||||||||||||||||||||||||||||||||||||
|
Test result match with that of 1.2.5-1 |