[MDEV-25209] Improve mysqltest language Created: 2021-03-20  Updated: 2021-03-20  Resolved: 2021-03-20

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients, Tests
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Utkarsh Kharkwal Assignee: Sergei Golubchik
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
is duplicated by MDEV-12130 Improve mysqltest language (Full-time... Open

 Description   

mysqltest has a lot of historical problems:

  • ad hoc parser, weird limitations
  • commands added as needed with no view over the total language structure
  • historical code issues (e.g. casts that become unnecessary ~10 years ago)
    etc

A lot can be done to improve it.

Ideas

to simplify writing tests

  • control structures, else in if, break and continue in while, for (or foreach) loop
  • proper expression support in let, if, etc
  • letenv command to set environment variables instead of having let do it.
  • ${var} and ${${var}} variable expansion
  • rich enough expressions to make resorting to sql unnecessary in most cases
    • in particular, see rpl_init.inc
  • remove unused and redundant commands (e.g. system vs exec, query_vertical vs vertical_results ONCE)
  • remove complex commands that do many sql statements under the hood, if they can be scripted, e.g. sync_slave_with_master
  • scoped variables
  • parameters for the source command
  • remove dead code
  • returning values from perl command (in some easier way than writing a new file and sourcing it)
    • e.g. stderr is stored in $perl ?
  • running many test files on one server connection. They are supposed to be independent, so for performance reasons we can avoid restarting mysqltest for them

to simplify debugging

  • make `echo` automatically print `#` at the start of every line (optionally, don't do it if it's explicitly specified — for backward compatibility)
  • make most commands print itself to the log.
    • os and file operations, like exec/remove_file, etc, should strip MYSQL_VAR_DIR from paths.
  • remove over-verbose treatment of rpl test failures (already done in 64dd3969481)


 Comments   
Comment by Utkarsh Kharkwal [ 2021-03-20 ]

I think i can solve this problem.......and bring great documentation to the code a well....if given the chance

Comment by Sergei Golubchik [ 2021-03-20 ]

Don't clone the original issue, please. Add your comments to MDEV-12130 instead.

Generated at Thu Feb 08 09:35:58 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.