Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-3795

Order of VARIADIC parameters is not preserved

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 8.12.2, 8.13, 8.7.9.6_2
    • None
    • None
    • None

      It seems that the order of VARIADIC arguments passed to a stored procedure is not always preserved.
      For example, I defined a procedure in a virtual model in the VDB as follows:

      <model visible = "true" type = "VIRTUAL" name = "test_variadic">
              <metadata type = "DDL"><![CDATA[
      		CREATE PROCEDURE p1(VARIADIC parameters string)
      		AS BEGIN
      			declare integer i = 1;
      			WHILE(i <= array_length(parameters))
      			BEGIN
      				exec "SYSADMIN.logMsg"("level" => 'INFO', "context" => 'test', "msg" => 'param '|| parameters[i]);
      				i = i + 1;
      			END
      		END;
                  ]]>
              </metadata>
          </model>
      

      The procedure just prints to the console the passed arguments.
      When I call the procedure:

      exec "test_variadic.p1"('1' , '2', '3' , '4', '5' , '6', '7' , '8', '9' , '10', '11' , '12', '13' , '14', '15' , '16', '17' , '18', '19' , '20')
      

      only the first 15 parameters are printed in the same order as they are passed, as shown in the log below:

      22:44:26,117 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 1
      22:44:26,118 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 2
      22:44:26,119 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 3
      22:44:26,122 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 4
      22:44:26,123 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 5
      22:44:26,125 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 6
      22:44:26,127 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 7
      22:44:26,130 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 8
      22:44:26,132 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 9
      22:44:26,134 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 10
      22:44:26,138 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 11
      22:44:26,138 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 12
      22:44:26,140 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 13
      22:44:26,143 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 14
      22:44:26,144 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 15
      22:44:26,147 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 17
      22:44:26,149 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 16
      22:44:26,151 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 19
      22:44:26,153 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 18
      22:44:26,156 INFO  [test] (Worker2_QueryProcessorQueue21) AbdPCQQAsiSL param 20
      

              rhn-engineering-shawkins Steven Hawkins
              redfox999 Salvatore R. (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: