summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-09-05 16:17:08 +0300
committerunknown <monty@mashka.mysql.fi>2002-09-05 16:17:08 +0300
commit8f2482d283646d61c6614df39d252e1fd3713f7c (patch)
tree103a1aadee6000a5d09b0ba7c1de75797fb958fa /sql/log.cc
parent34f299d408e6993cbf9f688aa97a83e4c2932efe (diff)
downloadmariadb-git-8f2482d283646d61c6614df39d252e1fd3713f7c.tar.gz
Fixed searching after ssl directories.
Fixed that GRANT ... REQUIRE options are not forgot when doing new GRANT Changed fn_ext to point at first '.' after directory. FLUSH LOGS removed numerical extension for all future update logs. Fixed the mysqld --help reports right values for --datadir and --bind-address --log-binary=a.b.c now properly strips of .b.c Fix that one can DROP UDF functions that was not loaded at startup Made AND optional in REQUIRE Added REQUIRE NONE BitKeeper/deleted/.del-CodingStyle~1ba7ff62d4cd0ea: Delete: vio/docs/CodingStyle BitKeeper/deleted/.del-COPYING.dbug~ca0c017a4d7e8609: Delete: vio/docs/COPYING.dbug BitKeeper/deleted/.del-COPYING.mysql~471498c82977cd3a: Delete: vio/docs/COPYING.mysql BitKeeper/deleted/.del-README~947354991dc882f8: Delete: vio/docs/README Docs/manual.texi: Changelog acinclude.m4: Fixed searching after ssl directories. client/Makefile.am: Moved openssl include to avoid problem with installed readline include/Makefile.am: Install my_global.h include/violite.h: Fixed that GRANT ... REQUIRE options are not forgot when doing new grant libmysqld/examples/Makefile.am: Moved openssl include to avoid problem with installed readline mysql-test/mysql-test-run.sh: Improved 'which' handling to give error if command is not found mysys/mf_fn_ext.c: Changed fn_ext to point at first '.' after directory. sql/Makefile.am: More comments sql/lex.h: Added NONE as keyword sql/log.cc: FLUSH LOGS removed numerical extension for all future update logs. Simple code cleanup sql/mysqld.cc: Fixed the --help reports right values for --datadir and --bind-address --log-binary=a.b.c now properly strips of .b.c Removed option --skip-external-locking (not needed as this is automatic) sql/repl_failsafe.cc: Moved some common THD initalization to store_globals() sql/slave.cc: Moved openssl include to avoid problem with installed readline sql/sql_acl.cc: Moved openssl include to avoid problem with installed readline sql/sql_acl.h: Updated function prototypes sql/sql_base.cc: Added comment sql/sql_class.cc: Moved openssl include to avoid problem with installed readline. Changed THD::thd to make things work for main thread. sql/sql_class.h: Fixed wrongly removed line (fixes compiler problem on MacOSX) sql/sql_insert.cc: Moved openssl include to avoid problem with installed readline sql/sql_lex.cc: Moved save_to_cache_query=0 to udf detection function to make sql_yacc.yy simpler sql/sql_lex.h: Indentation cleanup sql/sql_parse.cc: Moved openssl include to avoid problem with installed readline. Added THD argument to acl_reload() sql/sql_repl.h: Made opt_bin_logname static sql/sql_udf.cc: Fix that one can DROP UDF functions that was not loaded at startup sql/sql_yacc.yy: made AND optional in REQUIRE Added REQUIRE NONE Fixed that old SSL options are not forgotten when doing new GRANT. sql/udf_example.cc: Improved comments
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc28
1 files changed, 16 insertions, 12 deletions
diff --git a/sql/log.cc b/sql/log.cc
index ad06eb6e90c..e42d9ffa2fa 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -108,11 +108,9 @@ MYSQL_LOG::~MYSQL_LOG()
int MYSQL_LOG::generate_new_name(char *new_name, const char *log_name)
{
- if (log_type == LOG_NORMAL)
- fn_format(new_name,log_name,mysql_data_home,"",4);
- else
+ fn_format(new_name,log_name,mysql_data_home,"",4);
+ if (log_type != LOG_NORMAL)
{
- fn_format(new_name,log_name,mysql_data_home,"",4);
if (!fn_ext(log_name)[0])
{
if (find_uniq_filename(new_name))
@@ -798,7 +796,8 @@ void MYSQL_LOG::new_file(bool need_lock)
safe_mutex_assert_owner(&LOCK_log);
safe_mutex_assert_owner(&LOCK_index);
- new_name_ptr= name; // Reuse old name if not binlog
+ // Reuse old name if not binlog and not update log
+ new_name_ptr= name;
/*
Only rotate open logs that are marked non-rotatable
@@ -806,12 +805,17 @@ void MYSQL_LOG::new_file(bool need_lock)
*/
if (!no_rotate)
{
+ /*
+ If user hasn't specified an extension, generate a new log name
+ We have to do this here and not in open as we want to store the
+ new file name in the current binary log file.
+ */
+ if (generate_new_name(new_name, name))
+ goto end;
+ new_name_ptr=new_name;
+
if (log_type == LOG_BIN)
{
- if (generate_new_name(new_name, name))
- goto end; /* Error; Continue using old log file */
-
- new_name_ptr=new_name;
if (!no_auto_events)
{
/*
@@ -823,9 +827,9 @@ void MYSQL_LOG::new_file(bool need_lock)
r.set_log_pos(this);
/*
- Becasue this log rotation could have been initiated by a master of
+ Because this log rotation could have been initiated by a master of
the slave running with log-bin, we set the flag on rotate
- event to prevent inifinite log rotation loop
+ event to prevent infinite log rotation loop
*/
if (thd->slave_thread)
r.flags|= LOG_EVENT_FORCED_ROTATE_F;
@@ -833,7 +837,7 @@ void MYSQL_LOG::new_file(bool need_lock)
bytes_written += r.get_event_len();
}
/*
- Update needs to be signaled even if there is no rotate event
+ Update needs to be signalled even if there is no rotate event
log rotation should give the waiting thread a signal to
discover EOF and move on to the next log.
*/