Uploaded image for project: 'Railo'
  1. Railo
  2. RAILO-1402

Only first two queries in a batch can return a resultset

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 3.2.3.001
    • Fix Version/s: 3.3.0.020
    • Labels:
    • Steps to Reproduce:
      Hide

      <cfquery datasource="mysqlDatasource" name="thisQueryWorks">
      set @x = 0;
      select @x as x;
      </cfquery>

      <cfquery datasource="mysqlDatasource" name="thisQueryFails">
      set @x = 0;
      set @x = 0;
      select @x as x;
      </cfquery>

      Show
      <cfquery datasource="mysqlDatasource" name="thisQueryWorks"> set @x = 0; select @x as x; </cfquery> <cfquery datasource="mysqlDatasource" name="thisQueryFails"> set @x = 0; set @x = 0; select @x as x; </cfquery>

      Description

      If you run a cfquery with multiple statements delimited by semicolon, a result set will only be provided if it's the first or second statement. Any subsequent statements are run and returned by the server, but are not returned by cfquery.

      This is a duplicate of RAILO-945 and RAILO-609 which I am re-posting since I've come across the same bug and have tested it sufficiently to confirm that it's definitely a real bug.

      By comparison, ACF behaves consistently. No matter how many statements in the query, the first statement with a resultset is returned.

      The JDBC datasource DOES return resultsets for all statements that have them, not just the first two. This can be confirmed by using the same JDBC datasource in ACF (as I have done) as well as using the code snippet written by Michael Offner in issue RAILO-945.

      I am in the process of migrating a large app from ACF to Railo and this bug is forcing me to write some nasty workarounds with mysql session variables.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                micstriit Michael Offner
                Reporter:
                sjwright Simon Wright
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: