[MDEV-12138] mysqltest: source inside a loop Created: 2017-02-27  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Scripts & Clients, Tests
Affects Version/s: 5.5, 10.0, 10.1, 10.2
Fix Version/s: 10.4

Type: Bug Priority: Minor
Reporter: Sergei Golubchik Assignee: Unassigned
Resolution: Unresolved Votes: 2
Labels: None

Issue Links:
Relates
relates to MDEV-12130 Improve mysqltest language (Full-time... Open
relates to MDEV-12139 mysqltest: errors in source in a loop Open

 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;
}



 Comments   
Comment by Amol Holani [ 2017-03-12 ]

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.

Comment by Daniel Black [ 2017-03-12 ]

https://github.com/MariaDB/server/blob/10.1/client/mysqltest.cc

Comment by Amol Holani [ 2017-03-12 ]

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

Generated at Thu Feb 08 07:55:25 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.