Dong Li created HAWQ-216: ---------------------------- Summary: Build-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 judge that 128<100. Because it make 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)