Commit 0f039ff2 authored by unknown's avatar unknown

Merge bk-internal:/home/bk/mysql-5.0-maint

into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
parents 133bf1fd 8f7cbb2d
...@@ -276,7 +276,7 @@ enum enum_commands { ...@@ -276,7 +276,7 @@ enum enum_commands {
Q_IF, Q_IF,
Q_DISABLE_PARSING, Q_ENABLE_PARSING, Q_DISABLE_PARSING, Q_ENABLE_PARSING,
Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST, Q_REPLACE_REGEX, Q_REMOVE_FILE, Q_FILE_EXIST,
Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_WRITE_FILE, Q_COPY_FILE, Q_PERL, Q_DIE, Q_EXIT, Q_SKIP,
Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES, Q_CHMOD_FILE, Q_APPEND_FILE, Q_CAT_FILE, Q_DIFF_FILES,
Q_UNKNOWN, /* Unknown command. */ Q_UNKNOWN, /* Unknown command. */
...@@ -359,6 +359,7 @@ const char *command_names[]= ...@@ -359,6 +359,7 @@ const char *command_names[]=
/* Don't execute any more commands, compare result */ /* Don't execute any more commands, compare result */
"exit", "exit",
"skip",
"chmod", "chmod",
"append_file", "append_file",
"cat_file", "cat_file",
...@@ -809,27 +810,65 @@ void free_used_memory() ...@@ -809,27 +810,65 @@ void free_used_memory()
} }
static void cleanup_and_exit(int exit_code)
{
free_used_memory();
my_end(MY_CHECK_ERROR);
if (!silent)
{
switch (exit_code)
{
case 1:
printf("not ok\n");
break;
case 0:
printf("ok\n");
break;
case 62:
printf("skipped\n");
break;
default:
printf("unknown exit code: %d\n", exit_code);
DBUG_ASSERT(0);
}
}
exit(exit_code);
}
void die(const char *fmt, ...) void die(const char *fmt, ...)
{ {
static int dying= 0;
va_list args; va_list args;
DBUG_ENTER("die"); DBUG_ENTER("die");
DBUG_PRINT("enter", ("start_lineno: %d", start_lineno)); DBUG_PRINT("enter", ("start_lineno: %d", start_lineno));
/*
Protect against dying twice
first time 'die' is called, try to write log files
second time, just exit
*/
if (dying)
cleanup_and_exit(1);
/* Print the error message */ /* Print the error message */
va_start(args, fmt); fprintf(stderr, "mysqltest: ");
if (cur_file && cur_file != file_stack)
fprintf(stderr, "In included file \"%s\": ",
cur_file->file_name);
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
if (fmt) if (fmt)
{ {
fprintf(stderr, "mysqltest: "); va_start(args, fmt);
if (cur_file && cur_file != file_stack)
fprintf(stderr, "In included file \"%s\": ",
cur_file->file_name);
if (start_lineno > 0)
fprintf(stderr, "At line %u: ", start_lineno);
vfprintf(stderr, fmt, args); vfprintf(stderr, fmt, args);
fprintf(stderr, "\n"); va_end(args);
fflush(stderr);
} }
va_end(args); else
fprintf(stderr, "unknown error");
fprintf(stderr, "\n");
fflush(stderr);
/* Dump the result that has been accumulated so far to .log file */ /* Dump the result that has been accumulated so far to .log file */
if (result_file_name && ds_res.length) if (result_file_name && ds_res.length)
...@@ -839,14 +878,7 @@ void die(const char *fmt, ...) ...@@ -839,14 +878,7 @@ void die(const char *fmt, ...)
if (result_file_name && ds_warning_messages.length) if (result_file_name && ds_warning_messages.length)
dump_warning_messages(); dump_warning_messages();
/* Clean up and exit */ cleanup_and_exit(1);
free_used_memory();
my_end(MY_CHECK_ERROR);
if (!silent)
printf("not ok\n");
exit(1);
} }
...@@ -879,14 +911,7 @@ void abort_not_supported_test(const char *fmt, ...) ...@@ -879,14 +911,7 @@ void abort_not_supported_test(const char *fmt, ...)
} }
va_end(args); va_end(args);
/* Clean up and exit */ cleanup_and_exit(62);
free_used_memory();
my_end(MY_CHECK_ERROR);
if (!silent)
printf("skipped\n");
exit(62);
} }
...@@ -1346,6 +1371,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end) ...@@ -1346,6 +1371,7 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
MYSQL_RES *res; MYSQL_RES *res;
MYSQL_ROW row; MYSQL_ROW row;
MYSQL* mysql = &cur_con->mysql; MYSQL* mysql = &cur_con->mysql;
DYNAMIC_STRING ds_query;
DBUG_ENTER("var_query_set"); DBUG_ENTER("var_query_set");
LINT_INIT(res); LINT_INIT(res);
...@@ -1355,13 +1381,17 @@ void var_query_set(VAR *var, const char *query, const char** query_end) ...@@ -1355,13 +1381,17 @@ void var_query_set(VAR *var, const char *query, const char** query_end)
die("Syntax error in query, missing '`'"); die("Syntax error in query, missing '`'");
++query; ++query;
if (mysql_real_query(mysql, query, (int)(end - query)) || /* Eval the query, thus replacing all environment variables */
init_dynamic_string(&ds_query, 0, (end - query) + 32, 256);
do_eval(&ds_query, query, end, FALSE);
if (mysql_real_query(mysql, ds_query.str, ds_query.length) ||
!(res = mysql_store_result(mysql))) !(res = mysql_store_result(mysql)))
{ {
*end = 0; die("Error running query '%s': %d %s", ds_query.str,
die("Error running query '%s': %d %s", query,
mysql_errno(mysql), mysql_error(mysql)); mysql_errno(mysql), mysql_error(mysql));
} }
dynstr_free(&ds_query);
if ((row = mysql_fetch_row(res)) && row[0]) if ((row = mysql_fetch_row(res)) && row[0])
{ {
...@@ -6277,6 +6307,9 @@ int main(int argc, char **argv) ...@@ -6277,6 +6307,9 @@ int main(int argc, char **argv)
/* Stop processing any more commands */ /* Stop processing any more commands */
abort_flag= 1; abort_flag= 1;
break; break;
case Q_SKIP:
abort_not_supported_test("%s", command->first_argument);
break;
case Q_RESULT: case Q_RESULT:
die("result, deprecated command"); die("result, deprecated command");
...@@ -6388,14 +6421,9 @@ int main(int argc, char **argv) ...@@ -6388,14 +6421,9 @@ int main(int argc, char **argv)
dump_warning_messages(); dump_warning_messages();
timer_output(); timer_output();
free_used_memory();
my_end(MY_CHECK_ERROR);
/* Yes, if we got this far the test has suceeded! Sakila smiles */ /* Yes, if we got this far the test has suceeded! Sakila smiles */
if (!silent) cleanup_and_exit(0);
printf("ok\n"); return 0; /* Keep compiler happy too */
exit(0);
return 0; /* Keep compiler happy */
} }
......
...@@ -295,6 +295,18 @@ sub mtr_report_stats ($) { ...@@ -295,6 +295,18 @@ sub mtr_report_stats ($) {
} }
} }
} }
if ( $::opt_check_testcases )
{
# Look for warnings produced by mysqltest in testname.warnings
foreach my $test_warning_file
( glob("$::glob_mysql_test_dir/r/*.warnings") )
{
$found_problems= 1;
print WARN "Check myqltest warnings in $test_warning_file\n";
}
}
if ( $found_problems ) if ( $found_problems )
{ {
mtr_warning("Got errors/warnings while running tests, please examine", mtr_warning("Got errors/warnings while running tests, please examine",
......
...@@ -724,8 +724,6 @@ sub command_line_setup () { ...@@ -724,8 +724,6 @@ sub command_line_setup () {
{ {
$mysqld_variables{'port'}= 3306; $mysqld_variables{'port'}= 3306;
$mysqld_variables{'master-port'}= 3306; $mysqld_variables{'master-port'}= 3306;
$opt_skip_ndbcluster= 1;
$opt_skip_im= 1;
} }
if ( $opt_comment ) if ( $opt_comment )
...@@ -1072,7 +1070,7 @@ sub command_line_setup () { ...@@ -1072,7 +1070,7 @@ sub command_line_setup () {
# On some operating systems, there is a limit to the length of a # On some operating systems, there is a limit to the length of a
# UNIX domain socket's path far below PATH_MAX, so try to avoid long # UNIX domain socket's path far below PATH_MAX, so try to avoid long
# socket path names. # socket path names.
$sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) > 80 ); $sockdir = tempdir(CLEANUP => 0) if ( length($sockdir) >= 80 );
$master->[0]= $master->[0]=
{ {
...@@ -1235,6 +1233,7 @@ sub command_line_setup () { ...@@ -1235,6 +1233,7 @@ sub command_line_setup () {
{ {
# Turn off features not supported when running with extern server # Turn off features not supported when running with extern server
$opt_skip_rpl= 1; $opt_skip_rpl= 1;
$opt_skip_ndbcluster= 1;
# Setup master->[0] with the settings for the extern server # Setup master->[0] with the settings for the extern server
$master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock"; $master->[0]->{'path_sock'}= $opt_socket ? $opt_socket : "/tmp/mysql.sock";
...@@ -2011,10 +2010,7 @@ sub environment_setup () { ...@@ -2011,10 +2010,7 @@ sub environment_setup () {
$ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables; $ENV{'MYSQL_FIX_SYSTEM_TABLES'}= $cmdline_mysql_fix_system_tables;
} }
if (!$opt_extern) $ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
{
$ENV{'MYSQL_FIX_PRIVILEGE_TABLES'}= $file_mysql_fix_privilege_tables;
}
# ---------------------------------------------------- # ----------------------------------------------------
# Setup env so childs can execute my_print_defaults # Setup env so childs can execute my_print_defaults
......
set autocommit=1;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; insert into bug16206 values(2)
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
show binlog events;
Log_name Pos Event_type Server_id End_log_pos Info
f n Format_desc 1 n Server ver: VERSION, Binlog ver: 4
f n Query 1 n use `test`; create table bug16206 (a int) engine= bdb
f n Query 1 n use `test`; insert into bug16206 values(0)
f n Query 1 n use `test`; insert into bug16206 values(1)
f n Query 1 n use `test`; BEGIN
f n Query 1 n use `test`; insert into bug16206 values(2)
f n Query 1 n use `test`; COMMIT
f n Query 1 n use `test`; insert into bug16206 values(3)
drop table bug16206;
set autocommit=0;
End of 5.0 tests
...@@ -277,6 +277,9 @@ let $A = changed value of A; ...@@ -277,6 +277,9 @@ let $A = changed value of A;
# Content of $B is: initial value of B # Content of $B is: initial value of B
let $B = changed value of B; let $B = changed value of B;
# Content of $A is: changed value of A # Content of $A is: changed value of A
var2: content of variable 1
var3: content of variable 1 content of variable 1
length of var3 is longer than 0
mysqltest: At line 1: Missing required argument 'filename' to command 'source' mysqltest: At line 1: Missing required argument 'filename' to command 'source'
mysqltest: At line 1: Could not open file ./non_existingFile mysqltest: At line 1: Could not open file ./non_existingFile
mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep mysqltest: In included file "MYSQLTEST_VARDIR/tmp/recursive.sql": At line 1: Source directives are nesting too deep
......
-- source include/not_embedded.inc
-- source include/have_bdb.inc
#
# Bug #16206: Superfluous COMMIT event in binlog when updating BDB in autocommit mode
#
set autocommit=1;
let $VERSION=`select version()`;
reset master;
create table bug16206 (a int);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
reset master;
create table bug16206 (a int) engine= bdb;
insert into bug16206 values(0);
insert into bug16206 values(1);
start transaction;
insert into bug16206 values(2);
commit;
insert into bug16206 values(3);
--replace_result $VERSION VERSION
--replace_column 1 f 2 n 5 n
show binlog events;
drop table bug16206;
set autocommit=0;
--echo End of 5.0 tests
# Embedded server doesn't support external clients # Embedded server doesn't support external clients
--source include/not_embedded.inc --source include/not_embedded.inc
# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
# to the location of mysql_fix_privilege_tables.sql
if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
{
skip Test need MYSQL_FIX_PRIVILEGE_TABLES;
}
# #
# This is the test for mysql_fix_privilege_tables # This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 4.1.23 # It checks that a system tables from mysql 4.1.23
......
...@@ -718,6 +718,21 @@ let $A = changed value of A; ...@@ -718,6 +718,21 @@ let $A = changed value of A;
let $B = changed value of B; let $B = changed value of B;
--echo # Content of \$A is: $A --echo # Content of \$A is: $A
# ----------------------------------------------------------------------------
# Test let from query with $variable
# let $<var_name>=`<query with $variable>`;
# ----------------------------------------------------------------------------
let $var1=content of variable 1;
let $var2= `select "$var1"`;
let $var3= `select concat("$var1", " ", "$var2")`;
echo var2: $var2;
echo var3: $var3;
if (`select length("$var3") > 0`)
{
echo length of var3 is longer than 0;
}
# ---------------------------------------------------------------------------- # ----------------------------------------------------------------------------
# Test to assign let from query # Test to assign let from query
# let $<var_name>=`<query>`; # let $<var_name>=`<query>`;
......
# Embedded server doesn't support external clients # Embedded server doesn't support external clients
--source include/not_embedded.inc --source include/not_embedded.inc
# Windows doesn't support execution of shell scripts (to fix!!) # Don't run this test if $MYSQL_FIX_SYSTEM_TABLES isn't set
--source include/not_windows.inc # to the location of mysql_fix_privilege_tables.sql
if (`SELECT LENGTH("$MYSQL_FIX_SYSTEM_TABLES") <= 0`)
{
skip Test need MYSQL_FIX_SYSTEM_TABLES;
}
# #
# This is the test for mysql_fix_privilege_tables # This is the test for mysql_fix_privilege_tables
......
# Embedded server doesn't support external clients # Embedded server doesn't support external clients
--source include/not_embedded.inc --source include/not_embedded.inc
# Don't run this test if $MYSQL_FIX_PRIVILEGE_TABLES isn't set
# to the location of mysql_fix_privilege_tables.sql
if (`SELECT LENGTH("$MYSQL_FIX_PRIVILEGE_TABLES") <= 0`)
{
skip Test need MYSQL_FIX_PRIVILEGE_TABLES;
}
# #
# This is the test for mysql_fix_privilege_tables # This is the test for mysql_fix_privilege_tables
# It checks that a system tables from mysql 4.1.23 # It checks that a system tables from mysql 4.1.23
......
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