null+****@clear*****
null+****@clear*****
2012年 5月 7日 (月) 19:17:40 JST
Kouhei Sutou 2012-05-07 19:17:40 +0900 (Mon, 07 May 2012) New Revision: 46f82eb903a496f942466209592d9a278237694b Log: mysql5.1: make buildable but alter_table_disable_enable_keys still fails refs #1310 #1311 Modified files: lib/mrn_auto_increment_value_lock.cpp Modified: lib/mrn_auto_increment_value_lock.cpp (+8 -2) =================================================================== --- lib/mrn_auto_increment_value_lock.cpp 2012-05-07 19:07:10 +0900 (0910eeb) +++ lib/mrn_auto_increment_value_lock.cpp 2012-05-07 19:17:40 +0900 (2b0e068) @@ -19,18 +19,24 @@ #include "mrn_auto_increment_value_lock.hpp" +#if MYSQL_VERSION_ID >= 50500 +# define AUTO_INCREMENT_VALUE_MUTEX(table_share) (&(table_share->LOCK_ha_data)) +#else +# define AUTO_INCREMENT_VALUE_MUTEX(table_share) (&(table_share->mutex)) +#endif + namespace mrn { AutoIncrementValueLock::AutoIncrementValueLock(TABLE_SHARE *table_share) : table_share_(table_share), need_lock_(table_share_->tmp_table == NO_TMP_TABLE) { if (need_lock_) { - mysql_mutex_lock(&table_share_->LOCK_ha_data); + mysql_mutex_lock(AUTO_INCREMENT_VALUE_MUTEX(table_share_)); } } AutoIncrementValueLock::~AutoIncrementValueLock() { if (need_lock_) { - mysql_mutex_unlock(&table_share_->LOCK_ha_data); + mysql_mutex_unlock(AUTO_INCREMENT_VALUE_MUTEX(table_share_)); } } }