[
https://issues.apache.org/jira/browse/HAWQ-216?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15111971#comment-15111971
]
ASF GitHub Bot commented on HAWQ-216:
-------------------------------------
Github user liming01 commented on the pull request:
https://github.com/apache/incubator-hawq/pull/286#issuecomment-173819513
Looks good. +1.
> Built-in functions gp_update_global_sequence_entry has a bug
> ------------------------------------------------------------
>
> Key: HAWQ-216
> URL: https://issues.apache.org/jira/browse/HAWQ-216
> Project: Apache HAWQ
> Issue Type: Bug
> Reporter: Dong Li
> Assignee: Lei Chang
>
> The code in persistentutil.c:200 is as follow.
> {code}
> line 200: int8 sequenceVal;
> line 212: sequenceVal = PG_GETARG_INT64(1);
> {code}
> It make put a int64 to int8, which will make bugs as follow.
> {code}
> ff=# select * from gp_global_sequence ;
> sequence_num
> --------------
> 1200
> 100
> 100
> 100
> 100
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> 0
> (15 rows)
> ff=# select gp_update_global_sequence_entry('(0,2)'::tid,128);
> ERROR: sequence number too low (persistentutil.c:232)
> {code}
> It compares 128 with 100, and judges that 128<100.
> Because it makes 128 into int8 type, which make 0x80(128) be calculated as
> -128 in int8 type.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)