summaryrefslogtreecommitdiff
path: root/sql/sql_plugin.cc
diff options
context:
space:
mode:
authorRamil Kalimullin <ramil@mysql.com>2008-07-09 16:52:26 +0500
committerRamil Kalimullin <ramil@mysql.com>2008-07-09 16:52:26 +0500
commitd59b37130513b7d8b20f98f9bfe49546cc1e8757 (patch)
treef1f32846f38671d1d6d0e04ed4fbace4eeb99e61 /sql/sql_plugin.cc
parent5cf61bd3446a4e4d8334f407fcfe0bdfdfe5e116 (diff)
downloadmariadb-git-d59b37130513b7d8b20f98f9bfe49546cc1e8757.tar.gz
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: use the correct data type when dereferencing variable values. sql/sql_plugin.cc: Fix for bug#37669: Server crash by setting "@@session.innodb_table_locks" Use *(my_bool *) typecast to avoid misaligned reading/writing and to get/set proper boolean values.
Diffstat (limited to 'sql/sql_plugin.cc')
-rw-r--r--sql/sql_plugin.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index 0fe79a8945d..b9733f2eec0 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -1882,7 +1882,7 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var,
}
result= (int) tmp;
}
- *(int*)save= -result;
+ *(my_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;
+ *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE;
}