Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14594

Intermittent no results from query

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.52
    • N/A
    • Server
    • None
    • Linux

    Description

      I have a query. The query usually succeeds when executed from MySql Workbench and usually fails when executed with Python pymysql library.

      The query is as follows:

      SELECT ID, MAX(c) AS changes_in_result, COUNT(c) AS executions
              FROM (
                  SELECT IF(@currvalue = ID, IF(@p = Result, @c, @c:=@c+1), @c:=0) AS c,
                       SUBSTRING_INDEX(ID, '/', -2) AS ID,
                  (@p:=Result),
                  @currvalue := ID AS whatever
              FROM test.suite_results AS t,
              (SELECT @p:=0, @currcount:=NULL, @currvalue:=NULL) AS _init
              WHERE Feature = 'comms'
              AND RTM_Finish >= DATE_SUB(CURDATE(),INTERVAL 28 day)
              order by ID, RTM_Finish DESC
              ) AS sub
              GROUP BY ID
              HAVING changes_in_result > 0
              ORDER BY changes_in_result DESC
      

      The query should return string, followed by float, followed by long.
      I've captured communication between client and server and while the query looks identical in both cases, the response is different:

      • in successful case, the fields are returned as expected
      • in unsuccessful case, the second field is indicated as BLOB with length of "00 00 00 01" (> 16 mln) and two response fields with EOF marker (254)

      All of that implies that there's something tricky with the server.
      I'm sorry I couldn't provide more details, but some of them might be too sensitive to share (my employer).
      I haven't had a chance to verify on latest version (5.5.58).

      By the way, I've almost forgotten.
      Removing HAVING from the end makes it working in both environments. So far 100%.

      I can try to provide at least wireshark dumps (where they don't reveal anything).
      And the database/table structure.

      I'm reporting it early to not forget about it (when having the workaround).

      Regards,
      Robert

      Attachments

        Activity

          People

            Unassigned Unassigned
            rgom Robert G
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.