summaryrefslogtreecommitdiff
path: root/sql/sql_rename.cc
diff options
context:
space:
mode:
authorSergey Glukhov <Sergey.Glukhov@sun.com>2009-06-19 13:24:43 +0500
committerSergey Glukhov <Sergey.Glukhov@sun.com>2009-06-19 13:24:43 +0500
commitc92abdc2a0d8a33aef47ca9f3114a0bceb5650a7 (patch)
tree2f3842512db3a74bdddfc82a19b3cdcbc3cf0b1f /sql/sql_rename.cc
parentf6ea8b7675275ac40bd4ae7d210b824a6de9d45a (diff)
downloadmariadb-git-c92abdc2a0d8a33aef47ca9f3114a0bceb5650a7.tar.gz
Bug#44834 strxnmov is expected to behave as you'd expect
The problem: described in the bug report. The fix: --increase buffers where it's necessary (buffers which are used in stxnmov) --decrease buffer lengths which are used
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r--sql/sql_rename.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 7cc9130cc4a..0e0b8eb60b9 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -244,7 +244,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
char *new_table_alias, bool skip_error)
{
int rc= 1;
- char name[FN_REFLEN];
+ char name[FN_REFLEN + 1];
const char *new_alias, *old_alias;
frm_type_enum frm_type;
enum legacy_db_type table_type;
@@ -263,14 +263,14 @@ do_rename(THD *thd, TABLE_LIST *ren_table, char *new_db, char *new_table_name,
}
DBUG_ASSERT(new_alias);
- build_table_filename(name, sizeof(name),
+ build_table_filename(name, sizeof(name) - 1,
new_db, new_alias, reg_ext, 0);
if (!access(name,F_OK))
{
my_error(ER_TABLE_EXISTS_ERROR, MYF(0), new_alias);
DBUG_RETURN(1); // This can't be skipped
}
- build_table_filename(name, sizeof(name),
+ build_table_filename(name, sizeof(name) - 1,
ren_table->db, old_alias, reg_ext, 0);
frm_type= mysql_frm_type(thd, name, &table_type);