Navigation Menu

Skip to content

Commit

Permalink
Add compatible code
Browse files Browse the repository at this point in the history
  • Loading branch information
naoa committed Aug 16, 2017
1 parent ed6221f commit 2ac2d7d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ha_mroonga.cpp
Expand Up @@ -15184,7 +15184,7 @@ bool ha_mroonga::storage_inplace_alter_table_add_column(
GRN_VOID_INIT(&new_value);
while (!(error = storage_rnd_next(table->record[0]))) {
#ifdef MRN_MARIADB_P
altered_table->update_virtual_field(altered_field);
MRN_GENERATED_COLUMNS_UPDATE_VIRTUAL_FIELD(altered_table, altered_field);
#else
if (update_generated_write_fields(&generated_column_bitmap, altered_table)) {
error = ER_WRONG_COLUMN_NAME;
Expand Down
10 changes: 10 additions & 0 deletions mrn_mysql_compat.h
Expand Up @@ -468,4 +468,14 @@
# endif
#endif

#ifdef MRN_MARIADB_P
# if (MYSQL_VERSION_ID >= 100203)
# define MRN_GENERATED_COLUMNS_UPDATE_VIRTUAL_FIELD(table, field) \
(table->update_virtual_field(field))
# else
# define MRN_GENERATED_COLUMNS_UPDATE_VIRTUAL_FIELD(table, field) \
(field->vcol_info->expr_item->save_in_field(field, 0))
# endif
#endif

#endif /* MRN_MYSQL_COMPAT_H_ */

0 comments on commit 2ac2d7d

Please sign in to comment.