This is an automated email from the ASF dual-hosted git repository.

huor pushed a commit to branch huor
in repository https://gitbox.apache.org/repos/asf/hawq.git


The following commit(s) were added to refs/heads/huor by this push:
     new 39cfe43  HAWQ-1717. Fix incorrect seeding for random function
39cfe43 is described below

commit 39cfe439d1fbad22a22d16649b5707fb528f64fe
Author: Ruilong Huo <[email protected]>
AuthorDate: Mon May 13 10:15:26 2019 +0800

    HAWQ-1717. Fix incorrect seeding for random function
---
 src/port/rand.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/port/rand.c b/src/port/rand.c
index 8559ef8..5982ef9 100644
--- a/src/port/rand.c
+++ b/src/port/rand.c
@@ -74,7 +74,7 @@ srand48(long seed)
 {
        _rand48_seed[0] = RAND48_SEED_0;
        _rand48_seed[1] = (unsigned short) seed;
-       _rand48_seed[2] = (unsigned short) (seed > 16);
+       _rand48_seed[2] = (unsigned short) (seed >> 16);
        _rand48_mult[0] = RAND48_MULT_0;
        _rand48_mult[1] = RAND48_MULT_1;
        _rand48_mult[2] = RAND48_MULT_2;

Reply via email to