Commit d0a5290a authored by unknown's avatar unknown

Merge paul@bk-internal.mysql.com:/home/bk/mysql-4.1

into ice.snake.net:/Volumes/ice2/MySQL/bk/mysql-4.1
parents 09404894 681ecadf
...@@ -1244,3 +1244,10 @@ a b ...@@ -1244,3 +1244,10 @@ a b
3 three 3 three
4 four 4 four
drop table t1, t2; drop table t1, t2;
create table t1 (a int, b varchar(30), primary key(a)) engine = bdb;
insert into t1 values (1,'one');
commit;
truncate t1;
select * from t1;
a b
drop table t1;
...@@ -886,3 +886,14 @@ insert into t2 (a, b) ...@@ -886,3 +886,14 @@ insert into t2 (a, b)
select a, b from t1 where (a, b) in (select a, b from t1); select a, b from t1 where (a, b) in (select a, b from t1);
select * from t2; select * from t2;
drop table t1, t2; drop table t1, t2;
#
# Bug #4304: TRUNCATE <table of type BDB> , wrong result
#
create table t1 (a int, b varchar(30), primary key(a)) engine = bdb;
insert into t1 values (1,'one');
commit;
truncate t1;
select * from t1;
drop table t1;
...@@ -29,7 +29,7 @@ rm -f */*.linux ...@@ -29,7 +29,7 @@ rm -f */*.linux
./configure --without-innodb --without-docs ./configure --without-innodb --without-docs
# build tools only # build tools only
make clean config.h make clean all-local
(cd dbug; make libdbug.a) (cd dbug; make libdbug.a)
(cd strings; make libmystrings.a) (cd strings; make libmystrings.a)
(cd mysys; make libmysys.a) (cd mysys; make libmysys.a)
......
...@@ -13,7 +13,7 @@ export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib; ...@@ -13,7 +13,7 @@ export MWNWx86LibraryFiles="libcpre.o;libc.imp;netware.imp;mwcrtl.lib;mwcpp.lib;
export WINEPATH="$MYDEV/mw/bin" export WINEPATH="$MYDEV/mw/bin"
# the default added path is "$HOME/mydev/mysql-x.x-x/netware/BUILD" # the default added path is "$HOME/mydev/mysql-x.x-x/netware/BUILD"
export PATH="$PATH:/home/kp/mydev/mysql-VERSION/netware/BUILD" export PATH="$PATH:BUILD_DIR/mysql-VERSION/netware/BUILD"
export AR='mwldnlm' export AR='mwldnlm'
export AR_FLAGS='-type library -o' export AR_FLAGS='-type library -o'
......
This diff is collapsed.
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
#include <ctype.h> #include <ctype.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/mode.h> #include <sys/mode.h>
#include "my_manage.h" #include "my_manage.h"
/****************************************************************************** /******************************************************************************
macros macros
...@@ -143,7 +141,7 @@ int read_option(char *, char *); ...@@ -143,7 +141,7 @@ int read_option(char *, char *);
void run_test(char *); void run_test(char *);
void setup(char *); void setup(char *);
void vlog(char *, va_list); void vlog(char *, va_list);
void log(char *, ...); void log_msg(char *, ...);
void log_info(char *, ...); void log_info(char *, ...);
void log_error(char *, ...); void log_error(char *, ...);
void log_errno(char *, ...); void log_errno(char *, ...);
...@@ -161,21 +159,21 @@ void report_stats() ...@@ -161,21 +159,21 @@ void report_stats()
{ {
if (total_fail == 0) if (total_fail == 0)
{ {
log("\nAll %d test(s) were successful.\n", total_test); log_msg("\nAll %d test(s) were successful.\n", total_test);
} }
else else
{ {
double percent = ((double)total_pass / total_test) * 100; double percent = ((double)total_pass / total_test) * 100;
log("\nFailed %u/%u test(s), %.02f%% successful.\n", log_msg("\nFailed %u/%u test(s), %.02f%% successful.\n",
total_fail, total_test, percent); total_fail, total_test, percent);
log("\nThe .out and .err files in %s may give you some\n", result_dir); log_msg("\nThe .out and .err files in %s may give you some\n", result_dir);
log("hint of what when wrong.\n"); log_msg("hint of what when wrong.\n");
log("\nIf you want to report this error, please first read the documentation\n"); log_msg("\nIf you want to report this error, please first read the documentation\n");
log("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n"); log_msg("at: http://www.mysql.com/doc/M/y/MySQL_test_suite.html\n");
} }
log("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60); log_msg("\n%.02f total minutes elapsed in the test cases\n\n", total_time / 60);
} }
/****************************************************************************** /******************************************************************************
...@@ -240,7 +238,7 @@ void mysql_install_db() ...@@ -240,7 +238,7 @@ void mysql_install_db()
mkdir(temp, S_IRWXU); mkdir(temp, S_IRWXU);
// create subdirectories // create subdirectories
log("Creating test-suite folders...\n"); log_msg("Creating test-suite folders...\n");
snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir); snprintf(temp, PATH_MAX, "%s/var/run", mysql_test_dir);
mkdir(temp, S_IRWXU); mkdir(temp, S_IRWXU);
snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir); snprintf(temp, PATH_MAX, "%s/var/tmp", mysql_test_dir);
...@@ -259,9 +257,9 @@ void mysql_install_db() ...@@ -259,9 +257,9 @@ void mysql_install_db()
mkdir(temp, S_IRWXU); mkdir(temp, S_IRWXU);
// install databases // install databases
log("Creating test databases for master... \n"); log_msg("Creating test databases for master... \n");
install_db(master_dir); install_db(master_dir);
log("Creating test databases for slave... \n"); log_msg("Creating test databases for slave... \n");
install_db(slave_dir); install_db(slave_dir);
} }
...@@ -589,15 +587,18 @@ void start_slave() ...@@ -589,15 +587,18 @@ void start_slave()
mysql_tmp_dir)) == 0) mysql_tmp_dir)) == 0)
{ {
slave_running = TRUE; slave_running = TRUE;
} }
else else
{ {
log_error("The slave server went down early."); log_error("The slave server went down early.");
} }
} }
else else
{ {
log_error("Unable to start slave server."); log_error("Unable to start slave server.");
} }
// free args // free args
...@@ -805,7 +806,7 @@ void run_test(char *test) ...@@ -805,7 +806,7 @@ void run_test(char *test)
if (ignore) if (ignore)
{ {
// show test // show test
log("%-46s ", test); log_msg("%-46s ", test);
// ignore // ignore
rstr = TEST_IGNORE; rstr = TEST_IGNORE;
...@@ -887,7 +888,7 @@ void run_test(char *test) ...@@ -887,7 +888,7 @@ void run_test(char *test)
sleep(1); sleep(1);
// show test // show test
log("%-46s ", test); log_msg("%-46s ", test);
// args // args
init_args(&al); init_args(&al);
...@@ -959,7 +960,7 @@ void run_test(char *test) ...@@ -959,7 +960,7 @@ void run_test(char *test)
else // early skips else // early skips
{ {
// show test // show test
log("%-46s ", test); log_msg("%-46s ", test);
// skip // skip
rstr = TEST_SKIP; rstr = TEST_SKIP;
...@@ -967,7 +968,7 @@ void run_test(char *test) ...@@ -967,7 +968,7 @@ void run_test(char *test)
} }
// result // result
log("%10.06f %-14s\n", elapsed, rstr); log_msg("%10.06f %-14s\n", elapsed, rstr);
} }
/****************************************************************************** /******************************************************************************
...@@ -996,7 +997,7 @@ void vlog(char *format, va_list ap) ...@@ -996,7 +997,7 @@ void vlog(char *format, va_list ap)
Log the message. Log the message.
******************************************************************************/ ******************************************************************************/
void log(char *format, ...) void log_msg(char *format, ...)
{ {
va_list ap; va_list ap;
...@@ -1020,9 +1021,9 @@ void log_info(char *format, ...) ...@@ -1020,9 +1021,9 @@ void log_info(char *format, ...)
va_start(ap, format); va_start(ap, format);
log("-- INFO : "); log_msg("-- INFO : ");
vlog(format, ap); vlog(format, ap);
log("\n"); log_msg("\n");
va_end(ap); va_end(ap);
} }
...@@ -1040,9 +1041,9 @@ void log_error(char *format, ...) ...@@ -1040,9 +1041,9 @@ void log_error(char *format, ...)
va_start(ap, format); va_start(ap, format);
log("-- ERROR: "); log_msg("-- ERROR: ");
vlog(format, ap); vlog(format, ap);
log("\n"); log_msg("\n");
va_end(ap); va_end(ap);
} }
...@@ -1060,9 +1061,9 @@ void log_errno(char *format, ...) ...@@ -1060,9 +1061,9 @@ void log_errno(char *format, ...)
va_start(ap, format); va_start(ap, format);
log("-- ERROR: (%003u) ", errno); log_msg("-- ERROR: (%003u) ", errno);
vlog(format, ap); vlog(format, ap);
log("\n"); log_msg("\n");
va_end(ap); va_end(ap);
} }
...@@ -1157,7 +1158,8 @@ void setup(char *file) ...@@ -1157,7 +1158,8 @@ void setup(char *file)
snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); snprintf(file_path, PATH_MAX*2, "%s/mysqlbinlog --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir);
setenv("MYSQL_BINLOG", file_path, 1); setenv("MYSQL_BINLOG", file_path, 1);
setenv("MASTER_MYPORT", "9306", 1); setenv("MASTER_MYPORT", "9306", 1);
setenv("SLAVE_MYPORT", "9307", 1);
setenv("MYSQL_TCP_PORT", "3306", 1);
} }
...@@ -1198,18 +1200,18 @@ int main(int argc, char **argv) ...@@ -1198,18 +1200,18 @@ int main(int argc, char **argv)
is_ignore_list = 1; is_ignore_list = 1;
} }
// header // header
log("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE); log_msg("MySQL Server %s, for %s (%s)\n\n", VERSION, SYSTEM_TYPE, MACHINE_TYPE);
log("Initializing Tests...\n"); log_msg("Initializing Tests...\n");
// install test databases // install test databases
mysql_install_db(); mysql_install_db();
log("Starting Tests...\n"); log_msg("Starting Tests...\n");
log("\n"); log_msg("\n");
log(HEADER); log_msg(HEADER);
log(DASH); log_msg(DASH);
if ( argc > 1 + is_ignore_list ) if ( argc > 1 + is_ignore_list )
{ {
...@@ -1264,10 +1266,10 @@ int main(int argc, char **argv) ...@@ -1264,10 +1266,10 @@ int main(int argc, char **argv)
// stop server // stop server
mysql_stop(); mysql_stop();
log(DASH); log_msg(DASH);
log("\n"); log_msg("\n");
log("Ending Tests...\n"); log_msg("Ending Tests...\n");
// report stats // report stats
report_stats(); report_stats();
......
...@@ -515,7 +515,8 @@ extern TYPELIB tx_isolation_typelib; ...@@ -515,7 +515,8 @@ extern TYPELIB tx_isolation_typelib;
#define ha_commit(thd) (ha_commit_trans((thd), &((thd)->transaction.all))) #define ha_commit(thd) (ha_commit_trans((thd), &((thd)->transaction.all)))
#define ha_rollback(thd) (ha_rollback_trans((thd), &((thd)->transaction.all))) #define ha_rollback(thd) (ha_rollback_trans((thd), &((thd)->transaction.all)))
#define ha_supports_generate(T) (T != DB_TYPE_INNODB) #define ha_supports_generate(T) (T != DB_TYPE_INNODB && \
T != DB_TYPE_BERKELEY_DB)
bool ha_caching_allowed(THD* thd, char* table_key, bool ha_caching_allowed(THD* thd, char* table_key,
uint key_length, uint8 cache_type); uint key_length, uint8 cache_type);
......
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