You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hawq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/01/21 10:22:40 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=15110326#comment-15110326 ] 

ASF GitHub Bot commented on HAWQ-216:
-------------------------------------

GitHub user realdawn opened a pull request:

    https://github.com/apache/incubator-hawq/pull/286

    HAWQ-216. Fix bug for built-in function gp_update_global_sequence_entry

    Parameter sequenceVal was defined as a int8 number. But it is should be a int64 number.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/realdawn/incubator-hawq HAWQ-216

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-hawq/pull/286.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #286
    
----
commit 74019db9d8dcc86db7ddfbf21a03398f39718b50
Author: doli <do...@pivotal.io>
Date:   2016-01-21T09:17:19Z

    HAWQ-216. Fix bug for built-in function gp_update_global_sequence_entry

----


> 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)