summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <heikki@donna.mysql.fi>2001-08-13 18:37:00 +0300
committerunknown <heikki@donna.mysql.fi>2001-08-13 18:37:00 +0300
commitedccd23fcebaf7a3e99c535bb364b615539fef9e (patch)
treedc09004912f361fb61f2cd3ab7819721f6099761
parentf6751dd8db31161f6eaa0a80aa8cf1b8f9c930c3 (diff)
downloadmariadb-git-edccd23fcebaf7a3e99c535bb364b615539fef9e.tar.gz
row0sel.c Fix a memory freeing bug when a row which contains an externally stored long field in the middle of the row is fetched in a SELECT
srv0start.c Allow drive name followed by a ':' in a data file path ha_innobase.cc Allow drive name followed by a ':' in a data file path sql/ha_innobase.cc: Allow drive name followed by a ':' in a data file path innobase/srv/srv0start.c: Allow drive name followed by a ':' in a data file path innobase/row/row0sel.c: Fix a memory freeing bug when a row which contains an externally stored long field in the middle of the row is fetched in a SELECT
-rw-r--r--innobase/row/row0sel.c1
-rw-r--r--innobase/srv/srv0start.c10
-rw-r--r--sql/ha_innobase.cc13
3 files changed, 16 insertions, 8 deletions
diff --git a/innobase/row/row0sel.c b/innobase/row/row0sel.c
index b74bd29a89e..0ad6b7084e2 100644
--- a/innobase/row/row0sel.c
+++ b/innobase/row/row0sel.c
@@ -2103,6 +2103,7 @@ row_sel_store_mysql_rec(
if (extern_field_heap) {
mem_heap_free(extern_field_heap);
+ extern_field_heap = NULL;
}
} else {
mysql_rec[templ->mysql_null_byte_offset] |=
diff --git a/innobase/srv/srv0start.c b/innobase/srv/srv0start.c
index a79a808ba2e..b3f5dbb28b5 100644
--- a/innobase/srv/srv0start.c
+++ b/innobase/srv/srv0start.c
@@ -141,21 +141,21 @@ srv_normalize_path_for_win(
}
/*************************************************************************
-Adds a slash or a backslash to the end of a string if it is missing. */
+Adds a slash or a backslash to the end of a string if it is missing
+and the string is not empty. */
static
char*
srv_add_path_separator_if_needed(
/*=============================*/
- /* out, own: string which has the separator */
+ /* out, own: string which has the separator if the
+ string is not empty */
char* str) /* in: null-terminated character string */
{
char* out_str;
if (ut_strlen(str) == 0) {
- out_str = ut_malloc(2);
- sprintf(out_str, "%s", SRV_PATH_SEPARATOR);
- return(out_str);
+ return(str);
}
if (str[ut_strlen(str) - 1] == SRV_PATH_SEPARATOR[0]) {
diff --git a/sql/ha_innobase.cc b/sql/ha_innobase.cc
index 7bd71363915..d0cb8af906a 100644
--- a/sql/ha_innobase.cc
+++ b/sql/ha_innobase.cc
@@ -259,12 +259,15 @@ innobase_parse_data_file_paths_and_sizes(void)
str = innobase_data_file_path;
/* First calculate the number of data files and check syntax:
- path:size[M];path:size[M]... */
+ path:size[M];path:size[M]... . Note that a Windows path may
+ contain a drive name and a ':'. */
while (*str != '\0') {
path = str;
- while (*str != ':' && *str != '\0') {
+ while ((*str != ':' && *str != '\0')
+ || (*str == ':'
+ && (*(str + 1) == '\\' || *(str + 1) == '/'))) {
str++;
}
@@ -335,7 +338,11 @@ innobase_parse_data_file_paths_and_sizes(void)
while (*str != '\0') {
path = str;
- while (*str != ':' && *str != '\0') {
+ /* Note that we must ignore the ':' in a Windows path */
+
+ while ((*str != ':' && *str != '\0')
+ || (*str == ':'
+ && (*(str + 1) == '\\' || *(str + 1) == '/'))) {
str++;
}