summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorSinisa@sinisa.nasamreza.org <>2003-07-18 14:14:20 +0300
committerSinisa@sinisa.nasamreza.org <>2003-07-18 14:14:20 +0300
commit40756106a9333b56d10cebbf3413a09acc6e3622 (patch)
tree32f5d77d450770578673557993006106e75d3f5e /sql/sql_class.h
parent9e876442854d48115b8a2010edc04f8439f649f7 (diff)
parent1054633f74e001397b97c988772da40535f44f96 (diff)
downloadmariadb-git-40756106a9333b56d10cebbf3413a09acc6e3622.tar.gz
Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.0
into sinisa.nasamreza.org:/mnt/work/mysql-4.0
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 71b943b5d26..dcc839e13b1 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -30,20 +30,24 @@ class Slave_log_event;
enum enum_enable_or_disable { LEAVE_AS_IS, ENABLE, DISABLE };
enum enum_ha_read_modes { RFIRST, RNEXT, RPREV, RLAST, RKEY };
enum enum_duplicates { DUP_ERROR, DUP_REPLACE, DUP_IGNORE };
-enum enum_log_type { LOG_CLOSED, LOG_NORMAL, LOG_NEW, LOG_BIN };
+enum enum_log_type { LOG_CLOSED, LOG_TO_BE_OPENED, LOG_NORMAL, LOG_NEW, LOG_BIN};
enum enum_delay_key_write { DELAY_KEY_WRITE_NONE, DELAY_KEY_WRITE_ON,
DELAY_KEY_WRITE_ALL };
-// log info errors
+/* log info errors */
#define LOG_INFO_EOF -1
#define LOG_INFO_IO -2
#define LOG_INFO_INVALID -3
#define LOG_INFO_SEEK -4
-#define LOG_INFO_PURGE_NO_ROTATE -5
#define LOG_INFO_MEM -6
#define LOG_INFO_FATAL -7
#define LOG_INFO_IN_USE -8
+/* bitmap to SQL_LOG::close() */
+#define LOG_CLOSE_INDEX 1
+#define LOG_CLOSE_TO_BE_OPENED 2
+#define LOG_CLOSE_STOP_EVENT 4
+
struct st_relay_log_info;
typedef struct st_log_info
@@ -59,8 +63,10 @@ typedef struct st_log_info
class Log_event;
-class MYSQL_LOG {
+class MYSQL_LOG
+ {
private:
+ /* LOCK_log and LOCK_index are inited by init_pthread_objects() */
pthread_mutex_t LOCK_log, LOCK_index;
pthread_cond_t update_cond;
ulonglong bytes_written;
@@ -80,8 +86,7 @@ class MYSQL_LOG {
*/
volatile enum_log_type log_type;
enum cache_type io_cache_type;
- bool write_error,inited;
- bool no_rotate;
+ bool write_error, inited;
bool need_start_event;
bool no_auto_events; // for relay binlog
/*
@@ -123,6 +128,7 @@ public:
void init(enum_log_type log_type_arg,
enum cache_type io_cache_type_arg,
bool no_auto_events_arg, ulong max_size);
+ void init_pthread_objects();
void cleanup();
bool open(const char *log_name,enum_log_type log_type,
const char *new_name, const char *index_file_name_arg,
@@ -149,8 +155,7 @@ public:
int purge_logs(THD* thd, const char* to_log);
int purge_first_log(struct st_relay_log_info* rli);
bool reset_logs(THD* thd);
- // if we are exiting, we also want to close the index file
- void close(bool exiting = 0);
+ void close(uint exiting);
// iterating through the log index file
int find_log_pos(LOG_INFO* linfo, const char* log_name,
@@ -158,7 +163,6 @@ public:
int find_next_log(LOG_INFO* linfo, bool need_mutex);
int get_current_log(LOG_INFO* linfo);
uint next_file_id();
-
inline bool is_open() { return log_type != LOG_CLOSED; }
inline char* get_index_fname() { return index_file_name;}
inline char* get_log_fname() { return log_file_name; }