diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-12-18 16:44:24 -0200 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2009-12-18 16:44:24 -0200 |
commit | 61ae92889808c3c38c5e449e36fc30f89e8e3f23 (patch) | |
tree | 8cb3e4210dd5da0c3cec217f0e5008ee9104715b /sql | |
parent | f815246486444ca2dc5d408099439e1d973d3a7b (diff) | |
parent | 06a1df91813ea2c39f7312bcf8af972c7e8a926f (diff) | |
download | mariadb-git-61ae92889808c3c38c5e449e36fc30f89e8e3f23.tar.gz |
Manual merge.
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 8 | ||||
-rw-r--r-- | sql/sp_pcontext.h | 2 | ||||
-rw-r--r-- | sql/sql_acl.cc | 4 | ||||
-rw-r--r-- | sql/sql_connect.cc | 2 | ||||
-rw-r--r-- | sql/sql_table.cc | 2 |
5 files changed, 9 insertions, 9 deletions
diff --git a/sql/log.cc b/sql/log.cc index 2fd29588922..36d57271a7d 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -2420,7 +2420,7 @@ const char *MYSQL_LOG::generate_name(const char *log_name, { char *p= fn_ext(log_name); uint length= (uint) (p - log_name); - strmake(buff, log_name, min(length, FN_REFLEN)); + strmake(buff, log_name, min(length, FN_REFLEN-1)); return (const char*)buff; } return log_name; @@ -3669,7 +3669,7 @@ int MYSQL_BIN_LOG::purge_logs_before_date(time_t purge_time) if (stat_area.st_mtime < purge_time) strmake(to_log, log_info.log_file_name, - sizeof(log_info.log_file_name)); + sizeof(log_info.log_file_name) - 1); else break; } @@ -5021,11 +5021,11 @@ bool flush_error_log() if (opt_error_log) { char err_renamed[FN_REFLEN], *end; - end= strmake(err_renamed,log_error_file,FN_REFLEN-4); + end= strmake(err_renamed,log_error_file,FN_REFLEN-5); strmov(end, "-old"); VOID(pthread_mutex_lock(&LOCK_error_log)); #ifdef __WIN__ - char err_temp[FN_REFLEN+4]; + char err_temp[FN_REFLEN+5]; /* On Windows is necessary a temporary file for to rename the current error file. diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h index 3145ba2fea4..75e55880e60 100644 --- a/sql/sp_pcontext.h +++ b/sql/sp_pcontext.h @@ -71,7 +71,7 @@ typedef struct sp_label typedef struct sp_cond_type { enum { number, state, warning, notfound, exception } type; - char sqlstate[6]; + char sqlstate[SQLSTATE_LENGTH+1]; uint mysqlerr; } sp_cond_type_t; diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc index b30c012e633..7d8f8ea71b3 100644 --- a/sql/sql_acl.cc +++ b/sql/sql_acl.cc @@ -1061,7 +1061,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh, *mqh= acl_user->user_resource; if (acl_user->host.hostname) - strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME); + strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME - 1); else *sctx->priv_host= 0; } @@ -1162,7 +1162,7 @@ bool acl_getroot_no_password(Security_context *sctx, char *user, char *host, sctx->priv_user= acl_user->user ? user : (char *) ""; if (acl_user->host.hostname) - strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME); + strmake(sctx->priv_host, acl_user->host.hostname, MAX_HOSTNAME - 1); else *sctx->priv_host= 0; } diff --git a/sql/sql_connect.cc b/sql/sql_connect.cc index bb4ba2bf21b..16f11fe22c4 100644 --- a/sql/sql_connect.cc +++ b/sql/sql_connect.cc @@ -705,7 +705,7 @@ static int check_connection(THD *thd) ulong server_capabilites; { /* buff[] needs to big enough to hold the server_version variable */ - char buff[SERVER_VERSION_LENGTH + SCRAMBLE_LENGTH + 64]; + char buff[SERVER_VERSION_LENGTH + 1 + SCRAMBLE_LENGTH + 1 + 64]; server_capabilites= CLIENT_BASIC_FLAGS; if (opt_using_transactions) diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 869ae42c98c..3b7354111ba 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -2575,7 +2575,7 @@ mysql_prepare_create_table(THD *thd, HA_CREATE_INFO *create_info, !(sql_field->charset= get_charset_by_csname(sql_field->charset->csname, MY_CS_BINSORT,MYF(0)))) { - char tmp[64]; + char tmp[65]; strmake(strmake(tmp, save_cs->csname, sizeof(tmp)-4), STRING_WITH_LEN("_bin")); my_error(ER_UNKNOWN_COLLATION, MYF(0), tmp); |