Commit f0e04c1e authored by unknown's avatar unknown

my_b_write() needs to be replaced with my_b_append() for a SEQ_READ_APPEND

parent 3005ed88
...@@ -50,27 +50,27 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s) ...@@ -50,27 +50,27 @@ write_escaped_string(IO_CACHE *file, LEX_STRING *val_s)
*/ */
switch(*ptr) { switch(*ptr) {
case '\\': // escape character case '\\': // escape character
if (my_b_write(file, "\\\\", 2)) if (my_b_append(file, "\\\\", 2))
return TRUE; return TRUE;
break; break;
case '\n': // parameter value delimiter case '\n': // parameter value delimiter
if (my_b_write(file, "\\n", 2)) if (my_b_append(file, "\\n", 2))
return TRUE; return TRUE;
break; break;
case '\0': // problem for some string processing utilites case '\0': // problem for some string processing utilites
if (my_b_write(file, "\\0", 2)) if (my_b_append(file, "\\0", 2))
return TRUE; return TRUE;
break; break;
case 26: // problem for windows utilites (Ctrl-Z) case 26: // problem for windows utilites (Ctrl-Z)
if (my_b_write(file, "\\z", 2)) if (my_b_append(file, "\\z", 2))
return TRUE; return TRUE;
break; break;
case '\'': // list of string delimiter case '\'': // list of string delimiter
if (my_b_write(file, "\\\'", 2)) if (my_b_append(file, "\\\'", 2))
return TRUE; return TRUE;
break; break;
default: default:
if (my_b_write(file, ptr, 1)) if (my_b_append(file, ptr, 1))
return TRUE; return TRUE;
} }
} }
...@@ -106,7 +106,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter, ...@@ -106,7 +106,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
case FILE_OPTIONS_STRING: case FILE_OPTIONS_STRING:
{ {
LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset); LEX_STRING *val_s= (LEX_STRING *)(base + parameter->offset);
if (my_b_write(file, val_s->str, val_s->length)) if (my_b_append(file, val_s->str, val_s->length))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
break; break;
} }
...@@ -119,7 +119,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter, ...@@ -119,7 +119,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
case FILE_OPTIONS_ULONGLONG: case FILE_OPTIONS_ULONGLONG:
{ {
num.set(*((ulonglong *)(base + parameter->offset)), &my_charset_bin); num.set(*((ulonglong *)(base + parameter->offset)), &my_charset_bin);
if (my_b_write(file, num.ptr(), num.length())) if (my_b_append(file, num.ptr(), num.length()))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
break; break;
} }
...@@ -128,7 +128,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter, ...@@ -128,7 +128,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
ulonglong *val_i= (ulonglong *)(base + parameter->offset); ulonglong *val_i= (ulonglong *)(base + parameter->offset);
*old_version= (*val_i)++; *old_version= (*val_i)++;
num.set(*val_i, &my_charset_bin); num.set(*val_i, &my_charset_bin);
if (my_b_write(file, num.ptr(), num.length())) if (my_b_append(file, num.ptr(), num.length()))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
break; break;
} }
...@@ -141,7 +141,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter, ...@@ -141,7 +141,7 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
get_date(val_s->str, GETDATE_DATE_TIME|GETDATE_GMT|GETDATE_FIXEDLENGTH, get_date(val_s->str, GETDATE_DATE_TIME|GETDATE_GMT|GETDATE_FIXEDLENGTH,
tm); tm);
val_s->length= PARSE_FILE_TIMESTAMPLENGTH; val_s->length= PARSE_FILE_TIMESTAMPLENGTH;
if (my_b_write(file, val_s->str, PARSE_FILE_TIMESTAMPLENGTH)) if (my_b_append(file, val_s->str, PARSE_FILE_TIMESTAMPLENGTH))
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
break; break;
} }
...@@ -155,10 +155,10 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter, ...@@ -155,10 +155,10 @@ write_parameter(IO_CACHE *file, gptr base, File_option *parameter,
{ {
num.set((ulonglong)str->length, &my_charset_bin); num.set((ulonglong)str->length, &my_charset_bin);
// ',' after string to detect list continuation // ',' after string to detect list continuation
if ((!first && my_b_write(file, " ", 1)) || if ((!first && my_b_append(file, " ", 1)) ||
my_b_write(file, "\'", 1) || my_b_append(file, "\'", 1) ||
my_b_write(file, str->str, str->length) || my_b_append(file, str->str, str->length) ||
my_b_write(file, "\'", 1)) my_b_append(file, "\'", 1))
{ {
DBUG_RETURN(TRUE); DBUG_RETURN(TRUE);
} }
...@@ -222,18 +222,18 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, ...@@ -222,18 +222,18 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name,
goto err_w_file; goto err_w_file;
// write header (file signature) // write header (file signature)
if (my_b_write(&file, "TYPE=", 5) || if (my_b_append(&file, "TYPE=", 5) ||
my_b_write(&file, type->str, type->length) || my_b_append(&file, type->str, type->length) ||
my_b_write(&file, "\n", 1)) my_b_append(&file, "\n", 1))
goto err_w_file; goto err_w_file;
// write parameters to temporary file // write parameters to temporary file
for (File_option *param= parameters; param->name.str; param++) for (File_option *param= parameters; param->name.str; param++)
{ {
if (my_b_write(&file, param->name.str, param->name.length) || if (my_b_append(&file, param->name.str, param->name.length) ||
my_b_write(&file, "=", 1) || my_b_append(&file, "=", 1) ||
write_parameter(&file, base, param, &old_version) || write_parameter(&file, base, param, &old_version) ||
my_b_write(&file, "\n", 1)) my_b_append(&file, "\n", 1))
goto err_w_cache; goto err_w_cache;
} }
......
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