1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-07 00:04:31 +03:00

Review of new pushed code (XA & other)

Portability fixes and cleanups
Fixed setting of 'res' in mysql_execute_command()


sql/handler.cc:
  delete_table() will not return error for not found files if one handler file was found and deleted
sql/handler.h:
  Incremented MAX_HA so that ndb works again
  Don't convert char pointer to (my_xid*) as we don't know if the address is aligned on 8
sql/log.cc:
  Indentation fixes
  Simplified loop to find next log
  Fixed race condition in reset_logs that caused mix_innodb_myisam_binlog to fail
sql/log_event.cc:
  Don't convert char pointer to (my_xid*) as we don't know if the address is aligned on 8
sql/sql_acl.cc:
  Convert db name directly to avoid extra strmov
sql/sql_base.cc:
  Added comment
  Removed not needed code
sql/sql_db.cc:
  Added comment
  Remove not needed code
sql/sql_parse.cc:
  Always call mysql_rm_db() with lower case db name
  Ensure that 'res' is set correctly in mysql_execute_command()
  (One don't have to set res if one calls my_error() and res should be = 0 for correct commands)
sql/sql_repl.cc:
  Indentation fixes
  use packet->ptr() instead of packet->c_ptr()
sql/sql_table.cc:
  Join similar code when table didn't exist in engine
This commit is contained in:
unknown
2005-02-21 14:47:57 +02:00
parent da4604f9e8
commit d50af8aece
10 changed files with 146 additions and 138 deletions

View File

@@ -454,13 +454,14 @@ impossible position";
(*packet)[EVENT_TYPE_OFFSET+1]));
if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
{
binlog_can_be_corrupted= (*packet)[FLAGS_OFFSET+1] & LOG_EVENT_BINLOG_IN_USE_F;
binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
LOG_EVENT_BINLOG_IN_USE_F);
/*
mark that this event with "log_pos=0", so the slave
should not increment master's binlog position
(rli->group_master_log_pos)
*/
int4store(packet->c_ptr()+LOG_POS_OFFSET+1, 0);
int4store((char*) packet->ptr()+LOG_POS_OFFSET+1, 0);
/* send it */
if (my_net_write(net, (char*)packet->ptr(), packet->length()))
{
@@ -477,16 +478,21 @@ impossible position";
}
}
else
{
if (test_for_non_eof_log_read_errors(error, &errmsg))
goto err;
/*
else: it's EOF, nothing to do, go on reading next events, the
Format_description_log_event will be found naturally if it is written.
*/
/*
It's EOF, nothing to do, go on reading next events, the
Format_description_log_event will be found naturally if it is written.
*/
}
/* reset the packet as we wrote to it in any case */
packet->set("\0", 1, &my_charset_bin);
} /* end of if (pos > BIN_LOG_HEADER_SIZE); if false, the
Format_description_log_event event will be found naturally. */
} /* end of if (pos > BIN_LOG_HEADER_SIZE); */
else
{
/* The Format_description_log_event event will be found naturally. */
}
/* seek to the requested position, to start the requested dump */
my_b_seek(&log, pos); // Seek will done on next read
@@ -506,7 +512,8 @@ impossible position";
#endif
if ((*packet)[EVENT_TYPE_OFFSET+1] == FORMAT_DESCRIPTION_EVENT)
binlog_can_be_corrupted= (*packet)[FLAGS_OFFSET+1] & LOG_EVENT_BINLOG_IN_USE_F;
binlog_can_be_corrupted= test((*packet)[FLAGS_OFFSET+1] &
LOG_EVENT_BINLOG_IN_USE_F);
else if ((*packet)[EVENT_TYPE_OFFSET+1] == STOP_EVENT)
binlog_can_be_corrupted= FALSE;
@@ -755,9 +762,9 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
else if (server_id_supplied && *mi->host)
{
/*
If we will start SQL thread we will care about UNTIL options If
not and they are specified we will ignore them and warn user
about this fact.
If we will start SQL thread we will care about UNTIL options If
not and they are specified we will ignore them and warn user
about this fact.
*/
if (thread_mask & SLAVE_SQL)
{
@@ -772,14 +779,14 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
since it is checked in sql_yacc.yy
*/
strmake(mi->rli.until_log_name, thd->lex->mi.log_file_name,
sizeof(mi->rli.until_log_name)-1);
sizeof(mi->rli.until_log_name)-1);
}
else if (thd->lex->mi.relay_log_pos)
{
mi->rli.until_condition= RELAY_LOG_INFO::UNTIL_RELAY_POS;
mi->rli.until_log_pos= thd->lex->mi.relay_log_pos;
strmake(mi->rli.until_log_name, thd->lex->mi.relay_log_name,
sizeof(mi->rli.until_log_name)-1);
sizeof(mi->rli.until_log_name)-1);
}
else
clear_until_condition(&mi->rli);
@@ -810,7 +817,8 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
/* Issuing warning then started without --skip-slave-start */
if (!opt_skip_slave_start)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_MISSING_SKIP_SLAVE,
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_MISSING_SKIP_SLAVE,
ER(ER_MISSING_SKIP_SLAVE));
}
@@ -818,7 +826,7 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
}
else if (thd->lex->mi.pos || thd->lex->mi.relay_log_pos)
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_UNTIL_COND_IGNORED,
ER(ER_UNTIL_COND_IGNORED));
ER(ER_UNTIL_COND_IGNORED));
if (!slave_errno)
slave_errno = start_slave_threads(0 /*no mutex */,
@@ -831,10 +839,12 @@ int start_slave(THD* thd , MASTER_INFO* mi, bool net_report)
slave_errno = ER_BAD_SLAVE;
}
else
//no error if all threads are already started, only a warning
{
/* no error if all threads are already started, only a warning */
push_warning(thd, MYSQL_ERROR::WARN_LEVEL_NOTE, ER_SLAVE_WAS_RUNNING,
ER(ER_SLAVE_WAS_RUNNING));
}
unlock_slave_threads(mi);
if (slave_errno)