mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
keep bk happy
This commit is contained in:
@ -40712,6 +40712,11 @@ not yet 100 % confident in this code.
|
||||
@appendixsubsec Changes in release 3.23.32
|
||||
@itemize @bullet
|
||||
@item
|
||||
Fixed bug in @code{SHOW LOGS} when there wheren't any BDB logs.
|
||||
@item
|
||||
Fixed a timing problem in replication that could delay sending an update
|
||||
to the client until a new update was done.
|
||||
@item
|
||||
Don't convert field names when using @code{mysql_list_fields()}. This is
|
||||
to keep this code compatible with @code{SHOW FIELDS}.
|
||||
@item
|
||||
|
@ -239,7 +239,7 @@ SLAVE_MYSQLD=$MYSQLD #this can be changed later if we are doing gcov
|
||||
#--
|
||||
wait_for_server_start ()
|
||||
{
|
||||
$MYSQL -e "select 1" --silent -w1 --host=127.0.0.1 --port=$1 \
|
||||
$MYSQL --no-defaults -u $DBUSER -e "select 1" --silent -w1 --host=127.0.0.1 --port=$1 \
|
||||
>/dev/null
|
||||
}
|
||||
|
||||
@ -492,7 +492,7 @@ mysql_restart () {
|
||||
|
||||
mysql_loadstd () {
|
||||
|
||||
cp $STD_DATA/*.frm $STD_DATA/*.MRG $MASTER_MYDDIR/test
|
||||
# cp $STD_DATA/*.frm $STD_DATA/*.MRG $MASTER_MYDDIR/test
|
||||
return 1
|
||||
}
|
||||
|
||||
|
@ -253,27 +253,33 @@ int berkeley_show_logs(THD *thd)
|
||||
{
|
||||
DBUG_PRINT("error", ("log_archive failed (error %d)", error));
|
||||
db_env->err(db_env, error, "log_archive: DB_ARCH_ABS");
|
||||
if (error== DB_NOTFOUND)
|
||||
error=0; // No log files
|
||||
goto err;
|
||||
}
|
||||
|
||||
for (a = all_logs, f = free_logs; *a; ++a)
|
||||
/* Error is 0 here */
|
||||
if (all_logs)
|
||||
{
|
||||
packet->length(0);
|
||||
net_store_data(packet,*a);
|
||||
net_store_data(packet,"BDB");
|
||||
if (*f && strcmp(*a, *f) == 0)
|
||||
for (a = all_logs, f = free_logs; *a; ++a)
|
||||
{
|
||||
++f;
|
||||
net_store_data(packet, SHOW_LOG_STATUS_FREE);
|
||||
packet->length(0);
|
||||
net_store_data(packet,*a);
|
||||
net_store_data(packet,"BDB");
|
||||
if (f && *f && strcmp(*a, *f) == 0)
|
||||
{
|
||||
++f;
|
||||
net_store_data(packet, SHOW_LOG_STATUS_FREE);
|
||||
}
|
||||
else
|
||||
net_store_data(packet, SHOW_LOG_STATUS_INUSE);
|
||||
|
||||
if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
|
||||
{
|
||||
error=1;
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
net_store_data(packet, SHOW_LOG_STATUS_INUSE);
|
||||
|
||||
if (my_net_write(&thd->net,(char*) packet->ptr(),packet->length()))
|
||||
goto err;
|
||||
}
|
||||
error=0;
|
||||
|
||||
err:
|
||||
free_root(&show_logs_root,MYF(0));
|
||||
my_pthread_setspecific_ptr(THR_MALLOC,old_root);
|
||||
@ -317,12 +323,12 @@ void berkeley_cleanup_log_files(void)
|
||||
}
|
||||
|
||||
if (names)
|
||||
{ /* purecov: tested */
|
||||
char **np; /* purecov: tested */
|
||||
for (np = names; *np; ++np) /* purecov: tested */
|
||||
my_delete(*np, MYF(MY_WME)); /* purecov: tested */
|
||||
{ /* purecov: tested */
|
||||
char **np; /* purecov: tested */
|
||||
for (np = names; *np; ++np) /* purecov: tested */
|
||||
my_delete(*np, MYF(MY_WME)); /* purecov: tested */
|
||||
|
||||
free(names); /* purecov: tested */
|
||||
free(names); /* purecov: tested */
|
||||
}
|
||||
|
||||
DBUG_VOID_RETURN;
|
||||
@ -526,9 +532,9 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
|
||||
{
|
||||
if ((error=db_create(ptr, db_env, 0)))
|
||||
{
|
||||
close(); /* purecov: inspected */
|
||||
my_errno=error; /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
close(); /* purecov: inspected */
|
||||
my_errno=error; /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
}
|
||||
sprintf(part,"key%02d",++used_keys);
|
||||
key_type[i]=table->key_info[i].flags & HA_NOSAME ? DB_NOOVERWRITE : 0;
|
||||
@ -539,9 +545,9 @@ int ha_berkeley::open(const char *name, int mode, uint test_if_locked)
|
||||
if ((error=((*ptr)->open(*ptr, name_buff, part, DB_BTREE,
|
||||
open_mode, 0))))
|
||||
{
|
||||
close(); /* purecov: inspected */
|
||||
my_errno=error; /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
close(); /* purecov: inspected */
|
||||
my_errno=error; /* purecov: inspected */
|
||||
DBUG_RETURN(1); /* purecov: inspected */
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1042,6 +1048,7 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
|
||||
ulong thd_options = table->in_use ? table->in_use->options : 0;
|
||||
bool primary_key_changed;
|
||||
DBUG_ENTER("update_row");
|
||||
LINT_INIT(error);
|
||||
|
||||
statistic_increment(ha_update_count,&LOCK_status);
|
||||
if (table->time_stamp)
|
||||
@ -1066,7 +1073,6 @@ int ha_berkeley::update_row(const byte * old_row, byte * new_row)
|
||||
}
|
||||
|
||||
sub_trans = transaction;
|
||||
LINT_INIT(error);
|
||||
for (uint retry=0 ; retry < berkeley_trans_retry ; retry++)
|
||||
{
|
||||
key_map changed_keys = 0;
|
||||
|
@ -1399,14 +1399,18 @@ longlong Item_master_pos_wait::val_int()
|
||||
String *log_name = args[0]->val_str(&value);
|
||||
int event_count;
|
||||
|
||||
if(thd->slave_thread || !log_name || !log_name->length())
|
||||
{
|
||||
null_value = 1;
|
||||
return 0;
|
||||
}
|
||||
null_value=0;
|
||||
if (thd->slave_thread || !log_name || !log_name->length())
|
||||
{
|
||||
null_value = 1;
|
||||
return 0;
|
||||
}
|
||||
ulong pos = (ulong)args[1]->val_int();
|
||||
if((event_count = glob_mi.wait_for_pos(thd, log_name, pos)) == -1)
|
||||
null_value = 1;;
|
||||
if ((event_count = glob_mi.wait_for_pos(thd, log_name, pos)) == -1)
|
||||
{
|
||||
null_value = 1;
|
||||
event_count=0;
|
||||
}
|
||||
return event_count;
|
||||
}
|
||||
|
||||
|
@ -298,9 +298,9 @@ static int mc_sock_connect(my_socket s, const struct sockaddr *name,
|
||||
return(-1);
|
||||
|
||||
if (s_err)
|
||||
{ /* getsockopt() could suceed */
|
||||
{ // getsockopt() could succeed
|
||||
errno = s_err;
|
||||
return(-1); /* but return an error... */
|
||||
return(-1); // but return an error...
|
||||
}
|
||||
return(0); /* It's all good! */
|
||||
#endif
|
||||
@ -403,8 +403,8 @@ my_bool STDCALL mc_mysql_reconnect(MYSQL *mysql)
|
||||
|
||||
|
||||
int STDCALL
|
||||
mc_simple_command(MYSQL *mysql,enum enum_server_command command, const char *arg,
|
||||
uint length, my_bool skipp_check)
|
||||
mc_simple_command(MYSQL *mysql,enum enum_server_command command,
|
||||
const char *arg, uint length, my_bool skipp_check)
|
||||
{
|
||||
NET *net= &mysql->net;
|
||||
int result= -1;
|
||||
|
699
sql/slave.cc
699
sql/slave.cc
File diff suppressed because it is too large
Load Diff
@ -311,29 +311,30 @@ sweepstakes if you report the bug";
|
||||
// we need to start a packet with something other than 255
|
||||
// to distiquish it from error
|
||||
|
||||
if(pos == 4) // tell the client log name with a fake rotate_event
|
||||
// if we are at the start of the log
|
||||
{
|
||||
if(fake_rotate_event(net, packet, log_file_name, &errmsg))
|
||||
goto err;
|
||||
packet->length(0);
|
||||
packet->append("\0", 1);
|
||||
}
|
||||
// tell the client log name with a fake rotate_event
|
||||
// if we are at the start of the log
|
||||
if(pos == 4)
|
||||
{
|
||||
if (fake_rotate_event(net, packet, log_file_name, &errmsg))
|
||||
goto err;
|
||||
packet->length(0);
|
||||
packet->append("\0", 1);
|
||||
}
|
||||
|
||||
while(!net->error && net->vio != 0 && !thd->killed)
|
||||
while (!net->error && net->vio != 0 && !thd->killed)
|
||||
{
|
||||
pthread_mutex_t *log_lock = mysql_bin_log.get_log_lock();
|
||||
|
||||
while (!(error = Log_event::read_log_event(&log, packet, log_lock)))
|
||||
{
|
||||
if(my_net_write(net, (char*)packet->ptr(), packet->length()) )
|
||||
if (my_net_write(net, (char*)packet->ptr(), packet->length()) )
|
||||
{
|
||||
errmsg = "Failed on my_net_write()";
|
||||
goto err;
|
||||
}
|
||||
DBUG_PRINT("info", ("log event code %d",
|
||||
(*packet)[LOG_EVENT_OFFSET+1] ));
|
||||
if((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
|
||||
if ((*packet)[LOG_EVENT_OFFSET+1] == LOAD_EVENT)
|
||||
{
|
||||
if(send_file(thd))
|
||||
{
|
||||
@ -345,8 +346,7 @@ sweepstakes if you report the bug";
|
||||
packet->append("\0",1);
|
||||
}
|
||||
|
||||
|
||||
if(error != LOG_READ_EOF)
|
||||
if (error != LOG_READ_EOF)
|
||||
{
|
||||
switch(error)
|
||||
{
|
||||
@ -399,7 +399,8 @@ sweepstakes if you report the bug";
|
||||
|
||||
// no one will update the log while we are reading
|
||||
// now, but we'll be quick and just read one record
|
||||
switch(Log_event::read_log_event(&log, packet, log_lock))
|
||||
pthread_mutex_lock(log_lock);
|
||||
switch (Log_event::read_log_event(&log, packet, (pthread_mutex_t*) 0))
|
||||
{
|
||||
case 0:
|
||||
read_packet = 1;
|
||||
@ -407,15 +408,14 @@ sweepstakes if you report the bug";
|
||||
// slave
|
||||
break;
|
||||
case LOG_READ_EOF:
|
||||
pthread_mutex_lock(log_lock);
|
||||
pthread_cond_wait(&COND_binlog_update, log_lock);
|
||||
pthread_mutex_unlock(log_lock);
|
||||
break;
|
||||
|
||||
default:
|
||||
fatal_error = 1;
|
||||
break;
|
||||
}
|
||||
pthread_mutex_unlock(log_lock);
|
||||
|
||||
pthread_mutex_lock(&thd->mysys_var->mutex);
|
||||
thd->mysys_var->current_mutex= 0;
|
||||
|
@ -592,7 +592,7 @@ mysqld_show_logs(THD *thd)
|
||||
|
||||
#ifdef HAVE_BERKELEY_DB
|
||||
if (berkeley_show_logs(thd))
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(-1);
|
||||
#endif
|
||||
|
||||
send_eof(&thd->net);
|
||||
|
Reference in New Issue
Block a user