List:Commits« Previous MessageNext Message »
From:Ramil Kalimullin Date:June 27 2008 2:44pm
Subject:bzr commit into mysql-5.1 branch (ramil:2677) Bug#37669
View as plain text  
#At file:///home/ram/mysql/b37669.5.1/

 2677 Ramil Kalimullin	2008-06-27
      Fix for bug#37669: Server crash by setting "@@session.innodb_table_locks"
      
      Problem: reading/writing data from/to an address without proper 
      alignment leads to SIGBUS on some platforms.
      
      Fix: avoid that.
modified:
  sql/sql_plugin.cc

per-file messages:
  sql/sql_plugin.cc
    Fix for bug#37669: Server crash by setting "@@session.innodb_table_locks"
    
    Use *(bool *) typecast to avoid misaligned reading/writing and 
    to get/set proper boolean values.
=== modified file 'sql/sql_plugin.cc'
--- a/sql/sql_plugin.cc	2008-05-30 10:21:45 +0000
+++ b/sql/sql_plugin.cc	2008-06-27 14:44:15 +0000
@@ -1882,7 +1882,7 @@ static int check_func_bool(THD *thd, str
     }
     result= (int) tmp;
   }
-  *(int*)save= -result;
+  *(bool *) save= -result;
   return 0;
 err:
   my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), var->name, strvalue);
@@ -2063,7 +2063,7 @@ err:
 static void update_func_bool(THD *thd, struct st_mysql_sys_var *var,
                              void *tgt, const void *save)
 {
-  *(my_bool *) tgt= *(int *) save ? 1 : 0;
+  *(bool *) tgt= *(bool *) save ? TRUE : FALSE;
 }
 
 

Thread
bzr commit into mysql-5.1 branch (ramil:2677) Bug#37669Ramil Kalimullin27 Jun