[Commits] Rev 2840: remove old hack in http://bazaar.launchpad.net/~maria-captains/maria/5.2/

serg at askmonty.org serg at askmonty.org
Sun Aug 29 15:18:48 EEST 2010


At http://bazaar.launchpad.net/~maria-captains/maria/5.2/

------------------------------------------------------------
revno: 2840
revision-id: sergii at pisem.net-20100829121844-6kiywpu29fcz29av
parent: sergii at pisem.net-20100828095750-onmtndl83d8ucwmo
committer: Sergei Golubchik <sergii at pisem.net>
branch nick: 5.2
timestamp: Sun 2010-08-29 14:18:44 +0200
message:
  remove old hack
-------------- next part --------------
=== modified file 'client/mysqltest.cc'
--- a/client/mysqltest.cc	2010-08-28 09:45:11 +0000
+++ b/client/mysqltest.cc	2010-08-29 12:18:44 +0000
@@ -130,9 +130,6 @@ static char delimiter[MAX_DELIMITER_LENG
 static uint delimiter_length= 1;
 
 static char TMPDIR[FN_REFLEN];
-static char global_subst_from[200];
-static char global_subst_to[200];
-static char *global_subst= NULL;
 
 /* Block stack */
 enum block_cmd {
@@ -1710,31 +1707,6 @@ int compare_files2(File fd1, const char*
   if (my_read(fd2, (uchar*) fd2_result.str, fd2_length, MYF(MY_WME | MY_NABP)))
     die("Error when reading data from result file");
 
-  if (global_subst &&
-      (fd1_length != fd2_length ||
-       memcmp(fd1_result.str, fd2_result.str, fd1_length)))
-  {
-    /**
-       @todo MARIA_HACK
-       This serves for when a test is run with --default-storage-engine=X
-       where X is not MyISAM: tests using SHOW CREATE TABLE will always fail
-       because SHOW CREATE TABLE prints X instead of MyISAM. With
-       --global-subst=X,MyISAM , such trivial differences are eliminated and
-       test may be reported as passing.
-       --global-subst is only a quick way to run a lot of existing tests
-       with Maria and find bugs; it is not good enough for reaching the main
-       trees when Maria is merged into them.
-         --global-subst should be removed.
-    */
-    uint global_subst_from_len= strlen(global_subst_from);
-    uint global_subst_to_len=   strlen(global_subst_to);
-    while (replace(&fd1_result,
-                   global_subst_from, global_subst_from_len,
-                   global_subst_to,   global_subst_to_len) == 0)
-      /* do nothing */ ;
-    /* let's compare again to see if it is ok now */
-  }
-
   if (fd1_result.length != fd2_result.length)
     error= RESULT_LENGTH_MISMATCH;
   else if ((memcmp(fd1_result.str, fd2_result.str, fd1_result.length)))
@@ -5910,11 +5882,6 @@ static struct my_option my_long_options[
   {"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.",
    &debug_info_flag, &debug_info_flag,
    0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
-  {"global-subst", OPT_GLOBAL_SUBST, "argument should be 'X,Y' ;"
-   " substitute string X with another Y accross the whole test's current"
-   " result before comparing with expected result file",
-   &global_subst, &global_subst, 0,
-   GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"host", 'h', "Connect to host.", &opt_host, &opt_host, 0,
    GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
   {"include", 'i', "Include SQL before each test case.", &opt_include,
@@ -6193,16 +6160,6 @@ int parse_args(int argc, char **argv)
   if (debug_check_flag)
     my_end_arg= MY_CHECK_ERROR;
 
-  if (global_subst != NULL)
-  {
-    char *comma= strstr(global_subst, ",");
-    if (comma == NULL)
-      die("wrong --global-subst, must be X,Y");
-    memcpy(global_subst_from, global_subst, (comma-global_subst));
-    global_subst_from[comma-global_subst]= 0;
-    memcpy(global_subst_to, comma+1, strlen(comma));
-  }
-
   if (!record)
   {
     /* Check that the result file exists */



More information about the commits mailing list