Uploaded image for project: 'Apache HAWQ (Retired)'
  1. Apache HAWQ (Retired)
  2. HAWQ-328

plsql loop three times exit abnormality

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 2.0.0.0-incubating
    • 2.0.0.0-incubating
    • Core
    • None

    Description

      plsql of hawq loop three times exit abnormality.
      Add print in code, Then I found when program looped third time, before running line 824 in src/backend/executor/execMain.c, the value of queryDesc->plannedstmt->resource->type is 1050. After running this line the value became a random number. But after running this line in the tirst two loop, the value is still 1050. Because queryDesc is not a actual parameter of prepareDispatchedCatalogRelation in line 824, I cannot continue to keep track of code.

      stdour and stderr as below :

      psql:test_plsql_loop.sql:66: NOTICE: for loop: quantity here is 1
      psql:test_plsql_loop.sql:66: NOTICE: FOR LOOP: ROW HERE IS (14929)
      psql:test_plsql_loop.sql:66: NOTICE: for loop: quantity here is 2
      psql:test_plsql_loop.sql:66: NOTICE: FOR LOOP: ROW HERE is (14929)
      psql:test_plsql_loop.sql:66: NOTICE: for loop: quantity here is 3
      psql:test_plsql_loop.sql:66: ERROR: could not serialize unrecognized node type: 38814640 (outfast.c:4742)
      CONTEXT: SQL statement "SELECT COUNT(1) FROM oiq_t_2"
      PL/pgSQL function "func2" line 11 at SQL statement

      plsql code as below:

      CREATE OR REPLACE FUNCTION funcloop() RETURNS text AS $func$
      DECLARE
      rowvar RECORD;
      BEGIN
      FOR i IN 1..10 LOOP
      RAISE NOTICE 'loop: quantity here is %', i;
      SELECT COUNT(1) INTO rowvar FROM oiq_t_2;
      RAISE NOTICE 'FOR LOOP: ROW HERE IS %', rowvar;
      END LOOP;
      return rowvar;
      END;
      $func$ LANGUAGE plpgsql;
      select funcloop();

      Attachments

        Issue Links

          Activity

            People

              huor Ruilong Huo
              dafangfang longgeligelong
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: