Details

    Description

      The current implementation of caching in mysqltest (q_lines, parser) breaks if the source command is executed conditionally in a loop.

      There is a "fix" for that — commit fe3ea31d93 — where the source command is executed on the first iteration of a loop even if it should've been skipped, just to read the file into a cache.

      This is, of course, wrong, because it fails if the file name is not available on the first iteration, or if t changes between iterations:

      filename not available

      let $a=1;
      while ($a < 3) {
        if ($b) {
          source $b;
        }
        let $b=1st.test;
        inc $a;
      }
      

      filename changes

      let $a=1;
      let $b=1st.test;
      while ($a < 3) {
        if ($b) {
          source $b;
        }
        let $b=2nd.test;
        inc $a;
      }
      

      Attachments

        Issue Links

          Activity

            amolholani Amol Holani added a comment -

            Thanks for quick reply.
            Will get back to you soon.

            amolholani Amol Holani added a comment - Thanks for quick reply. Will get back to you soon.
            danblack Daniel Black added a comment - https://github.com/MariaDB/server/blob/10.1/client/mysqltest.cc
            amolholani Amol Holani added a comment -

            Hi Sergei,
            I started on working on issues related to mysqltest that you suggested.
            How can I get source code specifically related to this particular issue.

            amolholani Amol Holani added a comment - Hi Sergei, I started on working on issues related to mysqltest that you suggested. How can I get source code specifically related to this particular issue.

            People

              Unassigned Unassigned
              serg Sergei Golubchik
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

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