Kouhei Sutou
null+****@clear*****
Tue Mar 17 21:36:02 JST 2015
Kouhei Sutou 2015-03-17 21:36:02 +0900 (Tue, 17 Mar 2015) New Revision: 7c39419154e53d7418ad3e11948716ce65456de2 https://github.com/mroonga/mroonga/commit/7c39419154e53d7418ad3e11948716ce65456de2 Message: mysql57: follow value decode API change Modified files: ha_mroonga.cpp lib/mrn_value_decoder.hpp Modified: ha_mroonga.cpp (+4 -3) =================================================================== --- ha_mroonga.cpp 2015-03-17 21:28:18 +0900 (a971145) +++ ha_mroonga.cpp 2015-03-17 21:36:02 +0900 (440d045) @@ -90,6 +90,7 @@ #include <mrn_smart_grn_obj.hpp> #include <mrn_database_manager.hpp> #include <mrn_grn.hpp> +#include <mrn_value_decoder.hpp> #ifdef MRN_SUPPORT_FOREIGN_KEYS # include <sql_table.h> @@ -10933,7 +10934,7 @@ int ha_mroonga::storage_encode_key_enum(Field *field, const uchar *key, memcpy(buf, &value, *size); } else { uint16 value; - shortget(value, key); + mrn::value_decoder::decode(&value, key); *size = 2; memcpy(buf, &value, *size); } @@ -11045,7 +11046,7 @@ int ha_mroonga::storage_encode_key(Field *field, const uchar *key, { float float_value; double double_value; - float4get(float_value, ptr); + mrn::value_decoder::decode(&float_value, ptr); double_value = float_value; memcpy(buf, &double_value, 8); *size = 8; @@ -11054,7 +11055,7 @@ int ha_mroonga::storage_encode_key(Field *field, const uchar *key, case MYSQL_TYPE_DOUBLE: { double val; - float8get(val, ptr); + mrn::value_decoder::decode(&val, ptr); memcpy(buf, &val, 8); *size = 8; break; Modified: lib/mrn_value_decoder.hpp (+10 -0) =================================================================== --- lib/mrn_value_decoder.hpp 2015-03-17 21:28:18 +0900 (a1d1238) +++ lib/mrn_value_decoder.hpp 2015-03-17 21:36:02 +0900 (641cf98) @@ -28,6 +28,16 @@ namespace mrn { namespace value_decoder { + void decode(uint16 *dest, const uchar *source) { +#ifdef MRN_DEST_IS_POINTER + ushortget(dest, source); +#else + uint16 value; + ushortget(value, source); + *dest = value; +#endif + }; + void decode(float *dest, const uchar *source) { #ifdef MRN_DEST_IS_POINTER float4get(dest, source); -------------- next part -------------- HTML����������������������������... 下载