Skip to content
  • Pavan Naik's avatar
    d450ab5d
    WL#9711 : Remove *.require files · d450ab5d
    Pavan Naik authored
    
    
    Description :
    =============
    In MTR we have *.require files to perform checks. But these require
    files are not necessary to perform a check and adds an extra overhead.
    Instead of using require files, the check for the condition can be
    implemented in corresponding inc files.
    
    E.g:
    
    1) have_debug_sync.inc
    ----------------------
    require r/have_debug_sync.require;
    disable_query_log;
    let $value=query_get_value(SHOW VARIABLES LIKE 'debug_sync', Value, 1);
    eval SELECT ('$value' LIKE 'ON %') AS debug_sync;
    enable_query_log;
    
    2) have_debug_sync.require
    --------------------------
    debug_sync
    1
    
    The way this works is that '--require' causes the result of the next
    query to be written to a temporary file and then there is a file
    comparison of the temporary file and, in this case,
    have_debug_sync.require.
    
    This sounds much slower than it could be. And also there are issues on
    Windows where a test can fail simply because of line ending differences.
    
    This WL removes all these require files and implements the check in
    the corresponding inc file. If '--require' command is used in any of
    the test file/inc file, MTR will error out with a deprecation message.
    
    E.g:
    
    Modified have_debug_sync.inc
    ----------------------------
    let $have_debug_sync= query_get_value(SHOW VARIABLES LIKE 'debug_sync', Value, 1);
    if ($have_debug_sync == 'No such row')
    {
      skip Test requires 'have_debug_sync';
    }
    
    Reviewed-by: default avatarAnitha Gopi <anitha.gopi@oracle.com>
    Reviewed-by: default avatarDeepa Dixit <deepa.dixit@oracle.com>
    Reviewed-by: default avatarMagnus Blåudd <magnus.blaudd@oracle.com>
    RB: 14686
    d450ab5d
    WL#9711 : Remove *.require files
    Pavan Naik authored
    
    
    Description :
    =============
    In MTR we have *.require files to perform checks. But these require
    files are not necessary to perform a check and adds an extra overhead.
    Instead of using require files, the check for the condition can be
    implemented in corresponding inc files.
    
    E.g:
    
    1) have_debug_sync.inc
    ----------------------
    require r/have_debug_sync.require;
    disable_query_log;
    let $value=query_get_value(SHOW VARIABLES LIKE 'debug_sync', Value, 1);
    eval SELECT ('$value' LIKE 'ON %') AS debug_sync;
    enable_query_log;
    
    2) have_debug_sync.require
    --------------------------
    debug_sync
    1
    
    The way this works is that '--require' causes the result of the next
    query to be written to a temporary file and then there is a file
    comparison of the temporary file and, in this case,
    have_debug_sync.require.
    
    This sounds much slower than it could be. And also there are issues on
    Windows where a test can fail simply because of line ending differences.
    
    This WL removes all these require files and implements the check in
    the corresponding inc file. If '--require' command is used in any of
    the test file/inc file, MTR will error out with a deprecation message.
    
    E.g:
    
    Modified have_debug_sync.inc
    ----------------------------
    let $have_debug_sync= query_get_value(SHOW VARIABLES LIKE 'debug_sync', Value, 1);
    if ($have_debug_sync == 'No such row')
    {
      skip Test requires 'have_debug_sync';
    }
    
    Reviewed-by: default avatarAnitha Gopi <anitha.gopi@oracle.com>
    Reviewed-by: default avatarDeepa Dixit <deepa.dixit@oracle.com>
    Reviewed-by: default avatarMagnus Blåudd <magnus.blaudd@oracle.com>
    RB: 14686
Loading