Commit f2d6046e authored by unknown's avatar unknown

Due to a compiler bug, slave.cc:tables_ok() sometimes wrongly returns

1 if the return type is int or int_fast8_t.  The test case that showed
this problem is rpl000001 and the tested version was MySQL 5.0.2.  The
compiler with the problem is GCC 3.0.4 runing on "Linux bitch 2.4.18
#2 Thu Apr 11 14:37:17 EDT 2002 sparc64 unknown".

By changing the return type to bool the problem disappear.  (Another
way to make the problem disappear is to simply print the returned
value with printf("%d",?).  The printed returned value is always 0 in
the test cases I have run.)  This is only a partial solution to the
problem, since someone could later change the return type of the
function back to int or some other type that does not work.


sql/slave.cc:
  Changed type
sql/slave.h:
  Changed type
parent abf0ab9e
...@@ -759,7 +759,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) ...@@ -759,7 +759,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len)
1 should be logged/replicated 1 should be logged/replicated
*/ */
int tables_ok(THD* thd, TABLE_LIST* tables) bool tables_ok(THD* thd, TABLE_LIST* tables)
{ {
bool some_tables_updating= 0; bool some_tables_updating= 0;
DBUG_ENTER("tables_ok"); DBUG_ENTER("tables_ok");
......
...@@ -496,7 +496,7 @@ int show_master_info(THD* thd, MASTER_INFO* mi); ...@@ -496,7 +496,7 @@ int show_master_info(THD* thd, MASTER_INFO* mi);
int show_binlog_info(THD* thd); int show_binlog_info(THD* thd);
/* See if the query uses any tables that should not be replicated */ /* See if the query uses any tables that should not be replicated */
int tables_ok(THD* thd, TABLE_LIST* tables); bool tables_ok(THD* thd, TABLE_LIST* tables);
/* /*
Check to see if the database is ok to operate on with respect to the Check to see if the database is ok to operate on with respect to the
......
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