Portability fixes
libmysql/libmysql.c: Cleanup & portability fixes
This commit is contained in:
parent
ef2e750842
commit
7dc2f1a69e
@ -2033,9 +2033,9 @@ mysql_query(MYSQL *mysql, const char *query)
|
||||
return mysql_real_query(mysql,query, (uint) strlen(query));
|
||||
}
|
||||
|
||||
|
||||
static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
unsigned int port, const char* user,
|
||||
const char* passwd)
|
||||
{
|
||||
MYSQL* child;
|
||||
@ -2045,11 +2045,13 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
||||
child->options.user = my_strdup((user) ? user :
|
||||
(parent->user ? parent->user :
|
||||
parent->options.user), MYF(0));
|
||||
child->options.password = my_strdup((passwd) ? passwd : (parent->passwd ?
|
||||
child->options.password = my_strdup((passwd) ? passwd :
|
||||
(parent->passwd ?
|
||||
parent->passwd :
|
||||
parent->options.password), MYF(0));
|
||||
child->options.port = port;
|
||||
child->options.host = my_strdup((host) ? host : (parent->host ?
|
||||
child->options.host = my_strdup((host) ? host :
|
||||
(parent->host ?
|
||||
parent->host :
|
||||
parent->options.host), MYF(0));
|
||||
if (parent->db)
|
||||
@ -2065,8 +2067,7 @@ static MYSQL* spawn_init(MYSQL* parent, const char* host,
|
||||
|
||||
int
|
||||
STDCALL mysql_set_master(MYSQL* mysql, const char* host,
|
||||
unsigned int port,
|
||||
const char* user,
|
||||
unsigned int port, const char* user,
|
||||
const char* passwd)
|
||||
{
|
||||
if (mysql->master != mysql && !mysql->master->rpl_pivot)
|
||||
@ -2105,21 +2106,21 @@ mysql_send_query(MYSQL* mysql, const char* query, uint length)
|
||||
{
|
||||
if (mysql->options.rpl_parse && mysql->rpl_pivot)
|
||||
{
|
||||
switch (mysql_rpl_query_type(query, length))
|
||||
{
|
||||
switch (mysql_rpl_query_type(query, length)) {
|
||||
case MYSQL_RPL_MASTER:
|
||||
return mysql_master_send_query(mysql, query, length);
|
||||
case MYSQL_RPL_SLAVE:
|
||||
return mysql_slave_send_query(mysql, query, length);
|
||||
case MYSQL_RPL_ADMIN: /*fall through */
|
||||
case MYSQL_RPL_ADMIN:
|
||||
break; /* fall through */
|
||||
}
|
||||
}
|
||||
|
||||
mysql->last_used_con = mysql;
|
||||
|
||||
return simple_command(mysql, COM_QUERY, query, length, 1);
|
||||
}
|
||||
|
||||
|
||||
int STDCALL mysql_read_query_result(MYSQL *mysql)
|
||||
{
|
||||
uchar *pos;
|
||||
@ -2173,6 +2174,7 @@ get_info:
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
|
||||
int STDCALL
|
||||
mysql_real_query(MYSQL *mysql, const char *query, uint length)
|
||||
{
|
||||
@ -2185,6 +2187,7 @@ mysql_real_query(MYSQL *mysql, const char *query, uint length)
|
||||
DBUG_RETURN(mysql_read_query_result(mysql));
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
send_file_to_server(MYSQL *mysql, const char *filename)
|
||||
{
|
||||
|
@ -153,7 +153,9 @@ int do_boolean(ALL_IN_ONE *aio, uint nested __attribute__((unused)),
|
||||
|
||||
if (selem->count==1) /* document's first match */
|
||||
{
|
||||
sptr->yes=sptr->no=sptr->doc.weight=0;
|
||||
sptr->yes=0;
|
||||
sptr->no=0;
|
||||
sptr->doc.weight=0;
|
||||
sptr->aio=aio;
|
||||
sptr->wno=0;
|
||||
}
|
||||
|
@ -17,6 +17,7 @@
|
||||
/* Written by Sergei A. Golubchik, who has a shared copyright to this code */
|
||||
|
||||
#include "ftdefs.h"
|
||||
#include <getopt.h>
|
||||
|
||||
static void get_options(int argc,char *argv[]);
|
||||
static void usage(char *argv[]);
|
||||
|
@ -937,7 +937,6 @@ THR_LOCK_DATA **ha_myisam::store_lock(THD *thd,
|
||||
|
||||
void ha_myisam::update_create_info(HA_CREATE_INFO *create_info)
|
||||
{
|
||||
MI_ISAMINFO info;
|
||||
table->file->info(HA_STATUS_AUTO | HA_STATUS_CONST);
|
||||
if (!(create_info->used_fields & HA_CREATE_USED_AUTO))
|
||||
{
|
||||
|
@ -795,7 +795,7 @@ static int simple_raw_key_cmp(void* arg, byte* key1, byte* key2)
|
||||
|
||||
static int simple_str_key_cmp(void* arg, byte* key1, byte* key2)
|
||||
{
|
||||
return my_sortcmp(key1, key2, *(uint*) arg);
|
||||
return my_sortcmp((char*) key1, (char*) key2, *(uint*) arg);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -832,7 +832,7 @@ int composite_key_cmp(void* arg, byte* key1, byte* key2)
|
||||
int dump_leaf(byte* key, uint32 count __attribute__((unused)),
|
||||
Item_sum_count_distinct* item)
|
||||
{
|
||||
char* buf = item->table->record[0];
|
||||
byte* buf = item->table->record[0];
|
||||
int error;
|
||||
/*
|
||||
The first item->rec_offset bytes are taken care of with
|
||||
|
@ -320,7 +320,7 @@ void Log_event::init_show_field_list(List<Item>* field_list)
|
||||
field_list->push_back(new Item_empty_string("Info", 20));
|
||||
}
|
||||
|
||||
int Log_event::net_send(THD* thd, const char* log_name, ulong pos)
|
||||
int Log_event::net_send(THD* thd, const char* log_name, my_off_t pos)
|
||||
{
|
||||
String* packet = &thd->packet;
|
||||
const char* p = strrchr(log_name, FN_LIBCHAR);
|
||||
@ -908,15 +908,15 @@ Load_log_event::Load_log_event(THD* thd, sql_exchange* ex,
|
||||
table_name_len = (table_name) ? (uint32) strlen(table_name) : 0;
|
||||
fname_len = (fname) ? (uint) strlen(fname) : 0;
|
||||
sql_ex.field_term = (char*) ex->field_term->ptr();
|
||||
sql_ex.field_term_len = ex->field_term->length();
|
||||
sql_ex.field_term_len = (uint8) ex->field_term->length();
|
||||
sql_ex.enclosed = (char*) ex->enclosed->ptr();
|
||||
sql_ex.enclosed_len = ex->enclosed->length();
|
||||
sql_ex.enclosed_len = (uint8) ex->enclosed->length();
|
||||
sql_ex.line_term = (char*) ex->line_term->ptr();
|
||||
sql_ex.line_term_len = ex->line_term->length();
|
||||
sql_ex.line_term_len = (uint8) ex->line_term->length();
|
||||
sql_ex.line_start = (char*) ex->line_start->ptr();
|
||||
sql_ex.line_start_len = ex->line_start->length();
|
||||
sql_ex.line_start_len = (uint8) ex->line_start->length();
|
||||
sql_ex.escaped = (char*) ex->escaped->ptr();
|
||||
sql_ex.escaped_len = ex->escaped->length();
|
||||
sql_ex.escaped_len = (uint8) ex->escaped->length();
|
||||
sql_ex.opt_flags = 0;
|
||||
sql_ex.cached_new_format = -1;
|
||||
|
||||
@ -1233,7 +1233,8 @@ int Create_file_log_event::write_data_body(IO_CACHE* file)
|
||||
int res;
|
||||
if ((res = Load_log_event::write_data_body(file)) || fake_base)
|
||||
return res;
|
||||
return my_b_write(file, "", 1) || my_b_write(file, block, block_len);
|
||||
return (my_b_write(file, (byte*) "", 1) ||
|
||||
my_b_write(file, (byte*) block, block_len));
|
||||
}
|
||||
|
||||
int Create_file_log_event::write_data_header(IO_CACHE* file)
|
||||
@ -1241,7 +1242,7 @@ int Create_file_log_event::write_data_header(IO_CACHE* file)
|
||||
int res;
|
||||
if ((res = Load_log_event::write_data_header(file)) || fake_base)
|
||||
return res;
|
||||
char buf[CREATE_FILE_HEADER_LEN];
|
||||
byte buf[CREATE_FILE_HEADER_LEN];
|
||||
int4store(buf + CF_FILE_ID_OFFSET, file_id);
|
||||
return my_b_write(file, buf, CREATE_FILE_HEADER_LEN);
|
||||
}
|
||||
@ -1321,10 +1322,10 @@ Append_block_log_event::Append_block_log_event(const char* buf, int len):
|
||||
|
||||
int Append_block_log_event::write_data(IO_CACHE* file)
|
||||
{
|
||||
char buf[APPEND_BLOCK_HEADER_LEN];
|
||||
byte buf[APPEND_BLOCK_HEADER_LEN];
|
||||
int4store(buf + AB_FILE_ID_OFFSET, file_id);
|
||||
return my_b_write(file, buf, APPEND_BLOCK_HEADER_LEN) ||
|
||||
my_b_write(file, block, block_len);
|
||||
return (my_b_write(file, buf, APPEND_BLOCK_HEADER_LEN) ||
|
||||
my_b_write(file, (byte*) block, block_len));
|
||||
}
|
||||
|
||||
#ifdef MYSQL_CLIENT
|
||||
@ -1371,7 +1372,7 @@ Delete_file_log_event::Delete_file_log_event(const char* buf, int len):
|
||||
|
||||
int Delete_file_log_event::write_data(IO_CACHE* file)
|
||||
{
|
||||
char buf[DELETE_FILE_HEADER_LEN];
|
||||
byte buf[DELETE_FILE_HEADER_LEN];
|
||||
int4store(buf + DF_FILE_ID_OFFSET, file_id);
|
||||
return my_b_write(file, buf, DELETE_FILE_HEADER_LEN);
|
||||
}
|
||||
@ -1418,7 +1419,7 @@ Execute_load_log_event::Execute_load_log_event(const char* buf,int len):
|
||||
|
||||
int Execute_load_log_event::write_data(IO_CACHE* file)
|
||||
{
|
||||
char buf[EXEC_LOAD_HEADER_LEN];
|
||||
byte buf[EXEC_LOAD_HEADER_LEN];
|
||||
int4store(buf + EL_FILE_ID_OFFSET, file_id);
|
||||
return my_b_write(file, buf, EXEC_LOAD_HEADER_LEN);
|
||||
}
|
||||
@ -1711,13 +1712,14 @@ int Slave_log_event::exec_event(struct st_master_info* mi)
|
||||
int Create_file_log_event::exec_event(struct st_master_info* mi)
|
||||
{
|
||||
char fname_buf[FN_REFLEN+10];
|
||||
char* p,*p1;
|
||||
char *p;
|
||||
int fd = -1;
|
||||
IO_CACHE file;
|
||||
int error = 1;
|
||||
p = slave_load_file_stem(fname_buf, file_id, server_id);
|
||||
memcpy(p, ".info", 6);
|
||||
|
||||
bzero((char*)&file, sizeof(file));
|
||||
p = slave_load_file_stem(fname_buf, file_id, server_id);
|
||||
strmov(p, ".info"); // strmov takes less code than memcpy
|
||||
if ((fd = my_open(fname_buf, O_WRONLY|O_CREAT|O_BINARY|O_TRUNC,
|
||||
MYF(MY_WME))) < 0 ||
|
||||
init_io_cache(&file, fd, IO_SIZE, WRITE_CACHE, (my_off_t)0, 0,
|
||||
@ -1728,12 +1730,12 @@ int Create_file_log_event::exec_event(struct st_master_info* mi)
|
||||
}
|
||||
|
||||
// a trick to avoid allocating another buffer
|
||||
memcpy(p, ".data", 6);
|
||||
strmov(p, ".data");
|
||||
fname = fname_buf;
|
||||
fname_len = (uint)(p-fname) + 5;
|
||||
if (write_base(&file))
|
||||
{
|
||||
memcpy(p, ".info", 6); // to have it right in the error message
|
||||
strmov(p, ".info"); // to have it right in the error message
|
||||
slave_print_error(my_errno, "Could not write to file '%s'", fname_buf);
|
||||
goto err;
|
||||
}
|
||||
@ -1747,7 +1749,7 @@ int Create_file_log_event::exec_event(struct st_master_info* mi)
|
||||
slave_print_error(my_errno, "Could not open file '%s'", fname_buf);
|
||||
goto err;
|
||||
}
|
||||
if (my_write(fd, block, block_len, MYF(MY_WME+MY_NABP)))
|
||||
if (my_write(fd, (byte*) block, block_len, MYF(MY_WME+MY_NABP)))
|
||||
{
|
||||
slave_print_error(my_errno, "Write to '%s' failed", fname_buf);
|
||||
goto err;
|
||||
@ -1790,7 +1792,7 @@ int Append_block_log_event::exec_event(struct st_master_info* mi)
|
||||
slave_print_error(my_errno, "Could not open file '%s'", fname);
|
||||
goto err;
|
||||
}
|
||||
if (my_write(fd, block, block_len, MYF(MY_WME+MY_NABP)))
|
||||
if (my_write(fd, (byte*) block, block_len, MYF(MY_WME+MY_NABP)))
|
||||
{
|
||||
slave_print_error(my_errno, "Write to '%s' failed", fname);
|
||||
goto err;
|
||||
@ -1810,7 +1812,7 @@ int Execute_load_log_event::exec_event(struct st_master_info* mi)
|
||||
char* p;
|
||||
int fd = -1;
|
||||
int error = 1;
|
||||
int save_options;
|
||||
ulong save_options;
|
||||
IO_CACHE file;
|
||||
Load_log_event* lev = 0;
|
||||
p = slave_load_file_stem(fname, file_id, server_id);
|
||||
@ -1835,7 +1837,7 @@ int Execute_load_log_event::exec_event(struct st_master_info* mi)
|
||||
// can preserve ascending order of log sequence numbers - needed
|
||||
// to handle failover
|
||||
save_options = thd->options;
|
||||
thd->options &= ~ (ulong) OPTION_BIN_LOG;
|
||||
thd->options &= ~ (ulong) (OPTION_BIN_LOG);
|
||||
lev->thd = thd;
|
||||
if (lev->exec_event(0,0))
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ struct sql_ex_info
|
||||
char* line_term;
|
||||
char* line_start;
|
||||
char* escaped;
|
||||
uchar field_term_len,enclosed_len,line_term_len,line_start_len,
|
||||
uint8 field_term_len,enclosed_len,line_term_len,line_start_len,
|
||||
escaped_len;
|
||||
char opt_flags;
|
||||
char empty_flags;
|
||||
@ -280,7 +280,7 @@ public:
|
||||
pthread_mutex_t* log_lock);
|
||||
void set_log_seq(THD* thd, MYSQL_LOG* log);
|
||||
virtual void pack_info(String* packet);
|
||||
int net_send(THD* thd, const char* log_name, ulong pos);
|
||||
int net_send(THD* thd, const char* log_name, my_off_t pos);
|
||||
static void init_show_field_list(List<Item>* field_list);
|
||||
virtual int exec_event(struct st_master_info* mi);
|
||||
virtual const char* get_db()
|
||||
|
@ -1076,7 +1076,7 @@ static int mc_send_file_to_server(MYSQL *mysql, const char *filename)
|
||||
DBUG_RETURN(-1);
|
||||
}
|
||||
|
||||
while ((readcount = (int) my_read(fd,buf,sizeof(buf),MYF(0))) > 0)
|
||||
while ((readcount = (int) my_read(fd,(byte*) buf,sizeof(buf),MYF(0))) > 0)
|
||||
{
|
||||
if (my_net_write(&mysql->net,buf,readcount))
|
||||
{
|
||||
|
@ -42,8 +42,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <assert.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#ifdef MYSQL_SERVER
|
||||
ulong max_allowed_packet=65536;
|
||||
extern ulong net_read_timeout,net_write_timeout;
|
||||
@ -832,5 +830,3 @@ my_net_read(NET *net)
|
||||
#endif /* HAVE_COMPRESS */
|
||||
return len;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2534,7 +2534,9 @@ QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts)
|
||||
: QUICK_SELECT(*q), rev_it(rev_ranges)
|
||||
{
|
||||
bool not_read_after_key = file->option_flag() & HA_NOT_READ_AFTER_KEY;
|
||||
for (QUICK_RANGE *r = it++; r; r = it++)
|
||||
QUICK_RANGE *r;
|
||||
|
||||
for (r = it++; r; r = it++)
|
||||
{
|
||||
rev_ranges.push_front(r);
|
||||
if (not_read_after_key && range_reads_after_key(r) ||
|
||||
@ -2547,7 +2549,7 @@ QUICK_SELECT_DESC::QUICK_SELECT_DESC(QUICK_SELECT *q, uint used_key_parts)
|
||||
}
|
||||
}
|
||||
/* Remove EQ_RANGE flag for keys that are not using the full key */
|
||||
for (QUICK_RANGE *r = rev_it++; r; r = rev_it++)
|
||||
for (r = rev_it++; r; r = rev_it++)
|
||||
{
|
||||
if ((r->flag & EQ_RANGE) &&
|
||||
head->key_info[index].key_length != r->max_length)
|
||||
|
@ -593,7 +593,6 @@ error:
|
||||
int register_slave_on_master(MYSQL* mysql)
|
||||
{
|
||||
String packet;
|
||||
uint len;
|
||||
char buf[4];
|
||||
|
||||
if(!report_host)
|
||||
@ -937,8 +936,6 @@ static int exec_event(THD* thd, NET* net, MASTER_INFO* mi, int event_len)
|
||||
{
|
||||
Log_event * ev = Log_event::read_log_event((const char*)net->read_pos + 1,
|
||||
event_len);
|
||||
char llbuff[22];
|
||||
|
||||
if (ev)
|
||||
{
|
||||
int type_code = ev->get_type_code();
|
||||
|
@ -412,7 +412,6 @@ void close_thread_tables(THD *thd, bool locked)
|
||||
DBUG_VOID_RETURN; // LOCK TABLES in use
|
||||
}
|
||||
|
||||
TABLE *table,*next;
|
||||
bool found_old_table=0;
|
||||
|
||||
if (thd->lock)
|
||||
|
@ -606,7 +606,7 @@ class Unique :public Sql_alloc
|
||||
ulong max_elements, max_in_memory_size;
|
||||
IO_CACHE file;
|
||||
TREE tree;
|
||||
char *record_pointers;
|
||||
byte *record_pointers;
|
||||
bool flush();
|
||||
|
||||
public:
|
||||
|
@ -241,7 +241,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
|
||||
continue;
|
||||
}
|
||||
strxmov(filePath,org_path,"/",file->name,NullS);
|
||||
if (db && !strcasecmp(fn_ext(file->name), reg_ext))
|
||||
if (db && !my_strcasecmp(fn_ext(file->name), reg_ext))
|
||||
{
|
||||
/* Drop the table nicely */
|
||||
*fn_ext(file->name)=0; // Remove extension
|
||||
|
@ -324,7 +324,7 @@ bool multi_delete::send_data(List<Item> &values)
|
||||
}
|
||||
else
|
||||
{
|
||||
error=tempfiles[secure_counter]->unique_add(table->file->ref);
|
||||
error=tempfiles[secure_counter]->unique_add((char*) table->file->ref);
|
||||
if (error)
|
||||
{
|
||||
error=-1;
|
||||
@ -378,7 +378,7 @@ void multi_delete::send_error(uint errcode,const char *err)
|
||||
|
||||
int multi_delete::do_deletes (bool from_send_error)
|
||||
{
|
||||
int error = 0, counter = 0, count;
|
||||
int error = 0, counter = 0;
|
||||
|
||||
if (from_send_error)
|
||||
{
|
||||
|
@ -2913,7 +2913,7 @@ static bool create_total_list(THD *thd, LEX *lex, TABLE_LIST **result)
|
||||
{
|
||||
/* Add not used table to the total table list */
|
||||
aux->lock_type= lex->lock_option;
|
||||
if (!(cursor = (TABLE_LIST *) thd->memdup((byte*) aux,
|
||||
if (!(cursor = (TABLE_LIST *) thd->memdup((char*) aux,
|
||||
sizeof(*aux))))
|
||||
{
|
||||
send_error(&thd->net,0);
|
||||
|
@ -51,7 +51,7 @@ static uint32* slave_list_key(SLAVE_INFO* si, uint* len,
|
||||
|
||||
static void slave_info_free(void *s)
|
||||
{
|
||||
my_free((byte*)s, MYF(MY_WME));
|
||||
my_free((gptr) s, MYF(MY_WME));
|
||||
}
|
||||
|
||||
void init_slave_list()
|
||||
@ -109,7 +109,6 @@ static int fake_rotate_event(NET* net, String* packet, char* log_file_name,
|
||||
|
||||
int register_slave(THD* thd, uchar* packet, uint packet_length)
|
||||
{
|
||||
uint len;
|
||||
SLAVE_INFO *si, *old_si;
|
||||
int res = 1;
|
||||
uchar* p = packet, *p_end = packet + packet_length;
|
||||
@ -138,7 +137,7 @@ int register_slave(THD* thd, uchar* packet, uint packet_length)
|
||||
|
||||
err:
|
||||
if (si)
|
||||
my_free((byte*)si, MYF(MY_WME));
|
||||
my_free((gptr) si, MYF(MY_WME));
|
||||
return res;
|
||||
}
|
||||
|
||||
@ -935,7 +934,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg)
|
||||
{
|
||||
LOG_INFO linfo;
|
||||
char search_file_name[FN_REFLEN],last_log_name[FN_REFLEN];
|
||||
IO_CACHE log, last_log;
|
||||
IO_CACHE log;
|
||||
File file = -1, last_file = -1;
|
||||
pthread_mutex_t *log_lock;
|
||||
const char* errmsg_p;
|
||||
@ -1149,7 +1148,7 @@ int show_binlog_events(THD* thd)
|
||||
uint event_count, limit_start, limit_end;
|
||||
const char* log_file_name = lex_mi->log_file_name;
|
||||
Log_event* ev;
|
||||
ulong pos = (ulong) lex_mi->pos;
|
||||
my_off_t pos = lex_mi->pos;
|
||||
|
||||
limit_start = thd->lex.select->offset_limit;
|
||||
limit_end = thd->lex.select->select_limit + limit_start;
|
||||
@ -1258,7 +1257,7 @@ int show_slave_hosts(THD* thd)
|
||||
net_store_data(packet, si->user);
|
||||
net_store_data(packet, si->password);
|
||||
}
|
||||
net_store_data(packet, (uint)si->port);
|
||||
net_store_data(packet, (uint32) si->port);
|
||||
if (my_net_write(net, (char*)packet->ptr(), packet->length()))
|
||||
{
|
||||
pthread_mutex_unlock(&LOCK_slave_list);
|
||||
@ -1466,7 +1465,6 @@ int load_master_data(THD* thd)
|
||||
{
|
||||
MYSQL_RES *db_res, **table_res, **table_res_end, **cur_table_res;
|
||||
uint num_dbs;
|
||||
MYSQL_ROW row;
|
||||
|
||||
if (mc_mysql_query(&mysql, "show databases", 0) ||
|
||||
!(db_res = mc_mysql_store_result(&mysql)))
|
||||
@ -1476,7 +1474,7 @@ int load_master_data(THD* thd)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (!(num_dbs = mc_mysql_num_rows(db_res)))
|
||||
if (!(num_dbs = (uint) mc_mysql_num_rows(db_res)))
|
||||
goto err;
|
||||
// in theory, the master could have no databases at all
|
||||
// and run with skip-grant
|
||||
@ -1511,7 +1509,6 @@ int load_master_data(THD* thd)
|
||||
// since we know how many rows we have, this can never be NULL
|
||||
MYSQL_ROW row = mc_mysql_fetch_row(db_res);
|
||||
char* db = row[0];
|
||||
int drop_error;
|
||||
|
||||
/*
|
||||
Do not replicate databases excluded by rules
|
||||
@ -1615,14 +1612,14 @@ int log_loaded_block(IO_CACHE* file)
|
||||
lf_info->last_pos_in_file = file->pos_in_file;
|
||||
if (lf_info->wrote_create_file)
|
||||
{
|
||||
Append_block_log_event a(lf_info->thd, file->buffer,block_len);
|
||||
Append_block_log_event a(lf_info->thd, (char*) file->buffer, block_len);
|
||||
mysql_bin_log.write(&a);
|
||||
}
|
||||
else
|
||||
{
|
||||
Create_file_log_event c(lf_info->thd,lf_info->ex,lf_info->db,
|
||||
lf_info->table_name, *lf_info->fields,
|
||||
lf_info->handle_dup, file->buffer,
|
||||
lf_info->handle_dup, (char*) file->buffer,
|
||||
block_len);
|
||||
mysql_bin_log.write(&c);
|
||||
lf_info->wrote_create_file = 1;
|
||||
|
@ -4859,7 +4859,7 @@ end_write(JOIN *join, JOIN_TAB *join_tab __attribute__((unused)),
|
||||
DBUG_RETURN(1); // Not a table_is_full error
|
||||
table->uniques=0; // To ensure rows are the same
|
||||
}
|
||||
if (++join->send_records >= join->tmp_table_param.end_write_records &
|
||||
if (++join->send_records >= join->tmp_table_param.end_write_records &&
|
||||
join->do_send_rows)
|
||||
{
|
||||
if (!(join->select_options & OPTION_FOUND_ROWS))
|
||||
|
@ -211,9 +211,8 @@ bool select_union::send_eof()
|
||||
|
||||
bool select_union::flush()
|
||||
{
|
||||
int error,error2;
|
||||
error=table->file->extra(HA_EXTRA_NO_CACHE);
|
||||
if (error)
|
||||
int error;
|
||||
if ((error=table->file->extra(HA_EXTRA_NO_CACHE)))
|
||||
{
|
||||
table->file->print_error(error,MYF(0));
|
||||
::send_error(&thd->net);
|
||||
|
@ -2053,14 +2053,14 @@ delete_limit_clause:
|
||||
|
||||
ULONG_NUM:
|
||||
NUM { $$= strtoul($1.str,NULL,10); }
|
||||
| ULONGLONG_NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
|
||||
| ULONGLONG_NUM { $$= (ulong) strtoull($1.str,NULL,10); }
|
||||
| REAL_NUM { $$= strtoul($1.str,NULL,10); }
|
||||
| FLOAT_NUM { $$= strtoul($1.str,NULL,10); }
|
||||
|
||||
ulonglong_num:
|
||||
NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
|
||||
| ULONGLONG_NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
|
||||
| LONG_NUM { $$= strtoull($1.str,NULL,10); }
|
||||
| ULONGLONG_NUM { $$= strtoull($1.str,NULL,10); }
|
||||
| LONG_NUM { $$= (ulonglong) strtoul($1.str,NULL,10); }
|
||||
| REAL_NUM { $$= strtoull($1.str,NULL,10); }
|
||||
| FLOAT_NUM { $$= strtoull($1.str,NULL,10); }
|
||||
|
||||
|
@ -75,7 +75,8 @@ bool Unique::flush()
|
||||
|
||||
int unique_write_to_file(gptr key, element_count count, Unique *unique)
|
||||
{
|
||||
return my_b_write(&unique->file, key, unique->tree.size_of_element) ? 1 : 0;
|
||||
return my_b_write(&unique->file, (byte*) key,
|
||||
unique->tree.size_of_element) ? 1 : 0;
|
||||
}
|
||||
|
||||
int unique_write_to_ptrs(gptr key, element_count count, Unique *unique)
|
||||
|
Loading…
x
Reference in New Issue
Block a user