You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "Dong Li (JIRA)" <ji...@apache.org> on 2016/01/25 02:59:39 UTC
[jira] [Resolved] (HAWQ-216) Built-in functions
gp_update_global_sequence_entry has a bug
[ https://issues.apache.org/jira/browse/HAWQ-216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dong Li resolved HAWQ-216.
--------------------------
Resolution: Fixed
> 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: Ming LI
> Fix For: 2.0.0
>
>
> 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)