From 5ebe0dd2315a1e6a93a621992349afe44ae45f3b Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 31 Jan 2005 19:18:06 +0500 Subject: [PATCH 1/7] WL#964 added client_test.dsp in project added CHARACTER SET in tables added 5th time zone included lstat in if() expanded ignore list for windows added directory slave1 and slave2 added options for mysqld and mysqltest fixed error in read_option() fixed and added enviroment variables for Linux and Windows rewrote str_tok() added replacment 3th column New BitKeeper file ``VC++Files/tests/client_test.dsp'' VC++Files/mysql.dsw: added client_test.dsp in project mysql-test/my_create_tables.c: added CHARACTER SET in tables added 5th time zone mysql-test/my_manage.c: included lstat in if() mysql-test/mysql_test_run_new.c: expanded ignore list for windows added directory slave1 and slave2 added options for mysqld and mysqltest fixed error in read_option() fixed and added enviroment variables for Linux and Windows rewrote str_tok() mysql-test/t/ps_1general.test: added replacment 3th column --- VC++Files/mysql.dsw | 39 ++-- VC++Files/tests/client_test.dsp | 94 ++++++++++ mysql-test/my_create_tables.c | 65 +++++-- mysql-test/my_manage.c | 9 +- mysql-test/mysql_test_run_new.c | 322 ++++++++++++++++++++------------ mysql-test/t/ps_1general.test | 2 +- 6 files changed, 370 insertions(+), 161 deletions(-) create mode 100644 VC++Files/tests/client_test.dsp diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index 0ce2acfed23..d6bf5819909 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -816,15 +816,14 @@ Package=<4> ############################################################################### -Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> +Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> + +Package=<5> +{{{ }}} -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency + +Package=<4> +{{{ Begin Project Dependency Project_Dep_Name libmysql End Project Dependency Begin Project Dependency @@ -835,24 +834,28 @@ Package=<4> End Project Dependency }}} -############################################################################### +############################################################################### Project: "client_test"=.\tests\client_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### -Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ - Begin Project Dependency + +Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ Begin Project Dependency Project_Dep_Name mysqltest End Project Dependency Begin Project Dependency Project_Dep_Name mysqladmin End Project Dependency + Begin Project Dependency + Project_Dep_Name client_test + End Project Dependency }}} + ############################################################################### Global: diff --git a/VC++Files/tests/client_test.dsp b/VC++Files/tests/client_test.dsp new file mode 100644 index 00000000000..a095906b26e --- /dev/null +++ b/VC++Files/tests/client_test.dsp @@ -0,0 +1,94 @@ +# Microsoft Developer Studio Project File - Name="client_test" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=client_test - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "client_test.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "client_test.mak" CFG="client_test - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "client_test - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "client_test - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "client_test - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir ".\Debug" +# PROP BASE Intermediate_Dir ".\Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir ".\Debug" +# PROP Intermediate_Dir ".\Debug" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\client_test.tlb" /win32 +# ADD BASE RSC /l 1033 +# ADD RSC /l 1033 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console + +!ELSEIF "$(CFG)" == "client_test - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir ".\Release" +# PROP BASE Intermediate_Dir ".\Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir ".\Release" +# PROP Intermediate_Dir ".\Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /W3 /Ob1 /G6 /D "DBUG_OFF" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /GF /Gy /Fp".\Release/client_test.pch" /Fo".\Release/" /Fd".\Release/" /c /GX +# ADD BASE MTL /nologo /tlb".\Release\client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Release\client_test.tlb" /win32 +# ADD BASE RSC /l 1033 +# ADD RSC /l 1033 +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib Ws2_32.lib /nologo /out:"..\tests\client_test.exe" /incremental:no /pdb:".\Release\client_test.pdb" /pdbtype:sept /subsystem:console + +!ENDIF + +# Begin Target + +# Name "client_test - Win32 Debug" +# Name "client_test - Win32 Release" +# Begin Source File + +SOURCE=mysql_client_test.c +# End Source File +# End Target +# End Project + diff --git a/mysql-test/my_create_tables.c b/mysql-test/my_create_tables.c index 405f66dc8df..06a6fabf022 100644 --- a/mysql-test/my_create_tables.c +++ b/mysql-test/my_create_tables.c @@ -96,6 +96,8 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," "PRIMARY KEY Host (Host,Db,User)," "KEY User (User))" + "engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " "comment='Database privileges';\n"); if (test) @@ -126,10 +128,12 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Create_tmp_table_priv enum('N','Y') DEFAULT 'N' NOT NULL," "Lock_tables_priv enum('N','Y') DEFAULT 'N' NOT NULL," "PRIMARY KEY Host (Host,Db))" - "comment='Host privileges;" - " Merged with database privileges';\n"); + "engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Host privileges; Merged with database privileges';\n"); } + if (test_sys_file(mdata,"mysql/user.frm")) { #ifdef __WIN__ @@ -184,7 +188,10 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "max_updates int(11) unsigned DEFAULT 0 NOT NULL," "max_connections int(11) unsigned DEFAULT 0 NOT NULL," "PRIMARY KEY Host (Host,User)" - ") comment='Users and global privileges';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Users and global privileges';\n"); + if (test) { @@ -238,7 +245,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "dl char(128) DEFAULT '' NOT NULL," "type enum ('function','aggregate') NOT NULL," "PRIMARY KEY (name)" - ") comment='User defined functions';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='User defined functions';\n"); } if (test_sys_file(mdata,"mysql/tables_priv.frm")) @@ -258,7 +267,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) " DEFAULT '' NOT NULL," "PRIMARY KEY (Host,Db,User,Table_name)," "KEY Grantor (Grantor)" - ") comment='Table privileges';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Table privileges';\n"); } if (test_sys_file(mdata,"mysql/columns_priv.frm")) @@ -274,7 +285,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Column_priv set('Select','Insert','Update','References')" " DEFAULT '' NOT NULL," "PRIMARY KEY (Host,Db,User,Table_name,Column_name)" - ") comment='Column privileges';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 COLLATE utf8_bin " + "comment='Column privileges';\n"); } if (test_sys_file(mdata,"mysql/help_topic.frm")) @@ -289,7 +302,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "url varchar(128) not null," "primary key (help_topic_id)," "unique index (name)" - ") comment='help topics';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help topics';\n"); } if (test_sys_file(mdata,"mysql/help_category.frm")) @@ -302,7 +317,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "url varchar(128) not null," "primary key (help_category_id)," "unique index (name)" - ") comment='help categories';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help categories';\n"); } if (test_sys_file(mdata,"mysql/help_keyword.frm")) @@ -313,7 +330,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "name varchar(64) not null," "primary key (help_keyword_id)," "unique index (name)" - ") comment='help keywords';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='help keywords';\n"); } if (test_sys_file(mdata,"mysql/help_relation.frm")) @@ -323,7 +342,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "help_topic_id int unsigned not null references help_topic," "help_keyword_id int unsigned not null references help_keyword," "primary key (help_keyword_id, help_topic_id)" - ") comment='keyword-topic relation';\n"); + ") engine=MyISAM " + "CHARACTER SET utf8 " + "comment='keyword-topic relation';\n"); } if (test_sys_file(mdata,"mysql/time_zone_name.frm")) @@ -333,7 +354,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Name char(64) NOT NULL," "Time_zone_id int unsigned NOT NULL," "PRIMARY KEY Name (Name)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zone names';\n"); if (test) @@ -341,7 +362,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) fprintf(out, "INSERT INTO time_zone_name (Name, Time_Zone_id) VALUES" "('MET', 1), ('UTC', 2), ('Universal', 2), " - "('Europe/Moscow',3), ('leap/Europe/Moscow',4);\n"); + "('Europe/Moscow',3), ('leap/Europe/Moscow',4)," + "('Japan', 5);\n"); + } } @@ -353,13 +376,13 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Time_zone_id int unsigned NOT NULL auto_increment," "Use_leap_seconds enum('Y','N') DEFAULT 'N' NOT NULL," "PRIMARY KEY TzId (Time_zone_id)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zones';\n"); if (test) { fprintf(out,"INSERT INTO time_zone (Time_zone_id, Use_leap_seconds)" - "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y');\n"); + "VALUES (1,'N'), (2,'N'), (3,'N'), (4,'Y'), (5,'N');\n"); } } @@ -371,7 +394,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Transition_time bigint signed NOT NULL," "Transition_type_id int unsigned NOT NULL," "PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zone transitions';\n"); if (test) @@ -576,7 +599,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ",(4, 2045689222, 8) ,(4, 2058390022, 9)" ",(4, 2077138822, 8) ,(4, 2090444422, 9)" ",(4, 2108588422, 8) ,(4, 2121894022, 9)" - ",(4, 2140038022, 8);\n"); + ",(4, 2140038022, 8), (5, -1009875600, 1);\n"); + + } } @@ -590,7 +615,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Is_DST tinyint unsigned DEFAULT 0 NOT NULL," "Abbreviation char(8) DEFAULT '' NOT NULL," "PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Time zone transition types';\n"); if (test) @@ -612,7 +637,9 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) ",(4, 4, 10800, 0, 'MSK') ,(4, 5, 14400, 1, 'MSD')" ",(4, 6, 18000, 1, 'MSD') ,(4, 7, 7200, 0, 'EET')" ",(4, 8, 10800, 0, 'MSK') ,(4, 9, 14400, 1, 'MSD')" - ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET');\n"); + ",(4, 10, 10800, 1, 'EEST') ,(4, 11, 7200, 0, 'EET')" + ",(5, 0, 32400, 0, 'CJT') ,(5, 1, 32400, 0, 'JST');\n"); + } } @@ -623,7 +650,7 @@ bool create_system_files(const char *mdata,const char *output_file, bool test) "Transition_time bigint signed NOT NULL," "Correction int signed NOT NULL," "PRIMARY KEY TranTime (Transition_time)" - ") DEFAULT CHARACTER SET latin1 " + ") engine=MyISAM CHARACTER SET utf8 " "comment='Leap seconds information for time zones';\n"); if (test) diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 1f006f7ab90..5cd0013d7bb 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -122,7 +122,7 @@ void add_arg(arg_list_t *al, const char *format, ...) al->argv[al->argc]= malloc(strlen(temp)+1); ASSERT(al->argv[al->argc] != NULL); strcpy(al->argv[al->argc], temp); - + ++(al->argc); } else @@ -800,12 +800,7 @@ int removef(const char *format, ...) #ifndef STRUCT_DIRENT_HAS_D_TYPE struct stat st; - if (lstat(entry->d_name, &st) == -1) - { - return 1; - } - - if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) + if (lstat(entry->d_name, &st) == -1 && !fnmatch(p, entry->d_name,0)) #else if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) #endif diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index bdebe912b97..4e0e018f84b 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -132,7 +132,13 @@ static char skip_test[FN_REFLEN]= " repair ," " rpl_trunc_binlog ," " mysqldump ," -" rpl000001 "; +" rpl000001 ," + +" derived ," +" group_by ," +" select ," +" rpl000015 ," +" subselect "; #endif static char ignore_test[FN_REFLEN]= ""; @@ -143,6 +149,8 @@ static char mysql_tmp_dir[FN_REFLEN]; static char result_dir[FN_REFLEN]; static char master_dir[FN_REFLEN]; static char slave_dir[FN_REFLEN]; +static char slave1_dir[FN_REFLEN]; +static char slave2_dir[FN_REFLEN]; static char lang_dir[FN_REFLEN]; static char char_dir[FN_REFLEN]; @@ -190,6 +198,8 @@ int restarts= 0; FILE *log_fd= NULL; +static char argument[FN_REFLEN]; + /****************************************************************************** functions @@ -221,7 +231,7 @@ void log_info(const char *, ...); void log_error(const char *, ...); void log_errno(const char *, ...); void die(const char *); -char *str_tok(char *string, const char *delim); +char *str_tok(char* dest, char *string, const char *delim); #ifndef __WIN__ void run_init_script(const char *script_name); #endif @@ -289,11 +299,15 @@ void install_db(char *datadir) add_arg(&al, "--basedir=%s", base_dir); add_arg(&al, "--datadir=%s", datadir); add_arg(&al, "--skip-innodb"); + add_arg(&al, "--skip-ndbcluster"); add_arg(&al, "--skip-bdb"); #ifndef __NETWARE__ add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--language=%s", lang_dir); #endif +// added + add_arg(&al, "--default-character-set=latin1"); + add_arg(&al, "--innodb_data_file_path=ibdata1:50M"); /* spawn */ if ((err= spawn(mysqld_file, &al, TRUE, input, output, error, NULL)) != 0) @@ -335,12 +349,27 @@ void mysql_install_db() mkdir(temp, S_IRWXU); snprintf(temp, FN_REFLEN, "%s/var/master-data/test", mysql_test_dir); mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); mkdir(temp, S_IRWXU); snprintf(temp, FN_REFLEN, "%s/var/slave-data/mysql", mysql_test_dir); mkdir(temp, S_IRWXU); snprintf(temp, FN_REFLEN, "%s/var/slave-data/test", mysql_test_dir); mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave1-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave1-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); + + snprintf(temp, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave2-data/mysql", mysql_test_dir); + mkdir(temp, S_IRWXU); + snprintf(temp, FN_REFLEN, "%s/var/slave2-data/test", mysql_test_dir); + mkdir(temp, S_IRWXU); #else mkdir(temp); /* create subdirectories */ @@ -368,6 +397,8 @@ void mysql_install_db() install_db(master_dir); mlog("Creating test databases for slave... \n"); install_db(slave_dir); + install_db(slave1_dir); + install_db(slave2_dir); } /****************************************************************************** @@ -384,7 +415,6 @@ void start_master() int err; char master_out[FN_REFLEN]; char master_err[FN_REFLEN]; -/* char temp[FN_REFLEN]; */ char temp2[FN_REFLEN]; /* remove old berkeley db log files that can confuse the server */ @@ -463,6 +493,11 @@ void start_master() add_arg(&al, "--character-sets-dir=%s", char_dir); add_arg(&al, "--tmpdir=%s", mysql_tmp_dir); add_arg(&al, "--language=%s", lang_dir); + + add_arg(&al, "--rpl-recovery-rank=1"); + add_arg(&al, "--init-rpl-role=master"); + add_arg(&al, "--default-character-set=latin1"); +// add_arg(&al, "--innodb_data_file_path=ibdata1:50M"); #ifdef DEBUG /* only for debug builds */ add_arg(&al, "--debug"); #endif @@ -491,13 +526,13 @@ void start_master() { char *p; - p= (char *)str_tok(master_opt, " \t"); + p= (char *)str_tok(argument, master_opt, " \t"); if (!strstr(master_opt, "timezone")) { while (p) { add_arg(&al, "%s", p); - p= (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(argument, NULL, " \t"); } } } @@ -624,10 +659,10 @@ void start_slave() add_arg(&al, "--log-bin=slave-bin"); add_arg(&al, "--relay_log=slave-relay-bin"); add_arg(&al, "--basedir=%s", base_dir); - add_arg(&al, "--port=%u", slave_port); #if !defined(__NETWARE__) && !defined(__WIN__) add_arg(&al, "--socket=%s",slave_socket); #endif + add_arg(&al, "--port=%u", slave_port); add_arg(&al, "--datadir=%s", slave_dir); #ifndef __WIN__ add_arg(&al, "--pid-file=%s", slave_pid); @@ -651,10 +686,15 @@ void start_slave() add_arg(&al, "--master-retry-count=10"); add_arg(&al, "-O"); add_arg(&al, "slave_net_timeout=10"); + add_arg(&al, "--log-slave-updates"); + add_arg(&al, "--log=%s/var/log/slave.log", mysql_test_dir); + add_arg(&al, "--default-character-set=latin1"); + add_arg(&al, "--skip-ndbcluster"); + #ifdef DEBUG /* only for debug builds */ add_arg(&al, "--debug"); -#endif - +#endif + if (use_openssl) { add_arg(&al, "--ssl-ca=%s", ca_cert); @@ -667,12 +707,12 @@ void start_slave() { char *p; - p= (char *)str_tok(slave_master_info, " \t"); + p= (char *)str_tok(argument, slave_master_info, " \t"); while (p) { add_arg(&al, "%s", p); - p= (char *)str_tok(NULL, " \t"); + p= (char *)str_tok(argument, NULL, " \t"); } } else @@ -700,13 +740,13 @@ void start_slave() { char *p; - p= (char *)str_tok(slave_opt, " \t"); + p= (char *)str_tok(argument, slave_opt, " \t"); while (p) { add_arg(&al, "%s", p); - p= (char *)str_tok(NULL, " \t"); - } + p= (char *)str_tok(argument, NULL, " \t"); + } } /* remove the pid file if it exists */ @@ -753,9 +793,12 @@ void start_slave() void mysql_start() { -/* log_info("Starting the MySQL server(s): %u", ++restarts); */ + + + printf("loading master...\r"); start_master(); + printf("loading slave...\r"); start_slave(); /* activate the test screen */ @@ -853,6 +896,7 @@ void mysql_restart() mysql_stop(); mlog(DASH); + sleep(1); mysql_start(); } @@ -912,7 +956,7 @@ int read_option(char *opt_file, char *opt) if ((p= strstr(opt, "\\\\")) != NULL) { /* bmove is guranteed to work byte by byte */ - bmove(p, p+1, strlen(p+1)); + bmove(p, p+1, strlen(p)+1); } } else @@ -1045,9 +1089,6 @@ void run_test(char *test) if (!master_running) mysql_start(); else if (restart) mysql_restart(); - /* let the system stabalize */ - sleep(1); - /* show test */ mlog("%-46s ", test); @@ -1066,10 +1107,12 @@ void run_test(char *test) add_arg(&al, "--silent"); add_arg(&al, "--basedir=%s/", mysql_test_dir); add_arg(&al, "--host=127.0.0.1"); + add_arg(&al, "--skip-safemalloc"); add_arg(&al, "-v"); add_arg(&al, "-R"); add_arg(&al, "%s", result_file); - + + if (use_openssl) { add_arg(&al, "--ssl-ca=%s", ca_cert); @@ -1079,7 +1122,6 @@ void run_test(char *test) /* spawn */ err= spawn(mysqltest_file, &al, TRUE, test_file, out_file, err_file, NULL); - /* free args */ free_args(&al); @@ -1259,7 +1301,9 @@ void die(const char *msg) void setup(char *file __attribute__((unused))) { char temp[FN_REFLEN]; +#if defined(__WIN__) || defined(__NETWARE__) char file_path[FN_REFLEN*2]; +#endif char *p; int position; @@ -1361,6 +1405,8 @@ void setup(char *file __attribute__((unused))) snprintf(result_dir, FN_REFLEN, "%s/r", mysql_test_dir); snprintf(master_dir, FN_REFLEN, "%s/var/master-data", mysql_test_dir); snprintf(slave_dir, FN_REFLEN, "%s/var/slave-data", mysql_test_dir); + snprintf(slave1_dir, FN_REFLEN, "%s/var/slave1-data", mysql_test_dir); + snprintf(slave2_dir, FN_REFLEN, "%s/var/slave2-data", mysql_test_dir); snprintf(lang_dir, FN_REFLEN, "%s/sql/share/english", base_dir); snprintf(char_dir, FN_REFLEN, "%s/sql/share/charsets", base_dir); @@ -1413,30 +1459,108 @@ void setup(char *file __attribute__((unused))) snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); _putenv(file_path); snprintf(file_path, FN_REFLEN*2, - "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -u root --port=%u", + "MYSQL_DUMP=%s/mysqldump.exe --no-defaults -uroot --port=%u", bin_dir, master_port); _putenv(file_path); snprintf(file_path, FN_REFLEN*2, - "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", + "MYSQL_BINLOG=%s/mysqlbinlog.exe --no-defaults --local-load=%s", bin_dir, mysql_tmp_dir); _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "TESTS_BINDIR=%s/tests", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "CHARSETSDIR=%s/sql/share/charsets", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL=%s/mysql --port=%u ", + bin_dir, master_port); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults " + "--host=localhost --port=%u " + "--basedir=%s --bindir=%s --verbose", + base_dir,master_port, base_dir, bin_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "NDB_TOOLS_DIR=%s/ndb/tools", base_dir); + _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "CLIENT_BINDIR=%s", bin_dir); + _putenv(file_path); #else - snprintf(file_path,FN_REFLEN,"MYSQL_TEST_DIR=%s",mysql_test_dir); - putenv(file_path); - snprintf(file_path, FN_REFLEN*2, - "MYSQL_DUMP=%s/mysqldump --no-defaults -u root --port=%u --socket=%s", - bin_dir, master_port, master_socket); - putenv(file_path); - snprintf(file_path, FN_REFLEN*2, - "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s", - bin_dir, mysql_tmp_dir); - putenv(file_path); + { + static char env_MYSQL_TEST_DIR[FN_REFLEN*2]; + static char env_MYSQL_DUMP[FN_REFLEN*2]; + static char env_MYSQL_BINLOG[FN_REFLEN*2]; + static char env_MASTER_MYSOCK[FN_REFLEN*2]; + static char env_TESTS_BINDIR[FN_REFLEN*2]; + static char env_CHARSETSDIR[FN_REFLEN*2]; + static char env_MYSQL[FN_REFLEN*2]; + static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2]; + static char env_NDB_TOOLS_DIR[FN_REFLEN*2]; + static char env_CLIENT_BINDIR[FN_REFLEN*2]; + + snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2, + "MYSQL_TEST_DIR=%s",mysql_test_dir); + putenv(env_MYSQL_TEST_DIR); + + snprintf(env_MYSQL_DUMP, FN_REFLEN*2,"MYSQL_DUMP=%s/mysqldump --no-defaults " + "-uroot --port=%u --socket=%s ", + bin_dir, master_port, master_socket); + putenv(env_MYSQL_DUMP); + + snprintf(env_MYSQL_BINLOG, FN_REFLEN*2, + "MYSQL_BINLOG=%s/mysqlbinlog --no-defaults --local-load=%s -uroot ", + bin_dir, mysql_tmp_dir); + putenv(env_MYSQL_BINLOG); + + snprintf(env_MASTER_MYSOCK, FN_REFLEN*2, + "MASTER_MYSOCK=%s", master_socket); + putenv(env_MASTER_MYSOCK); + + snprintf(env_TESTS_BINDIR, FN_REFLEN*2, + "TESTS_BINDIR=%s/tests", base_dir); + putenv(env_TESTS_BINDIR); + + snprintf(env_CHARSETSDIR, FN_REFLEN*2, + "CHARSETSDIR=%s/sql/share/charsets", base_dir); + putenv(env_CHARSETSDIR); + + snprintf(env_MYSQL, FN_REFLEN*2, + "MYSQL=%s/mysql --port=%u --socket=%s -uroot ", + bin_dir, master_port, master_socket); + putenv(env_MYSQL); + + snprintf(env_MYSQL_FIX_SYSTEM_TABLES, FN_REFLEN*2, + "MYSQL_FIX_SYSTEM_TABLES=%s/scripts/mysql_fix_privilege_tables --no-defaults " + "--host=localhost --port=%u --socket=%s " + "--basedir=%s --bindir=%s --verbose -uroot ", + base_dir,master_port, master_socket, base_dir, bin_dir); + putenv(env_MYSQL_FIX_SYSTEM_TABLES); + + snprintf(env_NDB_TOOLS_DIR, FN_REFLEN*2, + "NDB_TOOLS_DIR=%s/ndb/tools", base_dir); + putenv(env_NDB_TOOLS_DIR); + + snprintf(env_CLIENT_BINDIR, FN_REFLEN*2, + "CLIENT_BINDIR=%s", bin_dir); + putenv(env_CLIENT_BINDIR); + } + #endif #ifndef __WIN__ putenv((char *)"MASTER_MYPORT=9306"); putenv((char *)"SLAVE_MYPORT=9307"); putenv((char *)"MYSQL_TCP_PORT=3306"); + #else _putenv("MASTER_MYPORT=9306"); _putenv("SLAVE_MYPORT=9307"); @@ -1484,7 +1608,8 @@ int main(int argc, char **argv) { char *temp, *token; temp= strdup(strchr(argv[1],'=') + 1); - for (token=str_tok(temp, ","); token != NULL; token=str_tok(NULL, ",")) + for (token=str_tok(argument, temp, ","); token != NULL; + token=str_tok(argument, NULL, ",")) { if (strlen(ignore_test) + strlen(token) + 2 <= FN_REFLEN-1) sprintf(ignore_test+strlen(ignore_test), " %s ", token); @@ -1671,105 +1796,70 @@ Arguments: Output: return the null terminated token of NULL. */ - -char *str_tok(char *string, const char *delim) +char *str_tok(char* dest, char *string, const char *delim) { - char *token; /* current token received from strtok */ - char *qt_token; /* token delimeted by the matching pair of quote */ - /* - if there are any quote chars found in the token then this variable - will hold the concatenated string to return to the caller - */ - char *ptr_token=NULL; - /* pointer to the quote character in the token from strtok */ - char *ptr_quote=NULL; + char *token; + char *ptr_end_token= NULL; + char *ptr_quote= NULL; + char *ptr_token= NULL; + int count_quotes= 0; - /* See if the delimeter contains any quote character */ + *dest = '\0'; if (strchr(delim,'\'') || strchr(delim,'\"')) return NULL; - /* repeate till we are getting some token from strtok */ - while ((token= (char*)strtok(string, delim) ) != NULL) + token= (char*)strtok(string, delim); + if (token) { - /* - make the input string NULL so that next time onward strtok can - be called with NULL input string. - */ - string= NULL; - /* We don't need to remove any quote character for Windows version */ + /* double quote is found */ + if (strchr(token,'\"')) + { + do + { + if (count_quotes & 1) + { + if (*dest == '\0') + sprintf(dest,"%s", ptr_token); + else + sprintf(dest,"%s %s", dest, ptr_token); + ptr_token= (char*)strtok(NULL, delim); + if (!ptr_token) + break; + } + else + { + ptr_token= token; + } + if (ptr_quote = strchr(ptr_token,'\"')) + { + ptr_end_token= ptr_token + strlen(ptr_token); + do + { #ifndef __WIN__ - /* check if the current token contain double quote character*/ - if ((ptr_quote= (char*)strchr(token,'\"')) != NULL) - { - /* - get the matching the matching double quote in the remaining - input string - */ - qt_token= (char*)strtok(NULL,"\""); - } - /* check if the current token contain single quote character*/ - else if ((ptr_quote= (char*)strchr(token,'\'')) != NULL) - { - /* - get the matching the matching single quote in the remaining - input string - */ - qt_token= (char*)strtok(NULL,"\'"); - } + bmove(ptr_quote, ptr_quote+1, ptr_end_token - ptr_quote); #endif - /* - if the current token does not contains any quote character then - return to the caller. - */ - if (ptr_quote == NULL) - { - /* - if there is any earlier token i.e. ptr_token then append the - current token in it and return it else return the current - token directly - */ - return ptr_token ? strcat(ptr_token,token) : token; - } - - /* - remove the quote character i.e. make NULL so that the token will - be devided in two part and later both part can be concatenated - and hence quote will be removed - */ - *ptr_quote= 0; - - /* check if ptr_token has been initialized or not */ - if (ptr_token == NULL) - { - /* initialize the ptr_token with current token */ - ptr_token= token; - /* copy entire string between matching pair of quote*/ - sprintf(ptr_token+strlen(ptr_token),"%s %s", ptr_quote+1, qt_token); + count_quotes++; + } while (ptr_quote != NULL && (ptr_quote = strchr(ptr_quote+1,'\"'))); + } + /* there are unpair quotes we have to search next quote*/ + } while (count_quotes & 1); + if (ptr_token != NULL) + { + if (*dest == '\0') + sprintf(dest,"%s", ptr_token); + else + sprintf(dest,"%s %s",dest,ptr_token); + } } else { - /* - copy the current token and entire string between matching pair - of quote - */ - if (qt_token == NULL) - { - sprintf(ptr_token+strlen(ptr_token),"%s%s", token, ptr_quote+1); - } - else - { - sprintf(ptr_token+strlen(ptr_token),"%s%s %s", token, ptr_quote+1, - qt_token ); - } + sprintf(dest,"%s",token); } } - - /* return the concatenated token */ - return ptr_token; + return token ? dest : NULL; } #ifndef __WIN__ - /* Synopsis: This function run scripts files on Linux and Netware diff --git a/mysql-test/t/ps_1general.test b/mysql-test/t/ps_1general.test index d9cc9de6ff1..5450512b959 100644 --- a/mysql-test/t/ps_1general.test +++ b/mysql-test/t/ps_1general.test @@ -317,7 +317,7 @@ prepare stmt4 from ' show engine bdb logs '; execute stmt4; --enable_result_log prepare stmt4 from ' show full processlist '; ---replace_column 1 number 6 time +--replace_column 1 number 6 time 3 localhost execute stmt4; prepare stmt4 from ' show grants for user '; --error 1295 From 5de673901f291668fa577a55faeb57d06016eb8b Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 2 Feb 2005 19:53:49 +0500 Subject: [PATCH 2/7] WL#964 renamed client_test to mysql_client_test fixed name for lstat in removef() added mysql-debug.exe for Windows added enviroment variable MYSQL_CLIENT_TEST added cleaning directory before tests New BitKeeper file ``VC++Files/tests/mysql_client_test.dsp'' Delete: VC++Files/tests/client_test.dsp BitKeeper/deleted/.del-client_test.dsp~659d0237a4c12ea1: Delete: VC++Files/tests/client_test.dsp VC++Files/mysql.dsw: renamed client_test to mysql_client_test mysql-test/my_manage.c: fixed name for lstat in removef() mysql-test/mysql_test_run_new.c: added mysql-debug.exe for Windows added enviroment variable MYSQL_CLIENT_TEST added cleaning directory before tests --- VC++Files/mysql.dsw | 21 +++++++++--- ...{client_test.dsp => mysql_client_test.dsp} | 34 +++++++++---------- mysql-test/my_manage.c | 12 +++++-- mysql-test/mysql_test_run_new.c | 34 ++++++++++++++----- 4 files changed, 69 insertions(+), 32 deletions(-) rename VC++Files/tests/{client_test.dsp => mysql_client_test.dsp} (68%) diff --git a/VC++Files/mysql.dsw b/VC++Files/mysql.dsw index d6bf5819909..d36cbc7a031 100644 --- a/VC++Files/mysql.dsw +++ b/VC++Files/mysql.dsw @@ -819,8 +819,9 @@ Package=<4> Project: "mysqltest"=.\client\mysqltest.dsp - Package Owner=<4> Package=<5> -{{{ }}} - +{{{ + }}} + Package=<4> {{{ Begin Project Dependency @@ -834,7 +835,19 @@ Package=<4> End Project Dependency }}} -############################################################################### Project: "client_test"=.\tests\client_test.dsp - Package Owner=<4> Package=<5> {{{ }}} Package=<4> {{{ }}} ############################################################################### +############################################################################### + +Project: "mysql_client_test"=.\tests\mysql_client_test.dsp - Package Owner=<4> + + Package=<5> +{{{ + }}} + + Package=<4> + {{{ + }}} + + ############################################################################### Project: "mysql_test_run_new"=".\mysql-test\mysql_test_run_new.dsp" - Package Owner=<4> @@ -851,7 +864,7 @@ Package=<4> Project_Dep_Name mysqladmin End Project Dependency Begin Project Dependency - Project_Dep_Name client_test + Project_Dep_Name mysql_client_test End Project Dependency }}} diff --git a/VC++Files/tests/client_test.dsp b/VC++Files/tests/mysql_client_test.dsp similarity index 68% rename from VC++Files/tests/client_test.dsp rename to VC++Files/tests/mysql_client_test.dsp index a095906b26e..07014487bd1 100644 --- a/VC++Files/tests/client_test.dsp +++ b/VC++Files/tests/mysql_client_test.dsp @@ -1,24 +1,24 @@ -# Microsoft Developer Studio Project File - Name="client_test" - Package Owner=<4> +# Microsoft Developer Studio Project File - Name="mysql_client_test" - Package Owner=<4> # Microsoft Developer Studio Generated Build File, Format Version 6.00 # ** DO NOT EDIT ** # TARGTYPE "Win32 (x86) Console Application" 0x0103 -CFG=client_test - Win32 Debug +CFG=mysql_client_test - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run !MESSAGE -!MESSAGE NMAKE /f "client_test.mak". +!MESSAGE NMAKE /f "mysql_client_test.mak". !MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE -!MESSAGE NMAKE /f "client_test.mak" CFG="client_test - Win32 Debug" +!MESSAGE NMAKE /f "mysql_client_test.mak" CFG="mysql_client_test - Win32 Debug" !MESSAGE !MESSAGE Possible choices for configuration are: !MESSAGE -!MESSAGE "client_test - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE "client_test - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_client_test - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE "mysql_client_test - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE # Begin Project @@ -29,7 +29,7 @@ CPP=cl.exe MTL=midl.exe RSC=rc.exe -!IF "$(CFG)" == "client_test - Win32 Debug" +!IF "$(CFG)" == "mysql_client_test - Win32 Debug" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 1 @@ -41,20 +41,20 @@ RSC=rc.exe # PROP Output_Dir ".\Debug" # PROP Intermediate_Dir ".\Debug" # PROP Target_Dir "" -# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX -# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX -# ADD BASE MTL /nologo /tlb".\Debug\client_test.tlb" /win32 -# ADD MTL /nologo /tlb".\Debug\client_test.tlb" /win32 +# ADD BASE CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD CPP /nologo /MTd /I "../include" /I "../" /Z7 /W3 /Od /G6 /D "_DEBUG" /D "_WINDOWS" /D "SAFE_MUTEX" /D "USE_TLS" /D "MYSQL_CLIENT" /D "__WIN__" /D "_WIN32" /Fp".\Debug/mysql_client_test.pch" /Fo".\Debug/" /Fd".\Debug/" /GZ /c /GX +# ADD BASE MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32 +# ADD MTL /nologo /tlb".\Debug\mysql_client_test.tlb" /win32 # ADD BASE RSC /l 1033 # ADD RSC /l 1033 BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\client_test.pdb" /pdbtype:sept /map:".\Debug\client_test.map" /subsystem:console +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib odbc32.lib odbccp32.lib mysqlclient.lib wsock32.lib mysys.lib regex.lib /nologo /out:"..\tests\mysql_client_test.exe" /incremental:yes /libpath:"..\lib_debug\" /debug /pdb:".\Debug\mysql_client_test.pdb" /pdbtype:sept /map:".\Debug\mysql_client_test.map" /subsystem:console -!ELSEIF "$(CFG)" == "client_test - Win32 Release" +!ELSEIF "$(CFG)" == "mysql_client_test - Win32 Release" # PROP BASE Use_MFC 0 # PROP BASE Use_Debug_Libraries 0 @@ -83,11 +83,11 @@ LINK32=link.exe # Begin Target -# Name "client_test - Win32 Debug" -# Name "client_test - Win32 Release" +# Name "mysql_client_test - Win32 Debug" +# Name "mysql_client_test - Win32 Release" # Begin Source File -SOURCE=mysql_client_test.c +SOURCE=tests\mysql_client_test.c # End Source File # End Target # End Project diff --git a/mysql-test/my_manage.c b/mysql-test/my_manage.c index 5cd0013d7bb..88e68dfc27e 100644 --- a/mysql-test/my_manage.c +++ b/mysql-test/my_manage.c @@ -644,7 +644,7 @@ void del_tree(char *dir) if (lstat(entry->d_name, &st) == -1) { /* FIXME error */ - return; + return; } if (S_ISDIR(st.st_mode)) #else @@ -800,7 +800,15 @@ int removef(const char *format, ...) #ifndef STRUCT_DIRENT_HAS_D_TYPE struct stat st; - if (lstat(entry->d_name, &st) == -1 && !fnmatch(p, entry->d_name,0)) + /* create long name */ + snprintf(temp, FN_REFLEN, "%s/%s", path, entry->d_name); + + if (lstat(temp, &st) == -1) + { + return 1; /* Error couldn't lstat file */ + } + + if (!S_ISDIR(st.st_mode) && !fnmatch(p, entry->d_name,0)) #else if (!S_ISDIR(entry->d_type) && !fnmatch(p, entry->d_name,0)) #endif diff --git a/mysql-test/mysql_test_run_new.c b/mysql-test/mysql_test_run_new.c index 4e0e018f84b..40e45a92851 100644 --- a/mysql-test/mysql_test_run_new.c +++ b/mysql-test/mysql_test_run_new.c @@ -1021,14 +1021,6 @@ void run_test(char *test) char err_file[FN_REFLEN]; int err; arg_list_t al; -#ifdef __WIN__ - /* Clean test database */ - removef("%s/test/*.*", master_dir); - removef("%s/test/*.*", slave_dir); - removef("%s/mysqltest/*.*", master_dir); - removef("%s/mysqltest/*.*", slave_dir); - -#endif /* skip slave? */ flag= skip_slave; skip_slave= (strncmp(test, "rpl", 3) != 0); @@ -1393,7 +1385,11 @@ void setup(char *file __attribute__((unused))) snprintf(client_key, FN_REFLEN, "%s/SSL/client-key.pem", base_dir); /* setup files */ +#ifdef _DEBUG + snprintf(mysqld_file, FN_REFLEN, "%s/mysqld-debug.exe", bin_dir); +#else snprintf(mysqld_file, FN_REFLEN, "%s/mysqld.exe", bin_dir); +#endif snprintf(mysqltest_file, FN_REFLEN, "%s/mysqltest.exe", bin_dir); snprintf(mysqladmin_file, FN_REFLEN, "%s/mysqladmin.exe", bin_dir); #else @@ -1494,6 +1490,13 @@ void setup(char *file __attribute__((unused))) snprintf(file_path, FN_REFLEN*2, "CLIENT_BINDIR=%s", bin_dir); _putenv(file_path); + + snprintf(file_path, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --port=%u --silent", + base_dir, master_port); + _putenv(file_path); + #else { static char env_MYSQL_TEST_DIR[FN_REFLEN*2]; @@ -1506,6 +1509,7 @@ void setup(char *file __attribute__((unused))) static char env_MYSQL_FIX_SYSTEM_TABLES[FN_REFLEN*2]; static char env_NDB_TOOLS_DIR[FN_REFLEN*2]; static char env_CLIENT_BINDIR[FN_REFLEN*2]; + static char env_MYSQL_CLIENT_TEST[FN_REFLEN*2]; snprintf(env_MYSQL_TEST_DIR,FN_REFLEN*2, "MYSQL_TEST_DIR=%s",mysql_test_dir); @@ -1552,6 +1556,13 @@ void setup(char *file __attribute__((unused))) snprintf(env_CLIENT_BINDIR, FN_REFLEN*2, "CLIENT_BINDIR=%s", bin_dir); putenv(env_CLIENT_BINDIR); + + snprintf(env_MYSQL_CLIENT_TEST, FN_REFLEN*2, + "MYSQL_CLIENT_TEST=%s/tests/mysql_client_test --no-defaults --testcase " + "--user=root --socket=%s --port=%u --silent", + base_dir, master_socket, master_port); + putenv(env_MYSQL_CLIENT_TEST); + } #endif @@ -1592,8 +1603,13 @@ int main(int argc, char **argv) char **testes= 0; int name_index; int index; + char var_dir[FN_REFLEN]; /* setup */ setup(argv[0]); + + /* delete all file in var */ + snprintf(var_dir,FN_REFLEN,"%s/var",mysql_test_dir); + del_tree(var_dir); /* The --ignore option is comma saperated list of test cases to skip and @@ -1633,7 +1649,7 @@ int main(int argc, char **argv) /* install test databases */ mysql_install_db(); - + mlog("Starting Tests...\n"); mlog("\n"); From 5a3b890e0da1063af6b66f53f647adba0e234009 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 15:09:13 +0100 Subject: [PATCH 3/7] Fix core dump in ha_ndbcluster::print_results sql/ha_ndbcluster.cc: Should not try to call a function on a NULL pointer Adjusted according to coding standard --- sql/ha_ndbcluster.cc | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/sql/ha_ndbcluster.cc b/sql/ha_ndbcluster.cc index f77136a548e..58f744438fc 100644 --- a/sql/ha_ndbcluster.cc +++ b/sql/ha_ndbcluster.cc @@ -2357,22 +2357,21 @@ void ha_ndbcluster::print_results() if (!_db_on_) DBUG_VOID_RETURN; - + char buf_type[MAX_FIELD_WIDTH], buf_val[MAX_FIELD_WIDTH]; - String type(buf_type, sizeof(buf_type), &my_charset_bin); + String type(buf_type, sizeof(buf_type), &my_charset_bin); String val(buf_val, sizeof(buf_val), &my_charset_bin); for (uint f=0; fs->fields;f++) { - // Use DBUG_PRINT since DBUG_FILE cannot be filtered out + /* Use DBUG_PRINT since DBUG_FILE cannot be filtered out */ char buf[2000]; Field *field; void* ptr; - const NDBCOL *col= NULL; NdbValue value; NdbBlob *ndb_blob; buf[0]= 0; - field= table->field[f]; + field= table->field[f]; if (!(value= m_value[f]).ptr) { my_snprintf(buf, sizeof(buf), "not read"); @@ -2380,8 +2379,6 @@ void ha_ndbcluster::print_results() } ptr= field->ptr; - DBUG_DUMP("field->ptr", (char*)ptr, field->pack_length()); - col= tab->getColumn(f); if (! (field->flags & BLOB_FLAG)) { @@ -2407,9 +2404,9 @@ void ha_ndbcluster::print_results() goto print_value; } } - + print_value: - DBUG_PRINT("value", ("%u,%s: %s", f, col->getName(), buf)); + DBUG_PRINT("value", ("%u,%s: %s", f, field->field_name, buf)); } #endif DBUG_VOID_RETURN; From b3cd011eb6191852e2093645dad242b82f665e7d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 16:23:22 +0100 Subject: [PATCH 4/7] Fix so that master and master1 does not write to same .trace file mysql-test/mysql-test-run.sh: Adding master_id to tracefile name if it's set --- mysql-test/mysql-test-run.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.sh b/mysql-test/mysql-test-run.sh index f0c1d2ba1b5..c3b27dd9af2 100644 --- a/mysql-test/mysql-test-run.sh +++ b/mysql-test/mysql-test-run.sh @@ -441,7 +441,7 @@ while test $# -gt 0; do STRACE_CLIENT=1 ;; --debug) - EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \ + EXTRA_MASTER_MYSQLD_TRACE=" \ --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/master.trace" EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT \ --debug=d:t:i:A,$MYSQL_TEST_DIR/var/log/slave.trace" @@ -692,7 +692,6 @@ then fi MYSQL_CLIENT_TEST="$MYSQL_CLIENT_TEST --no-defaults --testcase --user=root --socket=$MASTER_MYSOCK --port=$MYSQL_TCP_PORT --silent" -MYSQL_DUMP="$MYSQL_DUMP --no-defaults -uroot --socket=$MASTER_MYSOCK --password=$DBPASSWD $EXTRA_MYSQLDUMP_OPT" MYSQL_BINLOG="$MYSQL_BINLOG --no-defaults --local-load=$MYSQL_TMP_DIR --character-sets-dir=$CHARSETSDIR $EXTRA_MYSQLBINLOG_OPT" MYSQL_FIX_SYSTEM_TABLES="$MYSQL_FIX_SYSTEM_TABLES --no-defaults --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD --basedir=$BASEDIR --bindir=$CLIENT_BINDIR --verbose" MYSQL="$MYSQL --host=localhost --port=$MASTER_MYPORT --socket=$MASTER_MYSOCK --user=root --password=$DBPASSWD" @@ -1150,6 +1149,11 @@ start_master() this_master_myport=$MASTER_MYPORT NOT_FIRST_MASTER_EXTRA_OPTS="" fi + if [ -n "$EXTRA_MASTER_MYSQLD_TRACE" ] + then + EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT \ + $EXTRA_MASTER_MYSQLD_TRACE$1" + fi if [ -z "$DO_BENCH" ] then master_args="--no-defaults --log-bin=$MYSQL_TEST_DIR/var/log/master-bin$1 \ From 4ebc8efc91caa480227d1f38f2fc5550041c4214 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 17:40:10 +0100 Subject: [PATCH 5/7] - added copyright header on top of the fill_help_tables.sql file (BUG#5772) - updated mysql-copyright-2 to properly convert this new header from GPL to commercial for the commercial distribution Build-tools/mysql-copyright-2: - added functionality to replace a copyright header in .sql files, too (needed for updating scripts/fill_help_tables.sql in the commercial source distribution) scripts/fill_help_tables.sh: - added copyright header on top of the fill_help_tables.sql file (BUG#5772) --- Build-tools/mysql-copyright-2 | 6 ++++++ scripts/fill_help_tables.sh | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index 2ea2e8ef441..972d5483d54 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -109,6 +109,12 @@ sub add_copyright $line_copyright= "! "; $end_copyright= ""; } + elsif ($ARGV =~ /\.sql$/) + { + $start_copyright="-- "; + $line_copyright= "-- "; + $end_copyright= ""; + } elsif ($ARGV =~ /\.asm$/) { $start_copyright="; "; diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index fbe7c597b34..fc0c684c2dc 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -493,6 +493,24 @@ sub print_insert_header } } +print < Date: Wed, 9 Feb 2005 17:49:43 +0100 Subject: [PATCH 6/7] - make sure to include the embedded test results in the source distribution --- mysql-test/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mysql-test/Makefile.am b/mysql-test/Makefile.am index d718935cca8..9426b20d09c 100644 --- a/mysql-test/Makefile.am +++ b/mysql-test/Makefile.am @@ -47,7 +47,7 @@ dist-hook: $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/t/*.test $(srcdir)/t/*.opt $(srcdir)/t/*.sh $(srcdir)/t/*.slave-mi $(distdir)/t $(INSTALL_DATA) $(srcdir)/include/*.inc $(distdir)/include - $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.require $(distdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(srcdir)/r/*.require $(distdir)/r $(INSTALL_DATA) $(srcdir)/std_data/Moscow_leap $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(srcdir)/std_data/*.000001 $(distdir)/std_data $(INSTALL_DATA) $(srcdir)/std_data/des_key_file $(distdir)/std_data @@ -65,7 +65,7 @@ install-data-local: $(INSTALL_DATA) $(srcdir)/t/*.opt $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.sh $(DESTDIR)$(testdir)/t $(INSTALL_DATA) $(srcdir)/t/*.slave-mi $(DESTDIR)$(testdir)/t - $(INSTALL_DATA) $(srcdir)/r/*.result $(DESTDIR)$(testdir)/r + $(INSTALL_DATA) $(srcdir)/r/*.result $(srcdir)/r/*.result.es $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/r/*.require $(DESTDIR)$(testdir)/r $(INSTALL_DATA) $(srcdir)/include/*.inc $(DESTDIR)$(testdir)/include $(INSTALL_DATA) $(srcdir)/std_data/*.dat $(DESTDIR)$(testdir)/std_data From 3afb61e17471d73e1993ab3123e816b629a25e51 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 9 Feb 2005 21:59:30 +0300 Subject: [PATCH 7/7] Fix bad 4.1->5.0 merge of Bug#6273 (mysql_config --libs when using bundled zlib) config/ac-macros/zlib.m4: Fix bad 4.1->5.0 merge --- config/ac-macros/zlib.m4 | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/config/ac-macros/zlib.m4 b/config/ac-macros/zlib.m4 index 6c92d561e5a..94a26f33dd3 100644 --- a/config/ac-macros/zlib.m4 +++ b/config/ac-macros/zlib.m4 @@ -3,6 +3,8 @@ dnl Define zlib paths to point at bundled zlib AC_DEFUN([MYSQL_USE_BUNDLED_ZLIB], [ ZLIB_INCLUDES="-I\$(top_srcdir)/zlib" ZLIB_LIBS="\$(top_builddir)/zlib/libz.la" +dnl Omit -L$pkglibdir as it's always in the list of mysql_config deps. +ZLIB_DEPS="-lz" zlib_dir="zlib" AC_SUBST([zlib_dir]) mysql_cv_compress="yes" @@ -44,8 +46,13 @@ dnl $prefix/lib. If zlib headers or binaries weren't found at $prefix, the dnl macro bails out with error. dnl dnl If the library was found, this function #defines HAVE_COMPRESS -dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include) and -dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz). +dnl and configure variables ZLIB_INCLUDES (i.e. -I/path/to/zlib/include), +dnl ZLIB_LIBS (i. e. -L/path/to/zlib/lib -lz) and ZLIB_DEPS which is +dnl used in mysql_config and is always the same as ZLIB_LIBS except to +dnl when we use the bundled zlib. In the latter case ZLIB_LIBS points to the +dnl build dir ($top_builddir/zlib), while mysql_config must point to the +dnl installation dir ($pkglibdir), so ZLIB_DEPS is set to point to +dnl $pkglibdir. AC_DEFUN([MYSQL_CHECK_ZLIB_WITH_COMPRESS], [ AC_MSG_CHECKING([for zlib compression library]) @@ -94,7 +101,11 @@ case $SYSTEM_TYPE in ;; esac if test "$mysql_cv_compress" = "yes"; then + if test "x$ZLIB_DEPS" = "x"; then + ZLIB_DEPS="$ZLIB_LIBS" + fi AC_SUBST([ZLIB_LIBS]) + AC_SUBST([ZLIB_DEPS]) AC_SUBST([ZLIB_INCLUDES]) AC_DEFINE([HAVE_COMPRESS], [1], [Define to enable compression support]) fi