[Postgres-xl-bugs] ERROR: consistency check on SPI tuple count failed

Sergio Hernández Martínez serhermar at hotmail.com
Fri Aug 5 05:38:02 PDT 2016


Hi for everybody!
After try cursor in Pg/SQL, i found this bug. The code for reproduce this bug is:
CREATE TABLE T_TEST_CURSOR_1(	COD_CLIENT NUMERIC,	DEBIT NUMERIC) DISTRIBUTE BY HASH(COD_CLIENT);
INSERT INTO T_TEST_CURSOR_1 VALUES (1,100);INSERT INTO T_TEST_CURSOR_1 VALUES (1,100);INSERT INTO T_TEST_CURSOR_1 VALUES (1,100);INSERT INTO T_TEST_CURSOR_1 VALUES (2,400);
CREATE OR REPLACE FUNCTION test_cursor(v_datanode character varying)  RETURNS void AS$BODY$DECLARE	localDN	VARCHAR(100);
		c1 refcursor; 	c1_rec record;
	queryDistributed varchar := '';
	queryC1 VARCHAR(1000) := '			select cod_client, debit from T_TEST_CURSOR_1	';
BEGIN	RAISE WARNING '% - Start', to_char(clock_timestamp(),('dd-mm-yyyy / hh24:mi:ss'));		localDN:=v_datanode;
	queryDistributed := 'EXECUTE DIRECT ON (' || localDN || ') ''' || queryC1 || '''';	OPEN c1 FOR EXECUTE queryDistributed;	LOOP		FETCH c1 INTO c1_rec;		EXIT WHEN NOT FOUND;			RAISE INFO '%: COD_CLIENT: %', to_char(clock_timestamp(),('dd-mm-yyyy / hh24:mi:ss')), c1_rec.COD_CLIENT;
	End Loop; 	CLOSE c1;
END $BODY$  LANGUAGE plpgsql VOLATILE  COST 100;
test=# select test_cursor('datanode_node01');WARNING:  05-08-2016 / 14:33:32 - InicioINFO:  05-08-2016 / 14:33:32: COD_CLIENT: 1INFO:  05-08-2016 / 14:33:32: COD_CLIENT: 1INFO:  05-08-2016 / 14:33:32: COD_CLIENT: 1INFO:  05-08-2016 / 14:33:32: COD_CLIENT: 1ERROR:  consistency check on SPI tuple count failedCONTEXT:  PL/pgSQL function test_cursor(character varying) line 25 at FETCH
Thank You!Sergio 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-bugs-postgres-xl.org/attachments/20160805/c5d41525/attachment.htm>


More information about the postgres-xl-bugs mailing list