Commit 8e760bc6 authored by msvensson@neptunus.(none)'s avatar msvensson@neptunus.(none)

Merge neptunus.(none):/home/msvensson/mysql/mysqltest_replace/my51-mysqltest_replace

into  neptunus.(none):/home/msvensson/mysql/mysql-5.1
parents 751d6258 40fca5ca
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
#define MAX_QUERY (256*1024) #define MAX_QUERY (256*1024)
#define MAX_VAR_NAME 256 #define MAX_VAR_NAME 256
#define MAX_COLUMNS 256 #define MAX_COLUMNS 256
#define PAD_SIZE 128
#define MAX_CONS 128 #define MAX_CONS 128
#define MAX_INCLUDE_DEPTH 16 #define MAX_INCLUDE_DEPTH 16
#define INIT_Q_LINES 1024 #define INIT_Q_LINES 1024
...@@ -309,18 +308,6 @@ typedef struct ...@@ -309,18 +308,6 @@ typedef struct
char *env_s; char *env_s;
} VAR; } VAR;
#if defined(__NETWARE__) || defined(__WIN__)
/*
Netware doesn't proved environment variable substitution that is done
by the shell in unix environments. We do this in the following function:
*/
static char *subst_env_var(const char *cmd);
static FILE *my_popen(const char *cmd, const char *mode);
#undef popen
#define popen(A,B) my_popen((A),(B))
#endif /* __NETWARE__ */
VAR var_reg[10]; VAR var_reg[10];
/*Perl/shell-like variable registers */ /*Perl/shell-like variable registers */
HASH var_hash; HASH var_hash;
...@@ -501,20 +488,20 @@ typedef struct st_pointer_array { /* when using array-strings */ ...@@ -501,20 +488,20 @@ typedef struct st_pointer_array { /* when using array-strings */
struct st_replace; struct st_replace;
struct st_replace *init_replace(my_string *from, my_string *to, uint count, struct st_replace *init_replace(my_string *from, my_string *to, uint count,
my_string word_end_chars); my_string word_end_chars);
uint replace_strings(struct st_replace *rep, my_string *start,
uint *max_length, const char *from);
void free_replace(); void free_replace();
static void free_replace_regex(); static void free_replace_regex();
static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name); static int insert_pointer_name(reg1 POINTER_ARRAY *pa,my_string name);
static void replace_strings_append(struct st_replace *rep, DYNAMIC_STRING* ds,
const char *from, int len);
void free_pointer_array(POINTER_ARRAY *pa); void free_pointer_array(POINTER_ARRAY *pa);
static int initialize_replace_buffer(void);
static void do_eval(DYNAMIC_STRING *query_eval, const char *query); static void do_eval(DYNAMIC_STRING *query_eval, const char *query);
static void str_to_file(const char *fname, char *str, int size); static void str_to_file(const char *fname, char *str, int size);
int do_server_op(struct st_query *q,const char *op);
#ifdef __WIN__
static void free_win_path_patterns();
#endif
struct st_replace *glob_replace; struct st_replace *glob_replace;
static char *out_buff;
static uint out_length;
static int eval_result = 0; static int eval_result = 0;
/* For column replace */ /* For column replace */
...@@ -542,7 +529,7 @@ static void handle_no_error(struct st_query *q); ...@@ -542,7 +529,7 @@ static void handle_no_error(struct st_query *q);
static void do_eval(DYNAMIC_STRING* query_eval, const char *query) static void do_eval(DYNAMIC_STRING* query_eval, const char *query)
{ {
const char *p; const char *p;
register char c; register char c, next_c;
register int escaped = 0; register int escaped = 0;
VAR* v; VAR* v;
DBUG_ENTER("do_eval"); DBUG_ENTER("do_eval");
...@@ -564,13 +551,19 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char *query) ...@@ -564,13 +551,19 @@ static void do_eval(DYNAMIC_STRING* query_eval, const char *query)
} }
break; break;
case '\\': case '\\':
next_c= *(p+1);
if (escaped) if (escaped)
{ {
escaped = 0; escaped = 0;
dynstr_append_mem(query_eval, p, 1); dynstr_append_mem(query_eval, p, 1);
} }
else else if (next_c == '\\' || next_c == '$')
{
/* Set escaped only if next char is \ or $ */
escaped = 1; escaped = 1;
}
else
dynstr_append_mem(query_eval, p, 1);
break; break;
default: default:
dynstr_append_mem(query_eval, p, 1); dynstr_append_mem(query_eval, p, 1);
...@@ -646,6 +639,9 @@ static void free_used_memory() ...@@ -646,6 +639,9 @@ static void free_used_memory()
free_defaults(default_argv); free_defaults(default_argv);
mysql_server_end(); mysql_server_end();
free_re(); free_re();
#ifdef __WIN__
free_win_path_patterns();
#endif
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -1031,17 +1027,7 @@ int do_require_manager(struct st_query *query __attribute__((unused)) ) ...@@ -1031,17 +1027,7 @@ int do_require_manager(struct st_query *query __attribute__((unused)) )
} }
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
int do_server_start(struct st_query *q) static int do_server_op(struct st_query *q, const char *op)
{
return do_server_op(q, "start");
}
int do_server_stop(struct st_query *q)
{
return do_server_op(q, "stop");
}
int do_server_op(struct st_query *q, const char *op)
{ {
char *p= q->first_argument; char *p= q->first_argument;
char com_buf[256], *com_p; char com_buf[256], *com_p;
...@@ -1071,6 +1057,17 @@ int do_server_op(struct st_query *q, const char *op) ...@@ -1071,6 +1057,17 @@ int do_server_op(struct st_query *q, const char *op)
q->last_argument= p; q->last_argument= p;
return 0; return 0;
} }
int do_server_start(struct st_query *q)
{
return do_server_op(q, "start");
}
int do_server_stop(struct st_query *q)
{
return do_server_op(q, "stop");
}
#endif #endif
...@@ -1124,16 +1121,21 @@ int do_source(struct st_query *query) ...@@ -1124,16 +1121,21 @@ int do_source(struct st_query *query)
expected error array, previously set with the --error command. expected error array, previously set with the --error command.
It can thus be used to execute a command that shall fail. It can thus be used to execute a command that shall fail.
NOTE
Although mysqltest is executed from cygwin shell, the command will be
executed in "cmd.exe". Thus commands like "rm" etc can NOT be used, use
system for those commands.
*/ */
static void do_exec(struct st_query *query) static void do_exec(struct st_query *query)
{ {
int error; int error;
DYNAMIC_STRING *ds= NULL;
char buf[1024]; char buf[1024];
FILE *res_file; FILE *res_file;
char *cmd= query->first_argument; char *cmd= query->first_argument;
DYNAMIC_STRING ds_cmd;
DBUG_ENTER("do_exec"); DBUG_ENTER("do_exec");
DBUG_PRINT("enter", ("cmd: '%s'", cmd));
while (*cmd && my_isspace(charset_info, *cmd)) while (*cmd && my_isspace(charset_info, *cmd))
cmd++; cmd++;
...@@ -1141,24 +1143,28 @@ static void do_exec(struct st_query *query) ...@@ -1141,24 +1143,28 @@ static void do_exec(struct st_query *query)
die("Missing argument in exec"); die("Missing argument in exec");
query->last_argument= query->end; query->last_argument= query->end;
DBUG_PRINT("info", ("Executing '%s'", cmd)); init_dynamic_string(&ds_cmd, 0, strlen(cmd)+256, 256);
/* Eval the command, thus replacing all environment variables */
do_eval(&ds_cmd, cmd);
cmd= ds_cmd.str;
DBUG_PRINT("info", ("Executing '%s' as '%s'",
query->first_argument, cmd));
if (!(res_file= popen(cmd, "r")) && query->abort_on_error) if (!(res_file= popen(cmd, "r")) && query->abort_on_error)
die("popen(\"%s\", \"r\") failed", cmd); die("popen(\"%s\", \"r\") failed", query->first_argument);
if (disable_result_log)
{
while (fgets(buf, sizeof(buf), res_file)) while (fgets(buf, sizeof(buf), res_file))
{
if (disable_result_log)
{ {
buf[strlen(buf)-1]=0; buf[strlen(buf)-1]=0;
DBUG_PRINT("exec_result",("%s", buf)); DBUG_PRINT("exec_result",("%s", buf));
} }
}
else else
{ {
ds= &ds_res; replace_dynstr_append(&ds_res, buf);
while (fgets(buf, sizeof(buf), res_file)) }
replace_dynstr_append(ds, buf);
} }
error= pclose(res_file); error= pclose(res_file);
if (error != 0) if (error != 0)
...@@ -1167,7 +1173,7 @@ static void do_exec(struct st_query *query) ...@@ -1167,7 +1173,7 @@ static void do_exec(struct st_query *query)
my_bool ok= 0; my_bool ok= 0;
if (query->abort_on_error) if (query->abort_on_error)
die("command \"%s\" failed", cmd); die("command \"%s\" failed", query->first_argument);
DBUG_PRINT("info", DBUG_PRINT("info",
("error: %d, status: %d", error, status)); ("error: %d, status: %d", error, status));
...@@ -1182,19 +1188,19 @@ static void do_exec(struct st_query *query) ...@@ -1182,19 +1188,19 @@ static void do_exec(struct st_query *query)
{ {
ok= 1; ok= 1;
DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d", DBUG_PRINT("info", ("command \"%s\" failed with expected error: %d",
cmd, status)); query->first_argument, status));
} }
} }
if (!ok) if (!ok)
die("command \"%s\" failed with wrong error: %d", die("command \"%s\" failed with wrong error: %d",
cmd, status); query->first_argument, status);
} }
else if (query->expected_errno[0].type == ERR_ERRNO && else if (query->expected_errno[0].type == ERR_ERRNO &&
query->expected_errno[0].code.errnum != 0) query->expected_errno[0].code.errnum != 0)
{ {
/* Error code we wanted was != 0, i.e. not an expected success */ /* Error code we wanted was != 0, i.e. not an expected success */
die("command \"%s\" succeeded - should have failed with errno %d...", die("command \"%s\" succeeded - should have failed with errno %d...",
cmd, query->expected_errno[0].code.errnum); query->first_argument, query->expected_errno[0].code.errnum);
} }
free_replace(); free_replace();
...@@ -1406,38 +1412,49 @@ int do_modify_var(struct st_query *query, const char *name, ...@@ -1406,38 +1412,49 @@ int do_modify_var(struct st_query *query, const char *name,
} }
int do_system(struct st_query *q) /*
SYNOPSIS
do_system
command called command
DESCRIPTION
system <command>
Eval the query to expand any $variables in the command.
Execute the command withe the "system" command.
NOTE
If mysqltest is executed from cygwin shell, the command will be
executed in cygwin shell. Thus commands like "rm" etc can be used.
*/
int do_system(struct st_query *command)
{ {
DYNAMIC_STRING *ds; DYNAMIC_STRING ds_cmd;
char *p=q->first_argument;
VAR v;
var_init(&v, 0, 0, 0, 0);
eval_expr(&v, p, 0); /* NULL terminated */
ds= &ds_res;
if (v.str_val_len) if (strlen(command->first_argument) == 0)
{ die("Missing arguments to system, nothing to do!");
char expr_buf[1024];
if ((uint)v.str_val_len > sizeof(expr_buf) - 1) init_dynamic_string(&ds_cmd, 0, strlen(command->first_argument) + 64, 256);
v.str_val_len = sizeof(expr_buf) - 1;
memcpy(expr_buf, v.str_val, v.str_val_len); /* Eval the system command, thus replacing all environment variables */
expr_buf[v.str_val_len] = 0; do_eval(&ds_cmd, command->first_argument);
DBUG_PRINT("info", ("running system command '%s'", expr_buf));
if (system(expr_buf)) DBUG_PRINT("info", ("running system command '%s' as '%s'",
command->first_argument, ds_cmd.str));
if (system(ds_cmd.str))
{ {
if (q->abort_on_error) if (command->abort_on_error)
die("system command '%s' failed", expr_buf); die("system command '%s' failed", command->first_argument);
/* If ! abort_on_error, log message and continue */ /* If ! abort_on_error, log message and continue */
dynstr_append(ds, "system command '"); dynstr_append(&ds_res, "system command '");
replace_dynstr_append(ds, expr_buf); replace_dynstr_append(&ds_res, command->first_argument);
dynstr_append(ds, "' failed\n"); dynstr_append(&ds_res, "' failed\n");
}
} }
else
die("Missing arguments to system, nothing to do!"); command->last_argument= command->end;
var_free(&v);
q->last_argument= q->end;
return 0; return 0;
} }
...@@ -2205,8 +2222,7 @@ static void get_replace(struct st_query *q) ...@@ -2205,8 +2222,7 @@ static void get_replace(struct st_query *q)
if (!(glob_replace=init_replace((char**) from_array.typelib.type_names, if (!(glob_replace=init_replace((char**) from_array.typelib.type_names,
(char**) to_array.typelib.type_names, (char**) to_array.typelib.type_names,
(uint) from_array.typelib.count, (uint) from_array.typelib.count,
word_end_chars)) || word_end_chars)))
initialize_replace_buffer())
die("Can't initialize replace from '%s'", q->query); die("Can't initialize replace from '%s'", q->query);
free_pointer_array(&from_array); free_pointer_array(&from_array);
free_pointer_array(&to_array); free_pointer_array(&to_array);
...@@ -2234,7 +2250,6 @@ void free_replace() ...@@ -2234,7 +2250,6 @@ void free_replace()
{ {
my_free((char*) glob_replace,MYF(0)); my_free((char*) glob_replace,MYF(0));
glob_replace=0; glob_replace=0;
my_free(out_buff,MYF(MY_WME));
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
...@@ -3624,34 +3639,136 @@ static int reg_replace(char** buf_p, int* buf_len_p, char *pattern, ...@@ -3624,34 +3639,136 @@ static int reg_replace(char** buf_p, int* buf_len_p, char *pattern,
} }
/* Append the string to ds, with optional replace */ #ifdef __WIN__
static void replace_dynstr_append_mem(DYNAMIC_STRING *ds, const char *val, DYNAMIC_ARRAY patterns;
int len)
/*
init_win_path_patterns
DESCRIPTION
Setup string patterns that will be used to detect filenames that
needs to be converted from Win to Unix format
*/
static void init_win_path_patterns()
{ {
if (glob_replace) /* List of string patterns to match in order to find paths */
const char* paths[] = { "$MYSQL_TEST_DIR", "./test/", 0 };
int num_paths= 2;
int i;
char* p;
DBUG_ENTER("init_win_path_patterns");
my_init_dynamic_array(&patterns, sizeof(const char*), 16, 16);
/* Loop through all paths in the array */
for (i= 0; i < num_paths; i++)
{ {
len=(int) replace_strings(glob_replace, &out_buff, &out_length, val); VAR* v;
if (len == -1) if (*(paths[i]) == '$')
die("Out of memory in replace"); {
val=out_buff; v= var_get(paths[i], 0, 0, 0);
p= my_strdup(v->str_val, MYF(MY_FAE));
}
else
p= my_strdup(paths[i], MYF(MY_FAE));
if (insert_dynamic(&patterns, (gptr) &p))
die(NullS);
DBUG_PRINT("info", ("p: %s", p));
while (*p)
{
if (*p == '/')
*p='\\';
p++;
} }
}
DBUG_VOID_RETURN;
}
static void free_win_path_patterns()
{
int i= 0;
for (i=0 ; i < patterns.elements ; i++)
{
const char** pattern= dynamic_element(&patterns, i, const char**);
my_free((gptr) *pattern, MYF(0));
}
delete_dynamic(&patterns);
}
/*
fix_win_paths
DESCRIPTION
Search the string 'val' for the patterns that are known to be
strings that contain filenames. Convert all \ to / in the
filenames that are found.
Ex:
val = 'Error "c:\mysql\mysql-test\var\test\t1.frm" didn't exist'
=> $MYSQL_TEST_DIR is found by strstr
=> all \ from c:\mysql\m... until next space is converted into /
*/
static void fix_win_paths(const char* val, int len)
{
uint i;
char *p;
DBUG_ENTER("fix_win_paths");
for (i= 0; i < patterns.elements; i++)
{
const char** pattern= dynamic_element(&patterns, i, const char**);
DBUG_PRINT("info", ("pattern: %s", *pattern));
/* Search for the path in string */
while ((p= strstr(val, *pattern)))
{
DBUG_PRINT("info", ("Found %s in val p: %s", *pattern, p));
while (*p && !my_isspace(charset_info, *p))
{
if (*p == '\\')
*p= '/';
p++;
}
DBUG_PRINT("info", ("Converted \\ to /, p: %s", p));
}
}
DBUG_PRINT("exit", (" val: %s, len: %d", val, len));
DBUG_VOID_RETURN;
}
#endif
/* Append the string to ds, with optional replace */
static void replace_dynstr_append_mem(DYNAMIC_STRING *ds,
const char *val, int len)
{
#ifdef __WIN__
fix_win_paths(val, len);
#endif
if (glob_replace_regex) if (glob_replace_regex)
{ {
if (!multi_reg_replace(glob_replace_regex,(char*)val)) if (!multi_reg_replace(glob_replace_regex, (char*)val))
{ {
val= glob_replace_regex->buf; val= glob_replace_regex->buf;
len= strlen(val); len= strlen(val);
} }
} }
if (glob_replace)
replace_strings_append(glob_replace, ds, val, len);
else
dynstr_append_mem(ds, val, len); dynstr_append_mem(ds, val, len);
} }
/* Append zero-terminated string to ds, with optional replace */ /* Append zero-terminated string to ds, with optional replace */
static void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val) static void replace_dynstr_append(DYNAMIC_STRING *ds, const char *val)
{ {
replace_dynstr_append_mem(ds, val, strlen(val)); replace_dynstr_append_mem(ds, val, strlen(val));
...@@ -4967,6 +5084,10 @@ int main(int argc, char **argv) ...@@ -4967,6 +5084,10 @@ int main(int argc, char **argv)
init_var_hash(&cur_con->mysql); init_var_hash(&cur_con->mysql);
#ifdef __WIN__
init_win_path_patterns();
#endif
/* /*
Initialize $mysql_errno with -1, so we can Initialize $mysql_errno with -1, so we can
- distinguish it from valid values ( >= 0 ) and - distinguish it from valid values ( >= 0 ) and
...@@ -6037,60 +6158,57 @@ static uint replace_len(my_string str) ...@@ -6037,60 +6158,57 @@ static uint replace_len(my_string str)
} }
/* Replace strings; Return length of result string */ /* Replace strings while appending to ds */
void replace_strings_append(REPLACE *rep, DYNAMIC_STRING* ds,
uint replace_strings(REPLACE *rep, my_string *start,uint *max_length, const char *str, int len)
const char *from)
{ {
reg1 REPLACE *rep_pos; reg1 REPLACE *rep_pos;
reg2 REPLACE_STRING *rep_str; reg2 REPLACE_STRING *rep_str;
my_string to,end,pos,new_str; const char *start, *from;
DBUG_ENTER("replace_strings_append");
end=(to= *start) + *max_length-1; start= from= str;
rep_pos=rep+1; rep_pos=rep+1;
for (;;) for (;;)
{ {
/* Loop through states */
DBUG_PRINT("info", ("Looping through states"));
while (!rep_pos->found) while (!rep_pos->found)
{ rep_pos= rep_pos->next[(uchar) *from++];
rep_pos= rep_pos->next[(uchar) *from];
if (to == end) /* Does this state contain a string to be replaced */
{
(*max_length)+=8192;
if (!(new_str=my_realloc(*start,*max_length,MYF(MY_WME))))
return (uint) -1;
to=new_str+(to - *start);
end=(*start=new_str)+ *max_length-1;
}
*to++= *from++;
}
if (!(rep_str = ((REPLACE_STRING*) rep_pos))->replace_string) if (!(rep_str = ((REPLACE_STRING*) rep_pos))->replace_string)
return (uint) (to - *start)-1;
to-=rep_str->to_offset;
for (pos=rep_str->replace_string; *pos ; pos++)
{ {
if (to == end) /* No match found */
{ dynstr_append_mem(ds, start, from - start - 1);
(*max_length)*=2; DBUG_PRINT("exit", ("Found no more string to replace, appended: %s", start));
if (!(new_str=my_realloc(*start,*max_length,MYF(MY_WME)))) DBUG_VOID_RETURN;
return (uint) -1;
to=new_str+(to - *start);
end=(*start=new_str)+ *max_length-1;
}
*to++= *pos;
} }
/* Found a string that needs to be replaced */
DBUG_PRINT("info", ("found: %d, to_offset: %d, from_offset: %d, string: %s",
rep_str->found, rep_str->to_offset,
rep_str->from_offset, rep_str->replace_string));
/* Append part of original string before replace string */
dynstr_append_mem(ds, start, (from - rep_str->to_offset) - start);
/* Append replace string */
dynstr_append_mem(ds, rep_str->replace_string,
strlen(rep_str->replace_string));
if (!*(from-=rep_str->from_offset) && rep_pos->found != 2) if (!*(from-=rep_str->from_offset) && rep_pos->found != 2)
return (uint) (to - *start); {
/* End of from string */
DBUG_PRINT("exit", ("Found end of from string"));
DBUG_VOID_RETURN;
}
DBUG_ASSERT(from <= str+len);
start= from;
rep_pos=rep; rep_pos=rep;
} }
} }
static int initialize_replace_buffer(void)
{
out_length=8192;
if (!(out_buff=my_malloc(out_length,MYF(MY_WME))))
return(1);
return 0;
}
/**************************************************************************** /****************************************************************************
Replace results for a column Replace results for a column
...@@ -6149,105 +6267,6 @@ static void get_replace_column(struct st_query *q) ...@@ -6149,105 +6267,6 @@ static void get_replace_column(struct st_query *q)
q->last_argument= q->end; q->last_argument= q->end;
} }
#if defined(__NETWARE__) || defined(__WIN__)
/*
Substitute environment variables with text.
SYNOPSIS
subst_env_var()
arg String that should be substitute
DESCRIPTION
This function takes a string as an input and replaces the
environment variables, that starts with '$' character, with it value.
NOTES
Return string must be freed with my_free()
RETURN
String with environment variables replaced.
*/
static char *subst_env_var(const char *str)
{
char *result;
char *pos;
result= pos= my_malloc(MAX_QUERY, MYF(MY_FAE));
while (*str)
{
/*
need this only when we want to provide the functionality of
escaping through \ 'backslash'
if ((result == pos && *str=='$') ||
(result != pos && *str=='$' && str[-1] !='\\'))
*/
if (*str == '$')
{
char env_var[256], *env_pos= env_var, *subst;
/* Search for end of environment variable */
for (str++;
*str && !isspace(*str) && *str != '\\' && *str != '/' &&
*str != '$';
str++)
*env_pos++= *str;
*env_pos= 0;
if (!(subst= getenv(env_var)))
{
my_free(result, MYF(0));
die("MYSQLTEST.NLM: Environment variable %s is not defined",
env_var);
}
/* get the string to be substitued for env_var */
pos= strmov(pos, subst);
/* Process delimiter in *str again */
}
else
*pos++= *str++;
}
*pos= 0;
return result;
}
/*
popen replacement for Netware
SYNPOSIS
my_popen()
name Command to execute (with possible env variables)
mode Mode for popen.
NOTES
Environment variable expansion does not take place for popen function
on NetWare, so we use this function to wrap around popen to do this.
For the moment we ignore 'mode' and always use 'r0'
RETURN
# >= 0 File handle
-1 Error
*/
#undef popen /* Remove wrapper */
#ifdef __WIN__
#define popen _popen /* redefine for windows */
#endif
FILE *my_popen(const char *cmd, const char *mode __attribute__((unused)))
{
char *subst_cmd;
FILE *res_file;
subst_cmd= subst_env_var(cmd);
res_file= popen(subst_cmd, "r0");
my_free(subst_cmd, MYF(0));
return res_file;
}
#endif /* __NETWARE__ or __WIN__*/
...@@ -211,7 +211,7 @@ typedef uint rf_SetTimer; ...@@ -211,7 +211,7 @@ typedef uint rf_SetTimer;
#define my_sigset(A,B) signal((A),(B)) #define my_sigset(A,B) signal((A),(B))
#define finite(A) _finite(A) #define finite(A) _finite(A)
#define sleep(A) Sleep((A)*1000) #define sleep(A) Sleep((A)*1000)
#define popen(A) popen(A,B) _popen((A),(B)) #define popen(A,B) _popen((A),(B))
#define pclose(A) _pclose(A) #define pclose(A) _pclose(A)
#ifndef __BORLANDC__ #ifndef __BORLANDC__
......
...@@ -162,6 +162,7 @@ our $path_slave_load_tmpdir; # What is this?! ...@@ -162,6 +162,7 @@ our $path_slave_load_tmpdir; # What is this?!
our $path_mysqltest_log; our $path_mysqltest_log;
our $path_my_basedir; our $path_my_basedir;
our $opt_vardir; # A path but set directly on cmd line our $opt_vardir; # A path but set directly on cmd line
our $opt_vardir_trace; # unix formatted opt_vardir for trace files
our $opt_tmpdir; # A path but set directly on cmd line our $opt_tmpdir; # A path but set directly on cmd line
our $opt_restart_cleanup; # Source a file with SQL drop statements our $opt_restart_cleanup; # Source a file with SQL drop statements
...@@ -692,7 +693,7 @@ sub command_line_setup () { ...@@ -692,7 +693,7 @@ sub command_line_setup () {
{ {
$opt_vardir= "$glob_mysql_test_dir/var"; $opt_vardir= "$glob_mysql_test_dir/var";
} }
$opt_vardir_trace= $opt_vardir;
# We make the path absolute, as the server will do a chdir() before usage # We make the path absolute, as the server will do a chdir() before usage
unless ( $opt_vardir =~ m,^/, or unless ( $opt_vardir =~ m,^/, or
($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) ) ($glob_win32 and $opt_vardir =~ m,^[a-z]:/,i) )
...@@ -981,7 +982,8 @@ sub executable_setup () { ...@@ -981,7 +982,8 @@ sub executable_setup () {
if ( $glob_win32 ) if ( $glob_win32 )
{ {
$path_client_bindir= mtr_path_exists("$glob_basedir/client_release", $path_client_bindir= mtr_path_exists("$glob_basedir/client_release",
"$glob_basedir/bin"); "$glob_basedir/client_debug",
"$glob_basedir/bin",);
$exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-max", $exe_mysqld= mtr_exe_exists ("$path_client_bindir/mysqld-max",
"$path_client_bindir/mysqld-nt", "$path_client_bindir/mysqld-nt",
"$path_client_bindir/mysqld", "$path_client_bindir/mysqld",
...@@ -1031,6 +1033,7 @@ sub executable_setup () { ...@@ -1031,6 +1033,7 @@ sub executable_setup () {
} }
$exe_mysql_client_test= $exe_mysql_client_test=
mtr_exe_exists("$glob_basedir/tests/mysql_client_test", mtr_exe_exists("$glob_basedir/tests/mysql_client_test",
"$path_client_bindir/mysql_client_test",
"/usr/bin/false"); "/usr/bin/false");
} }
$exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck"); $exe_mysqlcheck= mtr_exe_exists("$path_client_bindir/mysqlcheck");
...@@ -1143,9 +1146,7 @@ sub environment_setup () { ...@@ -1143,9 +1146,7 @@ sub environment_setup () {
$ENV{'LC_COLLATE'}= "C"; $ENV{'LC_COLLATE'}= "C";
$ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server; $ENV{'USE_RUNNING_SERVER'}= $glob_use_running_server;
$ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir; $ENV{'MYSQL_TEST_DIR'}= $glob_mysql_test_dir;
$ENV{'MYSQL_TEST_WINDIR'}= $glob_mysql_test_dir;
$ENV{'MYSQLTEST_VARDIR'}= $opt_vardir; $ENV{'MYSQLTEST_VARDIR'}= $opt_vardir;
$ENV{'MASTER_WINMYSOCK'}= $master->[0]->{'path_mysock'};
$ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'}; $ENV{'MASTER_MYSOCK'}= $master->[0]->{'path_mysock'};
$ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'}; $ENV{'MASTER_MYSOCK1'}= $master->[1]->{'path_mysock'};
$ENV{'MASTER_MYPORT'}= $master->[0]->{'path_myport'}; $ENV{'MASTER_MYPORT'}= $master->[0]->{'path_myport'};
...@@ -1169,16 +1170,6 @@ sub environment_setup () { ...@@ -1169,16 +1170,6 @@ sub environment_setup () {
$ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port}; $ENV{'IM_MYSQLD2_PORT'}= $instance_manager->{instances}->[1]->{port};
$ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid}; $ENV{'IM_MYSQLD2_PATH_PID'}=$instance_manager->{instances}->[1]->{path_pid};
if ( $glob_cygwin_perl )
{
foreach my $key ('MYSQL_TEST_WINDIR','MASTER_MYSOCK')
{
$ENV{$key}= `cygpath -w $ENV{$key}`;
$ENV{$key} =~ s,\\,\\\\,g;
chomp($ENV{$key});
}
}
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set $ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
# We are nice and report a bit about our settings # We are nice and report a bit about our settings
...@@ -2490,12 +2481,12 @@ sub mysqld_arguments ($$$$$$) { ...@@ -2490,12 +2481,12 @@ sub mysqld_arguments ($$$$$$) {
if ( $type eq 'master' ) if ( $type eq 'master' )
{ {
mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/master%s.trace", mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/master%s.trace",
$prefix, $opt_vardir, $sidx); $prefix, $opt_vardir_trace, $sidx);
} }
if ( $type eq 'slave' ) if ( $type eq 'slave' )
{ {
mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/slave%s.trace", mtr_add_arg($args, "%s--debug=d:t:i:A,%s/log/slave%s.trace",
$prefix, $opt_vardir, $sidx); $prefix, $opt_vardir_trace, $sidx);
} }
} }
...@@ -2876,7 +2867,7 @@ sub run_mysqltest ($) { ...@@ -2876,7 +2867,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
$cmdline_mysqlcheck .= $cmdline_mysqlcheck .=
" --debug=d:t:A,$opt_vardir/log/mysqldump.trace"; " --debug=d:t:A,$opt_vardir_trace/log/mysqldump.trace";
} }
my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " . my $cmdline_mysqldump= "$exe_mysqldump --no-defaults -uroot " .
...@@ -2889,7 +2880,7 @@ sub run_mysqltest ($) { ...@@ -2889,7 +2880,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
$cmdline_mysqldump .= $cmdline_mysqldump .=
" --debug=d:t:A,$opt_vardir/log/mysqldump.trace"; " --debug=d:t:A,$opt_vardir_trace/log/mysqldump.trace";
} }
my $cmdline_mysqlslap; my $cmdline_mysqlslap;
...@@ -2903,7 +2894,7 @@ sub run_mysqltest ($) { ...@@ -2903,7 +2894,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
$cmdline_mysqlslap .= $cmdline_mysqlslap .=
" --debug=d:t:A,$opt_vardir/log/mysqldump.trace"; " --debug=d:t:A,$opt_vardir_trace/log/mysqldump.trace";
} }
} }
...@@ -2913,7 +2904,7 @@ sub run_mysqltest ($) { ...@@ -2913,7 +2904,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
$cmdline_mysqlimport .= $cmdline_mysqlimport .=
" --debug=d:t:A,$opt_vardir/log/mysqlimport.trace"; " --debug=d:t:A,$opt_vardir_trace/log/mysqlimport.trace";
} }
my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " . my $cmdline_mysqlshow= "$exe_mysqlshow -uroot " .
...@@ -2922,7 +2913,7 @@ sub run_mysqltest ($) { ...@@ -2922,7 +2913,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
$cmdline_mysqlshow .= $cmdline_mysqlshow .=
" --debug=d:t:A,$opt_vardir/log/mysqlshow.trace"; " --debug=d:t:A,$opt_vardir_trace/log/mysqlshow.trace";
} }
my $cmdline_mysqlbinlog= my $cmdline_mysqlbinlog=
...@@ -2933,7 +2924,7 @@ sub run_mysqltest ($) { ...@@ -2933,7 +2924,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
$cmdline_mysqlbinlog .= $cmdline_mysqlbinlog .=
" --debug=d:t:A,$opt_vardir/log/mysqlbinlog.trace"; " --debug=d:t:A,$opt_vardir_trace/log/mysqlbinlog.trace";
} }
my $cmdline_mysql= my $cmdline_mysql=
...@@ -3075,7 +3066,7 @@ sub run_mysqltest ($) { ...@@ -3075,7 +3066,7 @@ sub run_mysqltest ($) {
if ( $opt_debug ) if ( $opt_debug )
{ {
mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir); mtr_add_arg($args, "--debug=d:t:A,%s/log/mysqltest.trace", $opt_vardir_trace);
} }
if ( $opt_ssl_supported ) if ( $opt_ssl_supported )
......
...@@ -2399,10 +2399,10 @@ drop table t1; ...@@ -2399,10 +2399,10 @@ drop table t1;
set global time_zone=default; set global time_zone=default;
set time_zone=default; set time_zone=default;
DROP TABLE IF EXISTS `t1 test`; DROP TABLE IF EXISTS `t1 test`;
DROP TABLE IF EXISTS `t2 test`;
CREATE TABLE `t1 test` ( CREATE TABLE `t1 test` (
`a1` int(11) default NULL `a1` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `t2 test`;
CREATE TABLE `t2 test` ( CREATE TABLE `t2 test` (
`a2` int(11) default NULL `a2` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
......
...@@ -539,7 +539,7 @@ drop procedure if exists into_outfile| ...@@ -539,7 +539,7 @@ drop procedure if exists into_outfile|
create procedure into_outfile(x char(16), y int) create procedure into_outfile(x char(16), y int)
begin begin
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
select * into outfile "/tmp/spout" from test.t1; select * into outfile "../tmp/spout" from test.t1;
insert into test.t1 values (concat(x, "2"), y+2); insert into test.t1 values (concat(x, "2"), y+2);
end| end|
call into_outfile("ofile", 1)| call into_outfile("ofile", 1)|
...@@ -549,7 +549,7 @@ drop procedure if exists into_dumpfile| ...@@ -549,7 +549,7 @@ drop procedure if exists into_dumpfile|
create procedure into_dumpfile(x char(16), y int) create procedure into_dumpfile(x char(16), y int)
begin begin
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
select * into dumpfile "/tmp/spdump" from test.t1 limit 1; select * into dumpfile "../tmp/spdump" from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2); insert into test.t1 values (concat(x, "2"), y+2);
end| end|
call into_dumpfile("dfile", 1)| call into_dumpfile("dfile", 1)|
......
...@@ -9,13 +9,13 @@ create table t1 ( ...@@ -9,13 +9,13 @@ create table t1 (
`a>b` text `a>b` text
); );
insert into t1 values (1, 2, 'a&b a<b a>b'); insert into t1 values (1, 2, 'a&b a<b a>b');
--exec $MYSQL --xml test -e 'select * from t1' --exec $MYSQL --xml test -e "select * from t1"
--exec $MYSQL_DUMP --xml --skip-create test --exec $MYSQL_DUMP --xml --skip-create test
--exec $MYSQL --xml test -e 'select count(*) from t1' --exec $MYSQL --xml test -e "select count(*) from t1"
--exec $MYSQL --xml test -e 'select 1 < 2 from dual' --exec $MYSQL --xml test -e "select 1 < 2 from dual"
--exec $MYSQL --xml test -e 'select 1 > 2 from dual' --exec $MYSQL --xml test -e "select 1 > 2 from dual"
--exec $MYSQL --xml test -e 'select 1 & 3 from dual' --exec $MYSQL --xml test -e "select 1 & 3 from dual"
--exec $MYSQL --xml test -e 'select null from dual' --exec $MYSQL --xml test -e "select null from dual"
drop table t1; drop table t1;
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
# var/log/mysql_client_test.trace # var/log/mysql_client_test.trace
--disable_result_log --disable_result_log
--exec echo $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
--exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M --exec $MYSQL_CLIENT_TEST --getopt-ll-test=25600M
# End of 4.1 tests # End of 4.1 tests
......
...@@ -647,7 +647,7 @@ select '------ Testing with illegal table names ------' as test_sequence ; ...@@ -647,7 +647,7 @@ select '------ Testing with illegal table names ------' as test_sequence ;
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\t1" 2>&1
--error 6 --error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\t1" 2>&1 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "\\\\\\t1" 2>&1
--error 6 --error 6
--exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1 --exec $MYSQL_DUMP --compact --skip-comments mysqldump_test_db "t\1" 2>&1
...@@ -840,11 +840,11 @@ DROP TABLE t1, t2; ...@@ -840,11 +840,11 @@ DROP TABLE t1, t2;
# Bugs #9136, #12917: problems with --defaults-extra-file option # Bugs #9136, #12917: problems with --defaults-extra-file option
# #
--exec echo "[mysqltest1]" > $MYSQLTEST_VARDIR/tmp/tmp.cnf --system echo "[mysqltest1]" > $MYSQLTEST_VARDIR/tmp/tmp.cnf
--exec echo "port=1234" >> $MYSQLTEST_VARDIR/tmp/tmp.cnf --system echo "port=1234" >> $MYSQLTEST_VARDIR/tmp/tmp.cnf
--exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 --exec $MYSQL_MY_PRINT_DEFAULTS -c $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1
--exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1 --exec $MYSQL_MY_PRINT_DEFAULTS -e $MYSQLTEST_VARDIR/tmp/tmp.cnf mysqltest1 mysqltest1
--exec rm $MYSQLTEST_VARDIR/tmp/tmp.cnf --system rm $MYSQLTEST_VARDIR/tmp/tmp.cnf
# #
# Test of fix to BUG 12597 # Test of fix to BUG 12597
...@@ -960,15 +960,16 @@ set time_zone=default; ...@@ -960,15 +960,16 @@ set time_zone=default;
# #
--disable_warnings --disable_warnings
DROP TABLE IF EXISTS `t1 test`; DROP TABLE IF EXISTS `t1 test`;
DROP TABLE IF EXISTS `t2 test`;
--enable_warnings
CREATE TABLE `t1 test` ( CREATE TABLE `t1 test` (
`a1` int(11) default NULL `a1` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `t2 test`;
CREATE TABLE `t2 test` ( CREATE TABLE `t2 test` (
`a2` int(11) default NULL `a2` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1; ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--enable_warnings
DELIMITER //; DELIMITER //;
CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN CREATE TRIGGER `test trig` BEFORE INSERT ON `t1 test` FOR EACH ROW BEGIN
...@@ -983,11 +984,10 @@ SELECT * FROM `t2 test`; ...@@ -983,11 +984,10 @@ SELECT * FROM `t2 test`;
# quoted # quoted
--exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test --exec $MYSQL_DUMP --skip-comments --compatible=ansi --triggers test
--disable_warnings
DROP TRIGGER `test trig`; DROP TRIGGER `test trig`;
DROP TABLE `t1 test`; DROP TABLE `t1 test`;
DROP TABLE `t2 test`; DROP TABLE `t2 test`;
--enable_warnings
# #
# BUG# 12838 mysqldump -x with views exits with error # BUG# 12838 mysqldump -x with views exits with error
# #
......
...@@ -431,7 +431,7 @@ echo ; ...@@ -431,7 +431,7 @@ echo ;
# Illegal use of echo # Illegal use of echo
--error 1 --error 1
--exec echo "echo $;" | $MYSQL_TEST 2>&1 --exec echo "echo \$;" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -518,19 +518,19 @@ echo $novar1; ...@@ -518,19 +518,19 @@ echo $novar1;
--exec echo "let ;" | $MYSQL_TEST 2>&1 --exec echo "let ;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $=hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$=hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $1 hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$1 hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $m hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$m hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let $ hi;" | $MYSQL_TEST 2>&1 --exec echo "let \$ hi;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let =hi;" | $MYSQL_TEST 2>&1 --exec echo "let =hi;" | $MYSQL_TEST 2>&1
...@@ -690,7 +690,7 @@ echo $i; ...@@ -690,7 +690,7 @@ echo $i;
--error 1 --error 1
--exec echo "inc i;" | $MYSQL_TEST 2>&1 --exec echo "inc i;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let \$i=100; inc \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1 --exec echo "let \\\$i=100; inc \\\$i 1000; echo \\\$i;" | $MYSQL_TEST 2>&1
inc $i; inc $i; inc $i; --echo $i inc $i; inc $i; inc $i; --echo $i
echo $i; echo $i;
...@@ -718,7 +718,7 @@ echo $d; ...@@ -718,7 +718,7 @@ echo $d;
--error 1 --error 1
--exec echo "dec i;" | $MYSQL_TEST 2>&1 --exec echo "dec i;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let \$i=100; dec \$i 1000; echo \$i;" | $MYSQL_TEST 2>&1 --exec echo "let \\\$i=100; dec \\\$i 1000; echo \\\$i;" | $MYSQL_TEST 2>&1
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
...@@ -802,11 +802,11 @@ while (!$i) ...@@ -802,11 +802,11 @@ while (!$i)
--error 1 --error 1
--exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1 --exec echo "source include/mysqltest_while.inc;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "while \$i;" | $MYSQL_TEST 2>&1 --exec echo "while \\\$i;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "while (\$i;" | $MYSQL_TEST 2>&1 --exec echo "while (\\\$i;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "let \$i=1; while (\$i) dec \$i;" | $MYSQL_TEST 2>&1 --exec echo "let \\\$i=1; while (\\\$i) dec \\\$i;" | $MYSQL_TEST 2>&1
--error 1 --error 1
--exec echo "};" | $MYSQL_TEST 2>&1 --exec echo "};" | $MYSQL_TEST 2>&1
--error 1 --error 1
...@@ -918,22 +918,22 @@ select "a" as col1, "c" as col2; ...@@ -918,22 +918,22 @@ select "a" as col1, "c" as col2;
--exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1 --exec echo "connect (con1,localhost,root,,,,,SMTP POP);" | $MYSQL_TEST 2>&1
# Repeat connect/disconnect # Repeat connect/disconnect
--exec echo "let \$i=100;" > $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "let \\\$i=100;" > $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "while (\$i)" >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "while (\\\$i)" >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "{" >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "{" >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo " dec \$i; " >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo " dec \\\$i; " >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "}" >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "}" >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql; echo OK;" | $MYSQL_TEST 2>&1 --exec echo "source $MYSQLTEST_VARDIR/tmp/con.sql; echo OK;" | $MYSQL_TEST 2>&1
# Repeat connect/disconnect, exceed max number of connections # Repeat connect/disconnect, exceed max number of connections
--exec echo "let \$i=200;" > $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "let \\\$i=200;" > $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "while (\$i)" >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "while (\\\$i)" >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "{" >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "{" >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo " connect (test_con1,localhost,root,,); " >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo " disconnect test_con1; " >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo " dec \$i; " >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo " dec \\\$i; " >> $MYSQLTEST_VARDIR/tmp/con.sql
--exec echo "}" >> $MYSQLTEST_VARDIR/tmp/con.sql --exec echo "}" >> $MYSQLTEST_VARDIR/tmp/con.sql
--replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR --replace_result $MYSQLTEST_VARDIR MYSQLTEST_VARDIR
--error 1 --error 1
...@@ -1051,7 +1051,7 @@ select "this will be executed"; ...@@ -1051,7 +1051,7 @@ select "this will be executed";
# #
# Test that a test file that does not generate any output fails. # Test that a test file that does not generate any output fails.
# #
--exec echo "let \$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql --exec echo "let \\\$i= 1;" > $MYSQLTEST_VARDIR/tmp/query.sql
--error 1 --error 1
--exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql 2>&1 --exec $MYSQL_TEST -x $MYSQLTEST_VARDIR/tmp/query.sql 2>&1
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults -r \\\n -f " " --query=nodeid,host,DataMemory,IndexMemory --type=ndbd 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=nodeid --type=ndbd --host=localhost 2> /dev/null
--exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null --exec $NDB_TOOLS_DIR/ndb_config --no-defaults --query=type,nodeid,host --config-file=$NDB_BACKUP_DIR/config.ini 2> /dev/null
......
...@@ -18,7 +18,7 @@ show slave status; ...@@ -18,7 +18,7 @@ show slave status;
change master to master_host='127.0.0.1'; change master to master_host='127.0.0.1';
# The following needs to be cleaned up when change master is fixed # The following needs to be cleaned up when change master is fixed
--replace_result $MASTER_MYPORT MASTER_PORT $MYSQL_TCP_PORT MASTER_PORT --replace_result $MYSQL_TCP_PORT MASTER_PORT
--replace_column 1 # 8 # 9 # 23 # 33 # --replace_column 1 # 8 # 9 # 23 # 33 #
show slave status; show slave status;
--replace_result $MASTER_MYPORT MASTER_PORT --replace_result $MASTER_MYPORT MASTER_PORT
......
...@@ -702,13 +702,13 @@ drop procedure if exists into_outfile| ...@@ -702,13 +702,13 @@ drop procedure if exists into_outfile|
create procedure into_outfile(x char(16), y int) create procedure into_outfile(x char(16), y int)
begin begin
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
select * into outfile "/tmp/spout" from test.t1; select * into outfile "../tmp/spout" from test.t1;
insert into test.t1 values (concat(x, "2"), y+2); insert into test.t1 values (concat(x, "2"), y+2);
end| end|
system rm -f /tmp/spout| --system rm -f $MYSQLTEST_VARDIR/tmp/spout
call into_outfile("ofile", 1)| call into_outfile("ofile", 1)|
system rm -f /tmp/spout| --system rm -f $MYSQLTEST_VARDIR/tmp/spout
delete from t1| delete from t1|
drop procedure into_outfile| drop procedure into_outfile|
...@@ -718,13 +718,13 @@ drop procedure if exists into_dumpfile| ...@@ -718,13 +718,13 @@ drop procedure if exists into_dumpfile|
create procedure into_dumpfile(x char(16), y int) create procedure into_dumpfile(x char(16), y int)
begin begin
insert into test.t1 values (x, y); insert into test.t1 values (x, y);
select * into dumpfile "/tmp/spdump" from test.t1 limit 1; select * into dumpfile "../tmp/spdump" from test.t1 limit 1;
insert into test.t1 values (concat(x, "2"), y+2); insert into test.t1 values (concat(x, "2"), y+2);
end| end|
system rm -f /tmp/spdump| --system rm -f $MYSQLTEST_VARDIR/tmp/spdump
call into_dumpfile("dfile", 1)| call into_dumpfile("dfile", 1)|
system rm -f /tmp/spdump| --system rm -f $MYSQLTEST_VARDIR/tmp/spdump
delete from t1| delete from t1|
drop procedure into_dumpfile| drop procedure into_dumpfile|
......
...@@ -81,7 +81,8 @@ engine=MyISAM; ...@@ -81,7 +81,8 @@ engine=MyISAM;
INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y'); INSERT INTO user VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y');
INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N'); INSERT INTO user VALUES ('localhost','', '','N','N','N','N','N','N','N','N','N');
-- exec $MYSQL_FIX_SYSTEM_TABLES --database=test # Call the "shell script" $MYSQL_FIX_SYSTEM_TABLES using system
-- system $MYSQL_FIX_SYSTEM_TABLES --database=test > /dev/null
-- enable_query_log -- enable_query_log
-- enable_result_log -- enable_result_log
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment