← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 69704b6: MDEV-6887 Optimize sys_vars.sysvar_* tests

 

Hi, Elena!

On Aug 06, elenst@xxxxxxxxxxxxxxxx wrote:
> revision-id: 69704b6c6f895fa706f83bcd3bcefe267aaf8e57
> parent(s): afd59b575a75ebbc57f71ce2865fdff85e3e233b
> committer: Elena Stepanova
> branch nick: bb-10.1-elenst
> timestamp: 2015-08-06 02:55:43 +0300
> message:
> 
> MDEV-6887 Optimize sys_vars.sysvar_* tests
> 
> diff --git a/mysql-test/suite/sys_vars/inc/sysvars_server.inc b/mysql-test/suite/sys_vars/inc/sysvars_server.inc
> index cb06b40..98bffd4 100644
> --- a/mysql-test/suite/sys_vars/inc/sysvars_server.inc
> +++ b/mysql-test/suite/sys_vars/inc/sysvars_server.inc
> @@ -11,8 +12,9 @@ set sql_mode=ansi_quotes;
>  # global_value_origin=SQL
>  set global div_precision_increment=5;
>  
> ---replace_regex /^\/\S+/PATH/
> +--replace_regex /^\/\S+/PATH/ /^[a-zA-Z]:[\\\/]\S+/PATH/ /^BIGINT\b/<INT or BIGINT>/ /^INT\b/<INT or BIGINT>/ /^(?:18446744073709551615\b|4294967295\b)/<32-bit or 64-bit MAX UNSIGNED>/ /^(?:9223372036854775807\b|2147483647\b)/<32-bit or 64-bit MAX SIGNED>/ /^(?:18446744073709547520\b|4294963200\b)/<32-bit or 64-bit MAX UNSIGNED ADJUSTED>/ /^(?:9223372036853727232\b|2146435072\b)/<32-bit or 64-bit MAX SIGNED ADJUSTED>/

Aren't you removing too much with these replacements?
It's kinda good to get rid of 32bit diff files (as they aren't easy to
update), but I wouldn't replace every INT or BIGINT with <INT or BIGINT>.

May be, move them to a separate select, like

  let type=BIGINT;
  if (32-bit) {
    let type=INT;
  }
 --replace $type <INT-or-BIGINT>
 select * from information_schema.system_variables
     where variable_name in (list of ulong variables);

and something similar for other replacements.

In fact, there's obscure feature of

  let $repl=/foo/bar/ /abc/def;
  replace_regex $repl;

so you can have sysvar32bitrepl.inc that will set up $replace_regexes
variable:

  let type=BIGINT;
  let max=18446744073709551615;
  if (32-bit) {
    let type=INT;
    let max=4294967295;
  }
  let replace_regexes=/$type/INT or BIGINT/ /$max/<32-bit or 64-bit MAX UNSIGNED>/;

Then in every sysvar*.test file you can do, like

   --source sysvar32bitrepl
   --replace_regex $replace_regexes
   select * from information_schema.system_variables
       where variable_name in (list of ulong variables);

Regards,
Sergei


Follow ups