diff --git a/storage/tokudb/ha_tokudb_alter_56.cc b/storage/tokudb/ha_tokudb_alter_56.cc index f111f75c464..a0afcc4735c 100644 --- a/storage/tokudb/ha_tokudb_alter_56.cc +++ b/storage/tokudb/ha_tokudb_alter_56.cc @@ -91,13 +91,15 @@ PATENT RIGHTS GRANT: #if TOKU_INCLUDE_ALTER_56 #if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099 -#define TOKU_ALTER_RENAME ALTER_RENAME_56 -#elif 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 #define TOKU_ALTER_RENAME ALTER_RENAME -#elif 50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699 +#define DYNAMIC_ARRAY_ELEMENTS_TYPE size_t +#elif (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ + (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) #define TOKU_ALTER_RENAME ALTER_RENAME +#define DYNAMIC_ARRAY_ELEMENTS_TYPE int #elif 50500 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50599 #define TOKU_ALTER_RENAME ALTER_RENAME_56 +#define DYNAMIC_ARRAY_ELEMENTS_TYPE int #else #error #endif @@ -838,7 +840,7 @@ static bool change_length_is_supported(TABLE *table, TABLE *altered_table, Alter return false; if (ctx->changed_fields.elements() > 1) return false; // only support one field change - for (int ai = 0; ai < ctx->changed_fields.elements(); ai++) { + for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; ai < ctx->changed_fields.elements(); ai++) { uint i = ctx->changed_fields.at(ai); Field *old_field = table->field[i]; Field *new_field = altered_table->field[i]; @@ -860,7 +862,7 @@ static bool is_sorted(Dynamic_array &a) { bool r = true; if (a.elements() > 0) { uint lastelement = a.at(0); - for (int i = 1; i < a.elements(); i++) + for (DYNAMIC_ARRAY_ELEMENTS_TYPE i = 1; i < a.elements(); i++) if (lastelement > a.at(i)) r = false; } @@ -871,7 +873,7 @@ int ha_tokudb::alter_table_expand_columns(TABLE *altered_table, Alter_inplace_in int error = 0; tokudb_alter_ctx *ctx = static_cast(ha_alter_info->handler_ctx); assert(is_sorted(ctx->changed_fields)); // since we build the changed_fields array in field order, it must be sorted - for (int ai = 0; error == 0 && ai < ctx->changed_fields.elements(); ai++) { + for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; error == 0 && ai < ctx->changed_fields.elements(); ai++) { uint expand_field_num = ctx->changed_fields.at(ai); error = alter_table_expand_one_column(altered_table, ha_alter_info, expand_field_num); } @@ -1129,7 +1131,7 @@ static bool change_type_is_supported(TABLE *table, TABLE *altered_table, Alter_i return false; if (ctx->changed_fields.elements() > 1) return false; // only support one field change - for (int ai = 0; ai < ctx->changed_fields.elements(); ai++) { + for (DYNAMIC_ARRAY_ELEMENTS_TYPE ai = 0; ai < ctx->changed_fields.elements(); ai++) { uint i = ctx->changed_fields.at(ai); Field *old_field = table->field[i]; Field *new_field = altered_table->field[i]; diff --git a/storage/tokudb/hatoku_cmp.cc b/storage/tokudb/hatoku_cmp.cc index d32887f2f2b..ef3ecd296fd 100644 --- a/storage/tokudb/hatoku_cmp.cc +++ b/storage/tokudb/hatoku_cmp.cc @@ -118,7 +118,8 @@ bool field_valid_for_tokudb_table(Field* field) { case MYSQL_TYPE_DOUBLE: case MYSQL_TYPE_FLOAT: #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ - (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) + (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ + (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099) case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIME2: @@ -266,7 +267,8 @@ TOKU_TYPE mysql_to_toku_type (Field* field) { ret_val = toku_type_float; goto exit; #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ - (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) + (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ + (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099) case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIME2: @@ -3227,7 +3229,8 @@ bool fields_are_same_type( case MYSQL_TYPE_TIME: case MYSQL_TYPE_TIMESTAMP: #if (50600 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50699) || \ - (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) + (50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799) || \ + (100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099) case MYSQL_TYPE_DATETIME2: case MYSQL_TYPE_TIMESTAMP2: case MYSQL_TYPE_TIME2: diff --git a/storage/tokudb/hatoku_defines.h b/storage/tokudb/hatoku_defines.h index 6f1dbbbef2f..10b42f04f4e 100644 --- a/storage/tokudb/hatoku_defines.h +++ b/storage/tokudb/hatoku_defines.h @@ -121,6 +121,16 @@ PATENT RIGHTS GRANT: #if defined(TOKUDB_PATCHES) && TOKUDB_PATCHES == 0 +#elif 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099 +#define TOKU_USE_DB_TYPE_TOKUDB 1 +#define TOKU_INCLUDE_ALTER_56 1 +#define TOKU_INCLUDE_ROW_TYPE_COMPRESSION 0 +#define TOKU_INCLUDE_XA 1 +#define TOKU_INCLUDE_WRITE_FRM_DATA 0 +#if defined(MARIADB_BASE_VERSION) +#define TOKU_INCLUDE_EXTENDED_KEYS 1 +#endif + #elif 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799 #define TOKU_USE_DB_TYPE_UNKNOWN 1 #define TOKU_INCLUDE_ALTER_56 1