From f8e9f31e933c9fb36fb6be55a5984d7fb23d836f Mon Sep 17 00:00:00 2001 From: "heikki@hundin.mysql.fi" <> Date: Fri, 21 Nov 2003 17:01:35 +0200 Subject: [PATCH] os0file.c: Fix the OS error 2 reported by Miguel and Mark in Windows crash recovery: a * had been forgotten from the path in directory scanning ha_innodb.cc: Set default directory in fil0fil.c right if we are running the Embedded Server Library, where the default dir of the process is not necessarily the MySQL datadir --- innobase/os/os0file.c | 2 +- sql/ha_innodb.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index b6d4eba9f9b..e5dd8679163 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -409,7 +409,7 @@ os_file_opendir( ut_a(strlen(dirname) < OS_FILE_MAX_PATH); strcpy(path, dirname); - strcpy(path + strlen(path), "\\"); + strcpy(path + strlen(path), "\\*"); /* Note that in Windows opening the 'directory stream' also retrieves the first entry in the directory. Since it is '.', that is no problem, diff --git a/sql/ha_innodb.cc b/sql/ha_innodb.cc index f79c5b55927..8a3b1b7f4b6 100644 --- a/sql/ha_innodb.cc +++ b/sql/ha_innodb.cc @@ -75,6 +75,7 @@ extern "C" { #include "../innobase/include/btr0cur.h" #include "../innobase/include/btr0btr.h" #include "../innobase/include/fsp0fsp.h" +#include "../innobase/include/fil0fil.h" } #define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */ @@ -738,6 +739,7 @@ innobase_init(void) if (mysql_embedded) { default_path = mysql_real_data_home; + fil_path_to_mysql_datadir = mysql_real_data_home; } else { /* It's better to use current lib, to keep paths short */ current_dir[0] = FN_CURLIB;