From ddf17601f3db71fc7bd8531fcbe3b3222e58e87e Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Feb 2004 09:11:46 +0100 Subject: potential problem fixed afer some reasoning --- sql/log.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index 8bd42d28e59..c73673d3552 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -202,7 +202,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, open_flags |= O_RDWR; else open_flags |= O_WRONLY; - + db[0]=0; open_count++; if ((file=my_open(log_file_name,open_flags, @@ -215,12 +215,15 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, case LOG_NORMAL: { char *end; + int len=my_snprintf(buff, sizeof(buff), #ifdef __NT__ - sprintf(buff, "%s, Version: %s, started with:\nTCP Port: %d, Named Pipe: %s\n", my_progname, server_version, mysql_port, mysql_unix_port); + "%s, Version: %s, started with:\nTCP Port: %d, Named Pipe: %s\n", #else - sprintf(buff, "%s, Version: %s, started with:\nTcp port: %d Unix socket: %s\n", my_progname,server_version,mysql_port,mysql_unix_port); + "%s, Version: %s, started with:\nTcp port: %d Unix socket: %s\n", #endif - end=strmov(strend(buff),"Time Id Command Argument\n"); + my_progname, server_version, mysql_port, mysql_unix_port); + end=strnmov(buff+len,"Time Id Command Argument\n", + sizeof(buff)-len); if (my_b_write(&log_file, (byte*) buff,(uint) (end-buff)) || flush_io_cache(&log_file)) goto err; @@ -231,7 +234,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, time_t skr=time(NULL); struct tm tm_tmp; localtime_r(&skr,&tm_tmp); - sprintf(buff,"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n", + my_snprintf(buff,sizeof(buff),"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n", my_progname,server_version, tm_tmp.tm_year % 100, tm_tmp.tm_mon+1, @@ -254,7 +257,7 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, index_file_name_arg= name; // Use same basename for index file opt= MY_UNPACK_FILENAME | MY_REPLACE_EXT; } - + if (!my_b_filelength(&log_file)) { /* -- cgit v1.2.1 From 68242939d818cf5d091d5dcf13e312994f423f9f Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 19 Feb 2004 22:04:31 +0200 Subject: Fixed usage of strxnmov() in recent changesets libmysql/libmysql.c: szPipeName -> pipe_name fixed usage of strxnmov() mysys/mf_tempfile.c: Fixed usage of strnxmov() Simple optimization mysys/my_tempnam.c: Fixed usage of strnxmov() Simple optimization sql/log.cc: simple optimization sql/mini_client.cc: szPipeName -> pipe_name fixed usage of strxnmov() sql/mysqld.cc: szPipeName -> pipe_name fixed usage of strxnmov() Fixed indentation --- sql/log.cc | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index c73673d3552..559d30f28ba 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -231,18 +231,21 @@ bool MYSQL_LOG::open(const char *log_name, enum_log_type log_type_arg, } case LOG_NEW: { + uint len; time_t skr=time(NULL); struct tm tm_tmp; + localtime_r(&skr,&tm_tmp); - my_snprintf(buff,sizeof(buff),"# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n", - my_progname,server_version, - tm_tmp.tm_year % 100, - tm_tmp.tm_mon+1, - tm_tmp.tm_mday, - tm_tmp.tm_hour, - tm_tmp.tm_min, - tm_tmp.tm_sec); - if (my_b_write(&log_file, (byte*) buff,(uint) strlen(buff)) || + len= my_snprintf(buff,sizeof(buff), + "# %s, Version: %s at %02d%02d%02d %2d:%02d:%02d\n", + my_progname,server_version, + tm_tmp.tm_year % 100, + tm_tmp.tm_mon+1, + tm_tmp.tm_mday, + tm_tmp.tm_hour, + tm_tmp.tm_min, + tm_tmp.tm_sec); + if (my_b_write(&log_file, (byte*) buff, len) || flush_io_cache(&log_file)) goto err; break; -- cgit v1.2.1 From ab8c3d89b8c7c10ccf2b006ea279637e382909a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 26 Mar 2004 19:25:22 +0100 Subject: Changing SET SQL_LOG_BIN so that it explicitely throws an error if user is not SUPER, instead of setting the value but ignoring it silently internally. mysql-test/r/rpl_temporary.result: result update mysql-test/t/rpl_temporary.test: adding test for privileges for SET SQL_LOG_BIN sql/log.cc: don't need to check SUPER sql/set_var.cc: refuse SET SQL_LOG_BIN if not SUPER sql/sql_insert.cc: Don't need to check SUPER --- sql/log.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index e25d853e2b6..6b091484a82 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1208,8 +1208,7 @@ bool MYSQL_LOG::write(Log_event* event_info) "do the involved tables match (to be implemented) binlog_[wild_]{do|ignore}_table?" (WL#1049)" */ - if ((thd && !(thd->options & OPTION_BIN_LOG) && - (thd->master_access & SUPER_ACL)) || + if ((thd && !(thd->options & OPTION_BIN_LOG)) || (local_db && !db_ok(local_db, binlog_do_db, binlog_ignore_db))) { VOID(pthread_mutex_unlock(&LOCK_log)); @@ -1556,11 +1555,7 @@ bool MYSQL_LOG::write(THD *thd,const char *query, uint query_length, int tmp_errno=0; char buff[80],*end; end=buff; - if (!(thd->options & OPTION_UPDATE_LOG) -#ifndef NO_EMBEDDED_ACCESS_CHECKS - && (thd->master_access & SUPER_ACL) -#endif - ) + if (!(thd->options & OPTION_UPDATE_LOG)) { VOID(pthread_mutex_unlock(&LOCK_log)); return 0; -- cgit v1.2.1 From 7873b89fc50d420a5f538a5b60faf79131f86c4f Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 5 Apr 2004 13:56:05 +0300 Subject: Fixed many compiler warnings Fixed bugs in group_concat with ORDER BY and DISTINCT (Bugs #2695, #3381 and #3319) Fixed crash when doing rollback in slave and the io thread catched up with the sql thread Set locked_in_memory properly include/mysql_com.h: Fixed compiler warning libmysqld/emb_qcache.cc: Removed not used variable libmysqld/lib_sql.cc: Removed not used variable myisam/mi_locking.c: Added comment myisam/mi_rnext.c: Fixed bug in concurrent insert myisam/mi_rprev.c: Simple optimization mysql-test/r/func_gconcat.result: New tests mysql-test/t/func_gconcat.test: New tests mysql-test/t/func_group.test: Cleanup sql-common/client.c: Removed compiler warning sql/derror.cc: Better comments sql/field.cc: Removed not used function/variable sql/field.h: Removed not needed variable sql/ha_innodb.cc: Removed not used function sql/item.cc: Fixed compiler warning sql/item_cmpfunc.cc: Fixed compiler warning sql/item_func.cc: Fixed compiler warning sql/item_geofunc.cc: Fixed compiler warning sql/item_sum.cc: Fixed bugs in group_concat and added more comments (Bugs #2695, #3381 and #3319) - field->abs_offset was not needed - Wrong assumption of field order in temporary table - Some not used variables removed - Added ORDER BY fields after argument fields so that code in sql_select.cc can move all fields to point to temporary tables, if needed. - Optimized loops sql/item_sum.h: Bug fixing and cleanup of group_concat() sql/log.cc: Removed wrong comment sql/log_event.cc: Removed compiler warning sql/mysqld.cc: Set locked_in_memory properly sql/protocol.cc: Removed compiler warning sql/set_var.cc: Code cleanup sql/slave.cc: Fixed crash when doing rollback in slave and the io thread catched up with the sql thread sql/sql_cache.cc: Removed compiler warnings sql/sql_derived.cc: Removed not used variable sql/sql_insert.cc: Removed compiler warnings sql/sql_lex.cc: Removed not used lable sql/sql_lex.h: Removed compiler warnings sql/sql_parse.cc: Removed compiler warnings sql/sql_prepare.cc: Removed compiler warnings sql/sql_select.cc: Removed not used variables Added function comments sql/sql_show.cc: Removed compiler warnings sql/sql_yacc.yy: Fix for ORDER BY handling in GROUP_CONCAT() --- sql/log.cc | 1 - 1 file changed, 1 deletion(-) (limited to 'sql/log.cc') diff --git a/sql/log.cc b/sql/log.cc index 6b091484a82..0cd9e7172c3 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -507,7 +507,6 @@ int MYSQL_LOG::find_log_pos(LOG_INFO *linfo, const char *log_name, RETURN VALUES 0 ok LOG_INFO_EOF End of log-index-file found - LOG_INFO_SEEK Could not allocate IO cache LOG_INFO_IO Got IO error while reading file */ -- cgit v1.2.1