diff options
author | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-06-19 13:24:43 +0500 |
---|---|---|
committer | Sergey Glukhov <Sergey.Glukhov@sun.com> | 2009-06-19 13:24:43 +0500 |
commit | c92abdc2a0d8a33aef47ca9f3114a0bceb5650a7 (patch) | |
tree | 2f3842512db3a74bdddfc82a19b3cdcbc3cf0b1f /sql/ha_ndbcluster_binlog.cc | |
parent | f6ea8b7675275ac40bd4ae7d210b824a6de9d45a (diff) | |
download | mariadb-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/ha_ndbcluster_binlog.cc')
-rw-r--r-- | sql/ha_ndbcluster_binlog.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sql/ha_ndbcluster_binlog.cc b/sql/ha_ndbcluster_binlog.cc index a0c74b60f84..f705af8bf47 100644 --- a/sql/ha_ndbcluster_binlog.cc +++ b/sql/ha_ndbcluster_binlog.cc @@ -788,7 +788,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd) if (g_ndb_cluster_connection->get_no_ready() <= 0) DBUG_RETURN(0); - char buf[1024], *end; + char buf[1024 + 1], *end; if (ndb_extra_logging) sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_APPLY_TABLE); @@ -798,7 +798,7 @@ static int ndbcluster_create_ndb_apply_status_table(THD *thd) if so, remove it since there is none in Ndb */ { - build_table_filename(buf, sizeof(buf), + build_table_filename(buf, sizeof(buf) - 1, NDB_REP_DB, NDB_APPLY_TABLE, reg_ext, 0); my_delete(buf, MYF(0)); } @@ -846,7 +846,7 @@ static int ndbcluster_create_schema_table(THD *thd) if (g_ndb_cluster_connection->get_no_ready() <= 0) DBUG_RETURN(0); - char buf[1024], *end; + char buf[1024 + 1], *end; if (ndb_extra_logging) sql_print_information("NDB: Creating " NDB_REP_DB "." NDB_SCHEMA_TABLE); @@ -856,7 +856,7 @@ static int ndbcluster_create_schema_table(THD *thd) if so, remove it since there is none in Ndb */ { - build_table_filename(buf, sizeof(buf), + build_table_filename(buf, sizeof(buf) - 1, NDB_REP_DB, NDB_SCHEMA_TABLE, reg_ext, 0); my_delete(buf, MYF(0)); } @@ -1321,8 +1321,8 @@ int ndbcluster_log_schema_op(THD *thd, NDB_SHARE *share, NDB_SCHEMA_OBJECT *ndb_schema_object; { - char key[FN_REFLEN]; - build_table_filename(key, sizeof(key), db, table_name, "", 0); + char key[FN_REFLEN + 1]; + build_table_filename(key, sizeof(key) - 1, db, table_name, "", 0); ndb_schema_object= ndb_get_schema_object(key, TRUE, FALSE); } @@ -1674,7 +1674,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, if (is_remote_change && is_online_alter_table) { const char *tabname= table_share->table_name.str; - char key[FN_REFLEN]; + char key[FN_REFLEN + 1]; uchar *data= 0, *pack_data= 0; size_t length, pack_length; int error; @@ -1683,7 +1683,7 @@ ndb_handle_schema_change(THD *thd, Ndb *ndb, NdbEventOperation *pOp, DBUG_PRINT("info", ("Detected frm change of table %s.%s", dbname, tabname)); - build_table_filename(key, FN_LEN-1, dbname, tabname, NullS, 0); + build_table_filename(key, FN_LEN - 1, dbname, tabname, NullS, 0); /* If the there is no local table shadowing the altered table and it has an frm that is different than the one on disk then @@ -1926,8 +1926,8 @@ ndb_binlog_thread_handle_schema_event(THD *thd, Ndb *ndb, break; case SOT_TRUNCATE_TABLE: { - char key[FN_REFLEN]; - build_table_filename(key, sizeof(key), + char key[FN_REFLEN + 1]; + build_table_filename(key, sizeof(key) - 1, schema->db, schema->name, "", 0); /* ndb_share reference temporary, free below */ NDB_SHARE *share= get_share(key, 0, FALSE, FALSE); @@ -2173,8 +2173,8 @@ ndb_binlog_thread_handle_schema_event_post_epoch(THD *thd, int log_query= 0; { enum SCHEMA_OP_TYPE schema_type= (enum SCHEMA_OP_TYPE)schema->type; - char key[FN_REFLEN]; - build_table_filename(key, sizeof(key), schema->db, schema->name, "", 0); + char key[FN_REFLEN + 1]; + build_table_filename(key, sizeof(key) - 1, schema->db, schema->name, "", 0); if (schema_type == SOT_CLEAR_SLOCK) { pthread_mutex_lock(&ndbcluster_mutex); @@ -2508,8 +2508,8 @@ ndb_rep_event_name(String *event_name,const char *db, const char *tbl) bool ndbcluster_check_if_local_table(const char *dbname, const char *tabname) { - char key[FN_REFLEN]; - char ndb_file[FN_REFLEN]; + char key[FN_REFLEN + 1]; + char ndb_file[FN_REFLEN + 1]; DBUG_ENTER("ndbcluster_check_if_local_table"); build_table_filename(key, FN_LEN-1, dbname, tabname, reg_ext, 0); @@ -2534,9 +2534,9 @@ ndbcluster_check_if_local_tables_in_db(THD *thd, const char *dbname) DBUG_PRINT("info", ("Looking for files in directory %s", dbname)); LEX_STRING *tabname; List<LEX_STRING> files; - char path[FN_REFLEN]; + char path[FN_REFLEN + 1]; - build_table_filename(path, sizeof(path), dbname, "", "", 0); + build_table_filename(path, sizeof(path) - 1, dbname, "", "", 0); if (find_files(thd, &files, dbname, path, NullS, 0) != FIND_FILES_OK) { DBUG_PRINT("info", ("Failed to find files")); |