mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Portability fixes.
Improve mysql-test to be more robust. Fix that GRANT doesn't delete SSL options Change innobase_flush_log_at_trx_commit to uint. Don't rotate logs if we read a rotate log entry from the master. Docs/manual.texi: Changelog client/mysqlbinlog.cc: Handle empty binlogfiles gracefully client/mysqltest.c: Do a sleep after 'sync_with_master' Cleaned up sleep() handling. Free all memory on exit configure.in: Fix for Mac OS 10.2 include/my_sys.h: Added my_strdup_with_length() innobase/btr/btr0cur.c: Fixed wrong printf() libmysql/libmysql.c: Added DBUG_PRINT statements. Assume that mysql_...send() functions has correct query length. mysql-test/mysql-test-run.sh: Properly remove log files before starting new tests. mysql-test/r/grant.result: Update for new test results mysql-test/r/innodb.result: Update for new test results mysql-test/r/myisam.result: Update for new test results mysql-test/r/rpl_log.result: Update for new test results mysql-test/r/rpl_rotate_logs.result: Update for new test results mysql-test/r/variables.result: Update for new test results mysql-test/t/grant.test: Test that GRANT doesn't delete SSL options mysql-test/t/myisam.test: Test long key usage mysql-test/t/rpl_log.test: Disable 'show new master' mysql-test/t/rpl_mystery22.test: Longer sleep for more safety. mysql-test/t/rpl_rotate_logs.test: More comments mysys/my_malloc.c: Added my_strdup_with_length() mysys/safemalloc.c: Added my_strdup_with_length() mysys/thr_alarm.c: Fix of alarms for windows. sql/ha_innodb.cc: Change innobase_flush_log_at_trx_commit to uint mysql-test/r/rpl_redirect.result: Updated test results mysql-test/t/rpl_redirect.test: Added more tests to improve code coverage. sql/ha_innodb.h: Change innobase_flush_log_at_trx_commit to uint sql/item_func.cc: Return GLOBAL and SESSION as part of column names sql/log.cc: Only write STOP events when server goes down. sql/log_event.cc: Don't rotate logs if we read a rotate log entry from the master. sql/log_event.h: Change ident_len to uint (more efficient) sql/mysqld.cc: Change innobase_flush_log_at_trx_commit to uint sql/net_serv.cc: More debug output sql/repl_failsafe.cc: More DEBUG Search until we find next position in binary log (and not only =) sql/slave.cc: More DBUG & comments Don't rotate the binary log on master flush logs sql/slave.h: indentation change sql/sql_acl.cc: Test that GRANT doesn't delete SSL options sql/sql_parse.cc: Disable show_new_master. sql/sql_repl.cc: Chamger show_binlog_events() to use my_error() sql/sql_table.cc: Fixed check for too long keys in MyISAM sql/sql_udf.cc: Fix udf handling
This commit is contained in:
@ -1049,21 +1049,21 @@ read_one_row(MYSQL *mysql,uint fields,MYSQL_ROW row, ulong *lengths)
|
||||
int STDCALL mysql_master_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
DBUG_ENTER("mysql_master_query");
|
||||
if (mysql_master_send_query(mysql, q, length))
|
||||
return 1;
|
||||
return mysql_read_query_result(mysql);
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(mysql_read_query_result(mysql));
|
||||
}
|
||||
|
||||
int STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
MYSQL*master = mysql->master;
|
||||
if (!length)
|
||||
length = strlen(q);
|
||||
MYSQL *master = mysql->master;
|
||||
DBUG_ENTER("mysql_master_send_query");
|
||||
if (!master->net.vio && !mysql_real_connect(master,0,0,0,0,0,0,0))
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
mysql->last_used_con = master;
|
||||
return simple_command(master, COM_QUERY, q, length, 1);
|
||||
DBUG_RETURN(simple_command(master, COM_QUERY, q, length, 1));
|
||||
}
|
||||
|
||||
|
||||
@ -1071,30 +1071,31 @@ int STDCALL mysql_master_send_query(MYSQL *mysql, const char *q,
|
||||
int STDCALL mysql_slave_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
DBUG_ENTER("mysql_slave_query");
|
||||
if (mysql_slave_send_query(mysql, q, length))
|
||||
return 1;
|
||||
return mysql_read_query_result(mysql);
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(mysql_read_query_result(mysql));
|
||||
}
|
||||
|
||||
int STDCALL mysql_slave_send_query(MYSQL *mysql, const char *q,
|
||||
unsigned long length)
|
||||
{
|
||||
MYSQL* last_used_slave, *slave_to_use = 0;
|
||||
DBUG_ENTER("mysql_slave_send_query");
|
||||
|
||||
if ((last_used_slave = mysql->last_used_slave))
|
||||
slave_to_use = last_used_slave->next_slave;
|
||||
else
|
||||
slave_to_use = mysql->next_slave;
|
||||
/* next_slave is always safe to use - we have a circular list of slaves
|
||||
if there are no slaves, mysql->next_slave == mysql
|
||||
/*
|
||||
Next_slave is always safe to use - we have a circular list of slaves
|
||||
if there are no slaves, mysql->next_slave == mysql
|
||||
*/
|
||||
mysql->last_used_con = mysql->last_used_slave = slave_to_use;
|
||||
if (!length)
|
||||
length = strlen(q);
|
||||
if (!slave_to_use->net.vio && !mysql_real_connect(slave_to_use, 0,0,0,
|
||||
0,0,0,0))
|
||||
return 1;
|
||||
return simple_command(slave_to_use, COM_QUERY, q, length, 1);
|
||||
DBUG_RETURN(1);
|
||||
DBUG_RETURN(simple_command(slave_to_use, COM_QUERY, q, length, 1));
|
||||
}
|
||||
|
||||
|
||||
@ -1307,8 +1308,7 @@ err:
|
||||
enum mysql_rpl_type
|
||||
STDCALL mysql_rpl_query_type(const char* q, int len)
|
||||
{
|
||||
const char* q_end;
|
||||
q_end = (len) ? q + len : strend(q);
|
||||
const char *q_end= q + len;
|
||||
for (; q < q_end; ++q)
|
||||
{
|
||||
char c;
|
||||
@ -2203,20 +2203,24 @@ STDCALL mysql_add_slave(MYSQL* mysql, const char* host,
|
||||
int STDCALL
|
||||
mysql_send_query(MYSQL* mysql, const char* query, ulong length)
|
||||
{
|
||||
DBUG_ENTER("mysql_send_query");
|
||||
DBUG_PRINT("enter",("rpl_parse: %d rpl_pivot: %d",
|
||||
mysql->options.rpl_parse, mysql->rpl_pivot));
|
||||
|
||||
if (mysql->options.rpl_parse && mysql->rpl_pivot)
|
||||
{
|
||||
switch (mysql_rpl_query_type(query, length)) {
|
||||
case MYSQL_RPL_MASTER:
|
||||
return mysql_master_send_query(mysql, query, length);
|
||||
DBUG_RETURN(mysql_master_send_query(mysql, query, length));
|
||||
case MYSQL_RPL_SLAVE:
|
||||
return mysql_slave_send_query(mysql, query, length);
|
||||
DBUG_RETURN(mysql_slave_send_query(mysql, query, length));
|
||||
case MYSQL_RPL_ADMIN:
|
||||
break; /* fall through */
|
||||
}
|
||||
}
|
||||
|
||||
mysql->last_used_con = mysql;
|
||||
return simple_command(mysql, COM_QUERY, query, length, 1);
|
||||
DBUG_RETURN(simple_command(mysql, COM_QUERY, query, length, 1));
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user