Commit d7a64b5e authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

refs #5254 get fast update strict mode check working on 5.5

git-svn-id: file:///svn/mysql/tokudb-engine/tokudb-engine@50603 c7de825b-a66e-492c-adef-691d508d4ae1
parent d6d24c79
...@@ -399,6 +399,14 @@ static bool clustering_keys_exist(TABLE *table) { ...@@ -399,6 +399,14 @@ static bool clustering_keys_exist(TABLE *table) {
return false; return false;
} }
static bool is_strict_mode(THD *thd) {
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
return thd->is_strict_mode();
#else
return test(thd->variables.sql_mode & (MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES));
#endif
}
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699 #if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
#include <binlog.h> #include <binlog.h>
#elif 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599 #elif 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599
...@@ -414,11 +422,9 @@ bool ha_tokudb::check_fast_update(THD *thd, List<Item> &fields, List<Item> &valu ...@@ -414,11 +422,9 @@ bool ha_tokudb::check_fast_update(THD *thd, List<Item> &fields, List<Item> &valu
if (!transaction) if (!transaction)
return false; return false;
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
// avoid strict mode arithmetic overflow issues // avoid strict mode arithmetic overflow issues
if (thd->is_strict_mode()) if (is_strict_mode(thd))
return false; return false;
#endif
// no triggers // no triggers
if (table->triggers) if (table->triggers)
...@@ -666,11 +672,9 @@ bool ha_tokudb::check_upsert(THD *thd, List<Item> &update_fields, List<Item> &up ...@@ -666,11 +672,9 @@ bool ha_tokudb::check_upsert(THD *thd, List<Item> &update_fields, List<Item> &up
if (!transaction) if (!transaction)
return false; return false;
#if 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699
// avoid strict mode arithmetic overflow issues // avoid strict mode arithmetic overflow issues
if (thd->is_strict_mode()) if (is_strict_mode(thd))
return false; return false;
#endif
// no triggers // no triggers
if (table->triggers) if (table->triggers)
......
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