← Back to team overview

maria-developers team mailing list archive

Re: 8790c095ab0: MDEV-21704 Add a new JSON field "version_id" into mysql.global_priv.priv

 

Hi, Alexander!

Looks ok, just one test related comment.

On Feb 20, Alexander Barkov wrote:
> revision-id: 8790c095ab0 (mariadb-10.5.0-225-g8790c095ab0)
> parent(s): 2c34315df6e
> author: Alexander Barkov <bar@xxxxxxxxxxx>
> committer: Alexander Barkov <bar@xxxxxxxxxxx>
> timestamp: 2020-02-14 21:56:12 +0400
> message:
> 
> MDEV-21704 Add a new JSON field "version_id" into mysql.global_priv.priv
> 
> +--log-error=$MYSQLTEST_VARDIR/tmp/system_mysql_db_error_log.err
...
> +CREATE TABLE error_log (msg TEXT);
> +--disable_query_log
> +--eval LOAD DATA INFILE "$MYSQLTEST_VARDIR/tmp/system_mysql_db_error_log.err" INTO TABLE error_log;
> +--enable_query_log
> +
> +# On some platforms hours less than 10 can be logged without the leading zero:
> +# '2020-02-13  8:16:56' rather than
> +# '2020-02-13 08:16:56'
> +# Hence the space character in the hour part of the regular expression.
> +# Also, replace '\r' to '', so the output is equal on Linux and Windows.
> +
> +SELECT
> +  REPLACE(
> +    REGEXP_REPLACE(msg,
> +                  '^[0-9]{4}-[0-9]{2}-[0-9]{2} [ 0-9]{2}:[0-9]{2}:[0-9]{2}',
> +                  'YYYY-MM-DD hh:mm:ss'),
> +    '\r',''
> +  ) AS msg
> +FROM error_log WHERE msg LIKE '%user%entry%';

instead of --log-error and LOAD DATA with REGEXP_REPLACE, please use
something like

--let SEARCH_FILE=$MYSQLTEST_VARDIR/log/mysqld.1.err
--let SEARCH_PATTERN="'user' entry 'bad_.*has a wrong"
--source include/search_pattern_in_file.inc

this will print that there were 4 matches. Alternatively you can use
four very specific SEARCH_PATTERN, one for each expected error.

It's easier than what you've used, keeps the error log in one file, and
doesn't run unnecessary sql on the server (otherwise debugging quickly
becomes very annoying, grr, replication tests).

Regards,
Sergei
VP of MariaDB Server Engineering
and security@xxxxxxxxxxx