[Groonga-mysql-commit] mroonga/mroonga at 2ac2d7d [master] Add compatible code

Back to archive index

Naoya Murakami null+****@clear*****
Thu Aug 17 07:38:29 JST 2017


Naoya Murakami	2017-08-17 07:38:29 +0900 (Thu, 17 Aug 2017)

  New Revision: 2ac2d7de92e73f7e0706f3d0f42ec0df7513d040
  https://github.com/mroonga/mroonga/commit/2ac2d7de92e73f7e0706f3d0f42ec0df7513d040

  Merged 1d8f294: Merge pull request #163 from naoa/support-inplace-alter-table-for-stored-generated-column

  Message:
    Add compatible code

  Modified files:
    ha_mroonga.cpp
    mrn_mysql_compat.h

  Modified: ha_mroonga.cpp (+1 -1)
===================================================================
--- ha_mroonga.cpp    2017-08-17 06:55:53 +0900 (5337e893)
+++ ha_mroonga.cpp    2017-08-17 07:38:29 +0900 (47cc4f8b)
@@ -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;

  Modified: mrn_mysql_compat.h (+10 -0)
===================================================================
--- mrn_mysql_compat.h    2017-08-17 06:55:53 +0900 (71039f3e)
+++ mrn_mysql_compat.h    2017-08-17 07:38:29 +0900 (aa6ec5c2)
@@ -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_ */
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index