From f97d76ac1cf7a46d49a293da2cd4b68e903fd4ca Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 23 Mar 2006 23:09:34 +0100 Subject: [PATCH 1/2] Bug#18474 Unlistable directories yield no info from information_schema, part2 - Make the windows implementation of 'my_dir' behave like the default implementation mysys/my_lib.c: If 'findfirst' returns EINVAL, just continue and return 0 files to read in this dir. --- mysys/my_lib.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/mysys/my_lib.c b/mysys/my_lib.c index 4ca343064d3..522fa56cbf1 100644 --- a/mysys/my_lib.c +++ b/mysys/my_lib.c @@ -398,14 +398,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags) tmp_file[2]='*'; tmp_file[3]='\0'; -#ifdef __BORLANDC__ - if ((handle= findfirst(tmp_path,&find,0)) == -1L) - goto error; -#else - if ((handle=_findfirst(tmp_path,&find)) == -1L) - goto error; -#endif - if (!(buffer= my_malloc(ALIGN_SIZE(sizeof(MY_DIR)) + ALIGN_SIZE(sizeof(DYNAMIC_ARRAY)) + sizeof(MEM_ROOT), MyFlags))) @@ -425,7 +417,23 @@ MY_DIR *my_dir(const char *path, myf MyFlags) /* MY_DIR structure is allocated and completly initialized at this point */ result= (MY_DIR*)buffer; - + +#ifdef __BORLANDC__ + if ((handle= findfirst(tmp_path,&find,0)) == -1L) +#else + if ((handle=_findfirst(tmp_path,&find)) == -1L) +#endif + { + DBUG_PRINT("info", ("find_first returned error")); + if (errno != EINVAL) + goto error; + /* + Could not read the directory, no read access. + Probably because by "chmod -r". + continue and return zero files in dir + */ + } + do { #ifdef __BORLANDC__ From a1c46189b88158bdabfa864c9a62a41b21e7f0c2 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Apr 2006 09:49:32 +0200 Subject: [PATCH 2/2] Add option --debugger=NAME and --client-debugger=NAME. Add support for "--debugger=windbg" and "--debugger=vcexpress" --- mysql-test/mysql-test-run.pl | 55 ++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 23aeb004c71..389128a7ecf 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -227,6 +227,8 @@ our $opt_client_ddd; our $opt_manual_gdb; our $opt_manual_ddd; our $opt_manual_debug; +our $opt_debugger; +our $opt_client_debugger; our $opt_gprof; our $opt_gprof_dir; @@ -592,6 +594,8 @@ sub command_line_setup () { 'manual-debug' => \$opt_manual_debug, 'ddd' => \$opt_ddd, 'client-ddd' => \$opt_client_ddd, + 'debugger=s' => \$opt_debugger, + 'client-debugger=s' => \$opt_client_debugger, 'strace-client' => \$opt_strace_client, 'master-binary=s' => \$exe_master_mysqld, 'slave-binary=s' => \$exe_slave_mysqld, @@ -774,9 +778,10 @@ sub command_line_setup () { # Check debug related options if ( $opt_gdb || $opt_client_gdb || $opt_ddd || $opt_client_ddd || - $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug) + $opt_manual_gdb || $opt_manual_ddd || $opt_manual_debug || + $opt_debugger || $opt_client_debugger ) { - # Indicate that we are using debugger + # Indicate that we are using debugger $glob_debugger= 1; # Increase timeouts $opt_wait_timeout= 300; @@ -2556,6 +2561,10 @@ sub mysqld_start ($$$$$) { { ddd_arguments(\$args, \$exe, "$type"."_$idx"); } + elsif ( $opt_debugger ) + { + debugger_arguments(\$args, \$exe, "$type"."_$idx"); + } elsif ( $opt_manual_debug ) { print "\nStart $type in your debugger\n" . @@ -3052,6 +3061,10 @@ sub run_mysqltest ($) { { ddd_arguments(\$args, \$exe, "client"); } + elsif ( $opt_client_debugger ) + { + debugger_arguments(\$args, \$exe, "client"); + } if ($glob_use_libtool and $opt_valgrind) { @@ -3204,6 +3217,42 @@ sub ddd_arguments { mtr_add_arg($$args, "$save_exe"); } + +# +# Modify the exe and args so that program is run in the selected debugger +# +sub debugger_arguments { + my $args= shift; + my $exe= shift; + my $debugger= $opt_debugger || $opt_client_debugger; + + if ( $debugger eq "vcexpress" or $debugger eq "vc") + { + # vc[express] /debugexe exe arg1 .. argn + + # Add /debugexe and name of the exe before args + unshift(@$$args, "/debugexe"); + unshift(@$$args, "$$exe"); + + } + elsif ( $debugger eq "windbg" ) + { + # windbg exe arg1 .. argn + + # Add name of the exe before args + unshift(@$$args, "$$exe"); + + } + else + { + mtr_error("Unknown argument \"$debugger\" passed to --debugger"); + } + + # Set exe to debuggername + $$exe= $debugger; +} + + # # Modify the exe and args so that program is run in valgrind # @@ -3311,6 +3360,8 @@ Options for debugging the product client-gdb Start mysqltest client in gdb ddd Start mysqld in ddd client-ddd Start mysqltest client in ddd + debugger=NAME Start mysqld in the selected debugger + client-debugger=NAME Start mysqltest in the selected debugger strace-client FIXME master-binary=PATH Specify the master "mysqld" to use slave-binary=PATH Specify the slave "mysqld" to use