Commit 7dac7062 authored by monty@hundin.mysql.fi's avatar monty@hundin.mysql.fi

Changed relay_log_space to ulonglong

Removed compiler warnings.
parent d3484f88
...@@ -123,7 +123,9 @@ if ($opt_stage == 0 && ! $opt_use_old_distribution) ...@@ -123,7 +123,9 @@ if ($opt_stage == 0 && ! $opt_use_old_distribution)
system("touch timestamp"); system("touch timestamp");
sleep(2); sleep(2);
system("touch timestamp2"); system("touch timestamp2");
system("find . -newer timestamp -print | xargs touch; rm -f timestamp timestamp2"); system("find . -newer timestamp -print | xargs touch");
unlink("timestamp");
unlink("timestamp2");
sleep(2); sleep(2);
# Ensure that files we don't want to rebuild are newer than other files # Ensure that files we don't want to rebuild are newer than other files
safe_cd($ver); safe_cd($ver);
......
...@@ -100,7 +100,7 @@ typedef struct st_mysql_rows { ...@@ -100,7 +100,7 @@ typedef struct st_mysql_rows {
typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */ typedef MYSQL_ROWS *MYSQL_ROW_OFFSET; /* offset to current row */
#include <my_alloc.h> #include "my_alloc.h"
typedef struct st_mysql_data { typedef struct st_mysql_data {
my_ulonglong rows; my_ulonglong rows;
......
...@@ -30,13 +30,15 @@ handler t2 read a next; ...@@ -30,13 +30,15 @@ handler t2 read a next;
handler t2 read a=(15); handler t2 read a=(15);
handler t2 read a=(16); handler t2 read a=(16);
!$1070 handler t2 read a=(19,"fff"); --error 1070
handler t2 read a=(19,"fff");
handler t2 read b=(19,"fff"); handler t2 read b=(19,"fff");
handler t2 read b=(19,"yyy"); handler t2 read b=(19,"yyy");
handler t2 read b=(19); handler t2 read b=(19);
!$1109 handler t1 read a last; --error 1109
handler t1 read a last;
handler t2 read a=(11); handler t2 read a=(11);
handler t2 read a>=(11); handler t2 read a>=(11);
...@@ -60,9 +62,14 @@ handler t2 read a=(19) where b="yyy"; ...@@ -60,9 +62,14 @@ handler t2 read a=(19) where b="yyy";
handler t2 read first; handler t2 read first;
handler t2 read next; handler t2 read next;
#
# We alter the table even if it's still in use by to test the Innodb
# delayed-drop code. This will generate a warning in the master.err log.
#
alter table t1 type=innodb; alter table t1 type=innodb;
handler t2 read next; handler t2 read next;
!$1064 handler t2 read last; --error 1064
handler t2 read last;
handler t2 close; handler t2 close;
drop table if exists t1; drop table if exists t1;
......
...@@ -73,10 +73,6 @@ extern "C" { // Because of SCO 3.2V4.2 ...@@ -73,10 +73,6 @@ extern "C" { // Because of SCO 3.2V4.2
} }
static void mc_free_rows(MYSQL_DATA *cur); static void mc_free_rows(MYSQL_DATA *cur);
static MYSQL_FIELD *unpack_fields(MYSQL_DATA *data,MEM_ROOT *alloc,uint fields,
my_bool default_value,
my_bool long_flag_protocol);
void mc_end_server(MYSQL *mysql); void mc_end_server(MYSQL *mysql);
static int mc_sock_connect(File s, const struct sockaddr *name, uint namelen, uint to); static int mc_sock_connect(File s, const struct sockaddr *name, uint namelen, uint to);
static void mc_free_old_query(MYSQL *mysql); static void mc_free_old_query(MYSQL *mysql);
......
...@@ -3619,8 +3619,9 @@ struct my_option my_long_options[] = ...@@ -3619,8 +3619,9 @@ struct my_option my_long_options[] =
(gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG, (gptr*) &max_system_variables.read_buff_size,0, GET_ULONG, REQUIRED_ARG,
128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0}, 128*1024L, IO_SIZE*2+MALLOC_OVERHEAD, ~0L, MALLOC_OVERHEAD, IO_SIZE, 0},
{"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT, {"relay_log_space_limit", OPT_RELAY_LOG_SPACE_LIMIT,
"Undocumented", (gptr*) &relay_log_space_limit, "Max space to use for all relay logs",
(gptr*) &relay_log_space_limit, 0, GET_ULONG, REQUIRED_ARG, 0L, 0L, (gptr*) &relay_log_space_limit,
(gptr*) &relay_log_space_limit, 0, GET_ULL, REQUIRED_ARG, 0L, 0L,
(longlong) ULONG_MAX, 0, 1, 0}, (longlong) ULONG_MAX, 0, 1, 0},
{"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL, {"slave_compressed_protocol", OPT_SLAVE_COMPRESSED_PROTOCOL,
"Use compression on master/slave protocol", "Use compression on master/slave protocol",
......
...@@ -41,9 +41,7 @@ DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table; ...@@ -41,9 +41,7 @@ DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table;
bool do_table_inited = 0, ignore_table_inited = 0; bool do_table_inited = 0, ignore_table_inited = 0;
bool wild_do_table_inited = 0, wild_ignore_table_inited = 0; bool wild_do_table_inited = 0, wild_ignore_table_inited = 0;
bool table_rules_on = 0; bool table_rules_on = 0;
static TABLE* save_temporary_tables = 0; ulonglong relay_log_space_limit = 0;
/* TODO: fix variables to access ulonglong values and make it ulonglong */
ulong relay_log_space_limit = 0;
/* /*
When slave thread exits, we need to remember the temporary tables so we When slave thread exits, we need to remember the temporary tables so we
...@@ -53,17 +51,14 @@ ulong relay_log_space_limit = 0; ...@@ -53,17 +51,14 @@ ulong relay_log_space_limit = 0;
*/ */
int disconnect_slave_event_count = 0, abort_slave_event_count = 0; int disconnect_slave_event_count = 0, abort_slave_event_count = 0;
static int events_till_disconnect = -1;
int events_till_abort = -1; int events_till_abort = -1;
static int stuck_count = 0; static int events_till_disconnect = -1;
typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE; typedef enum { SLAVE_THD_IO, SLAVE_THD_SQL} SLAVE_THD_TYPE;
void skip_load_data_infile(NET* net); void skip_load_data_infile(NET* net);
static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev); static int process_io_rotate(MASTER_INFO* mi, Rotate_log_event* rev);
static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev); static int process_io_create_file(MASTER_INFO* mi, Create_file_log_event* cev);
static int queue_old_event(MASTER_INFO* mi, const char* buf,
uint event_len);
static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli); static bool wait_for_relay_log_space(RELAY_LOG_INFO* rli);
static inline bool io_slave_killed(THD* thd,MASTER_INFO* mi); static inline bool io_slave_killed(THD* thd,MASTER_INFO* mi);
static inline bool sql_slave_killed(THD* thd,RELAY_LOG_INFO* rli); static inline bool sql_slave_killed(THD* thd,RELAY_LOG_INFO* rli);
...@@ -288,7 +283,6 @@ err: ...@@ -288,7 +283,6 @@ err:
void init_slave_skip_errors(const char* arg) void init_slave_skip_errors(const char* arg)
{ {
const char *p; const char *p;
my_bool last_was_digit = 0;
if (bitmap_init(&slave_error_mask,MAX_SLAVE_ERROR,0)) if (bitmap_init(&slave_error_mask,MAX_SLAVE_ERROR,0))
{ {
fprintf(stderr, "Badly out of memory, please check your system status\n"); fprintf(stderr, "Badly out of memory, please check your system status\n");
...@@ -669,11 +663,14 @@ static void free_string_array(DYNAMIC_ARRAY *a) ...@@ -669,11 +663,14 @@ static void free_string_array(DYNAMIC_ARRAY *a)
delete_dynamic(a); delete_dynamic(a);
} }
#ifdef NOT_USED_YET
static int end_slave_on_walk(MASTER_INFO* mi, gptr /*unused*/) static int end_slave_on_walk(MASTER_INFO* mi, gptr /*unused*/)
{ {
end_master_info(mi); end_master_info(mi);
return 0; return 0;
} }
#endif
void end_slave() void end_slave()
{ {
...@@ -1818,7 +1815,6 @@ slave_begin: ...@@ -1818,7 +1815,6 @@ slave_begin:
MASTER_INFO* mi = (MASTER_INFO*)arg; MASTER_INFO* mi = (MASTER_INFO*)arg;
char llbuff[22]; char llbuff[22];
uint retry_count= 0; uint retry_count= 0;
ulonglong last_failed_pos = 0; // TODO: see if last_failed_pos is needed
DBUG_ASSERT(mi->inited); DBUG_ASSERT(mi->inited);
pthread_mutex_lock(&mi->run_lock); pthread_mutex_lock(&mi->run_lock);
...@@ -2079,9 +2075,6 @@ pthread_handler_decl(handle_slave_sql,arg) ...@@ -2079,9 +2075,6 @@ pthread_handler_decl(handle_slave_sql,arg)
slave_begin: slave_begin:
#endif #endif
THD *thd; /* needs to be first for thread_stack */ THD *thd; /* needs to be first for thread_stack */
MYSQL *mysql = NULL ;
bool retried_once = 0;
ulonglong last_failed_pos = 0; // TODO: see if this can be removed
char llbuff[22],llbuff1[22]; char llbuff[22],llbuff1[22];
RELAY_LOG_INFO* rli = &((MASTER_INFO*)arg)->rli; RELAY_LOG_INFO* rli = &((MASTER_INFO*)arg)->rli;
const char* errmsg=0; const char* errmsg=0;
...@@ -2700,7 +2693,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli) ...@@ -2700,7 +2693,7 @@ Log_event* next_event(RELAY_LOG_INFO* rli)
*/ */
pthread_mutex_lock(&rli->data_lock); pthread_mutex_lock(&rli->data_lock);
while (!(was_killed=sql_slave_killed(thd,rli))) while (!sql_slave_killed(thd,rli))
{ {
/* /*
We can have two kinds of log reading: We can have two kinds of log reading:
......
...@@ -32,7 +32,7 @@ extern my_string master_info_file,relay_log_info_file; ...@@ -32,7 +32,7 @@ extern my_string master_info_file,relay_log_info_file;
extern my_string opt_relay_logname, opt_relaylog_index_name; extern my_string opt_relay_logname, opt_relaylog_index_name;
extern my_bool opt_skip_slave_start, opt_reckless_slave; extern my_bool opt_skip_slave_start, opt_reckless_slave;
extern my_bool opt_log_slave_updates; extern my_bool opt_log_slave_updates;
extern ulong relay_log_space_limit; extern ulonglong relay_log_space_limit;
struct st_master_info; struct st_master_info;
/* /*
......
...@@ -501,7 +501,6 @@ ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user, ...@@ -501,7 +501,6 @@ ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
{ {
ulong user_access=NO_ACCESS; ulong user_access=NO_ACCESS;
*priv_user=(char*) user; *priv_user=(char*) user;
char *ptr=0;
DBUG_ENTER("acl_getroot"); DBUG_ENTER("acl_getroot");
bzero(mqh,sizeof(USER_RESOURCES)); bzero(mqh,sizeof(USER_RESOURCES));
...@@ -578,34 +577,29 @@ ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user, ...@@ -578,34 +577,29 @@ ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
if (acl_user->x509_issuer) if (acl_user->x509_issuer)
{ {
DBUG_PRINT("info",("checkpoint 3")); DBUG_PRINT("info",("checkpoint 3"));
ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0); char *ptr = X509_NAME_oneline(X509_get_issuer_name(cert), 0, 0);
DBUG_PRINT("info",("comparing issuers: '%s' and '%s'", DBUG_PRINT("info",("comparing issuers: '%s' and '%s'",
acl_user->x509_issuer, ptr)); acl_user->x509_issuer, ptr));
if (!strcmp(acl_user->x509_issuer,ptr)) if (strcmp(acl_user->x509_issuer, ptr))
user_access=acl_user->access;
else
{ {
user_access=NO_ACCESS; user_access=NO_ACCESS;
free(ptr); free(ptr);
break; break;
} }
user_access=acl_user->access;
free(ptr); free(ptr);
} }
DBUG_PRINT("info",("checkpoint 4")); DBUG_PRINT("info",("checkpoint 4"));
/* X509 subject is specified, we check it .. */ /* X509 subject is specified, we check it .. */
if (acl_user->x509_subject) if (acl_user->x509_subject)
{ {
ptr = X509_NAME_oneline(X509_get_subject_name(cert), 0, 0); char *ptr= X509_NAME_oneline(X509_get_subject_name(cert), 0, 0);
DBUG_PRINT("info",("comparing subjects: '%s' and '%s'", DBUG_PRINT("info",("comparing subjects: '%s' and '%s'",
acl_user->x509_subject, ptr)); acl_user->x509_subject, ptr));
if (!strcmp(acl_user->x509_subject,ptr)) if (strcmp(acl_user->x509_subject,ptr))
user_access=acl_user->access;
else
{
user_access=NO_ACCESS; user_access=NO_ACCESS;
free(ptr); else
break; user_access=acl_user->access;
}
free(ptr); free(ptr);
} }
break; break;
......
...@@ -129,7 +129,6 @@ static void check_unused(void) ...@@ -129,7 +129,6 @@ static void check_unused(void)
OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild) OPEN_TABLE_LIST *list_open_tables(THD *thd, const char *wild)
{ {
int result = 0; int result = 0;
uint col_access=thd->col_access;
OPEN_TABLE_LIST **start_list, *open_list; OPEN_TABLE_LIST **start_list, *open_list;
TABLE_LIST table_list; TABLE_LIST table_list;
char name[NAME_LEN*2]; char name[NAME_LEN*2];
......
...@@ -2042,7 +2042,6 @@ Query_cache::get_free_block(ulong len, my_bool not_less, ulong min) ...@@ -2042,7 +2042,6 @@ Query_cache::get_free_block(ulong len, my_bool not_less, ulong min)
if (bins[start].number != 0) if (bins[start].number != 0)
{ {
Query_cache_block *list = bins[start].free_blocks; Query_cache_block *list = bins[start].free_blocks;
ulong max_len = list->prev->length;
if (list->prev->length >= len) // check block with max size if (list->prev->length >= len) // check block with max size
{ {
first = list; first = list;
......
...@@ -214,7 +214,6 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds, ...@@ -214,7 +214,6 @@ mysql_select(THD *thd,TABLE_LIST *tables,List<Item> &fields,COND *conds,
Procedure *procedure; Procedure *procedure;
List<Item> all_fields(fields); List<Item> all_fields(fields);
bool select_distinct; bool select_distinct;
SELECT_LEX *select_lex = &(thd->lex.select_lex);
SELECT_LEX *cur_sel = thd->lex.select; SELECT_LEX *cur_sel = thd->lex.select;
DBUG_ENTER("mysql_select"); DBUG_ENTER("mysql_select");
...@@ -4277,7 +4276,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure) ...@@ -4277,7 +4276,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
} }
if (table) if (table)
{ {
int old_error=error,tmp; int tmp;
if ((tmp=table->file->extra(HA_EXTRA_NO_CACHE))) if ((tmp=table->file->extra(HA_EXTRA_NO_CACHE)))
{ {
my_errno=tmp; my_errno=tmp;
......
...@@ -24,11 +24,10 @@ ...@@ -24,11 +24,10 @@
#define DONT_MAP_VIO #define DONT_MAP_VIO
#include <my_global.h> #include <my_global.h>
#include <mysql_com.h> #include <mysql_com.h>
#include <violite.h>
#include <errno.h>
#include <my_sys.h> #include <my_sys.h>
#include <my_net.h>
#include <m_string.h> #include <m_string.h>
#include <violite.h>
#include <errno.h>
/* /*
* Helper to fill most of the Vio* with defaults. * Helper to fill most of the Vio* with defaults.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment