Commit 7c0b76a8 authored by unknown's avatar unknown
Browse files

BUG#20839 Illegal error code: 155 returned downgrading from 5.1.12-> 5.1.11

post-review fixups - magnus suggested creating dynstr_trunc instead of doing
it manually.


client/mysqldump.c:
  use dynstr_trunc instead of manually fiddling with the string
include/my_sys.h:
  add dynstr_trunc
mysys/string.c:
  add dynstr_trunc
parent 5fd7e5e3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -2783,7 +2783,7 @@ static int dump_tablespaces_for_tables(char *db, char **table_names, int tables)
    dynstr_append(&where, name_buff);
    dynstr_append(&where, "',");
  }
  where.str[--where.length]= '\0';
  dynstr_trunc(&where, 1);
  dynstr_append(&where,"))");

  DBUG_PRINT("info",("Dump TS for Tables where: %s",where));
@@ -2813,7 +2813,7 @@ static int dump_tablespaces_for_databases(char** databases)
    dynstr_append(&where, db_name_buff);
    dynstr_append(&where, "',");
  }
  where.str[--where.length]='\0';
  dynstr_trunc(&where, 1);
  dynstr_append(&where,"))");

  DBUG_PRINT("info",("Dump TS for DBs where: %s",where));
+1 −0
Original line number Diff line number Diff line
@@ -778,6 +778,7 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
			  uint length);
extern my_bool dynstr_set(DYNAMIC_STRING *str, const char *init_str);
extern my_bool dynstr_realloc(DYNAMIC_STRING *str, ulong additional_size);
extern my_bool dynstr_trunc(DYNAMIC_STRING *str, int n);
extern void dynstr_free(DYNAMIC_STRING *str);
#ifdef HAVE_MLOCK
extern byte *my_malloc_lock(uint length,myf flags);
+6 −0
Original line number Diff line number Diff line
@@ -115,6 +115,12 @@ my_bool dynstr_append_mem(DYNAMIC_STRING *str, const char *append,
  return FALSE;
}

my_bool dynstr_trunc(DYNAMIC_STRING *str, int n)
{
  str->length-=n;
  str->str[str->length]= '\0';
  return FALSE;
}

void dynstr_free(DYNAMIC_STRING *str)
{