Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken package build for mysql56-comunity and mysql57-community with Mroonga 7.01 #136

Closed
kenhys opened this issue Apr 13, 2017 · 2 comments

Comments

@kenhys
Copy link
Member

kenhys commented Apr 13, 2017

What is problem?

mroonga/packages/yum $ make build

Fails to build mysql56-community and mysql57-community. So we can't provide rebuilt package for newer MySQL version.

Why build fails?

MySQL 5.6.36 and MySQL 5.7.18 drops Field::part_of_key_not_clustered member variable from sql/field.h. Mroonga uses this variable.

==> centos-6-x86_64: libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I/root/rpmbuild/BUILD/mroonga-7.01/../mysql-5.6.36/mysql-5.6.36/includ
e -I/root/rpmbuild/BUILD/mroonga-7.01/../mysql-5.6.36/mysql-5.6.36/sql -I/root/rpmbuild/BUILD/mroonga-7.01/../mysql-5.6.36/mysql-5.6.36/include -I/root/rpmbuild/BUILD/mroonga-7.01/../mysql-5.6.36/mysql-5.6.36/regex -I/root/rpmbuild/BUILD/mroonga-7.01/../mysql-5.6.36/mysql-5.6.36 -I/usr/include/mysql -I/usr/include/groonga -I./lib -I/usr/include/mysql -g -fstack-protector -m64 -fPIC -g -fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing -DMYSQL_DYNAMIC_PLUGIN -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing -Wno-deprecated -fno-implicit-templates -felide-constructors -fno-exceptions -fno-rtti -MT ha_mroonga_la-ha_mroonga.lo -MD -MP -MF .deps/ha_mroonga_la-ha_mroonga.Tpo -c ha_mroonga.cpp  -fPIC -DPIC -o .libs/ha_mroonga_la-ha_mroonga.o
==> centos-6-x86_64: ha_mroonga.cpp: In member function 'void ha_mroonga::wrapper_overwrite_index_bits()':
==> centos-6-x86_64: ha_mroonga.cpp:4290: error: 'class Field' has no member named 'part_of_key_not_clustered'
==> centos-6-x86_64: ha_mroonga.cpp:4306: error: 'class Field' has no member named 'part_of_key_not_clustered'
==> centos-6-x86_64: make[2]: *** [ha_mroonga_la-ha_mroonga.lo] Error 1

How to fix it?

It should fix mrn_mysql_compat.h and ha_mroonga.cpp to support them.

@kenhys
Copy link
Member Author

kenhys commented Apr 13, 2017

I think that the following patch works, but it may also need to set part_of_key_not_extended or use is_part_of_actual_key() to fix this issue correctly.

diff --git a/ha_mroonga.cpp b/ha_mroonga.cpp
index 6e7a9d31..9cab427a 100644
--- a/ha_mroonga.cpp
+++ b/ha_mroonga.cpp
@@ -4287,7 +4287,9 @@ void ha_mroonga::wrapper_overwrite_index_bits()
   {
     Field *field = table_share->field[i];
     field->part_of_key.clear_all();
+#ifdef MRN_HAVE_MYSQL_FIELD_PART_OF_KEY_NOT_CLUSTERED
     field->part_of_key_not_clustered.clear_all();
+#endif
     field->part_of_sortkey.clear_all();
   }
   for (i = 0; i < table_share->keys; i++) {
@@ -4303,7 +4305,9 @@ void ha_mroonga::wrapper_overwrite_index_bits()
         {
           table_share->keys_for_keyread.set_bit(i);
           field->part_of_key.set_bit(i);
+#ifdef MRN_HAVE_MYSQL_FIELD_PART_OF_KEY_NOT_CLUSTERED
           field->part_of_key_not_clustered.set_bit(i);
+#endif
         }
         if (index_flags(i, j, 1) & HA_READ_ORDER)
           field->part_of_sortkey.set_bit(i);
diff --git a/mrn_mysql_compat.h b/mrn_mysql_compat.h
index 4891b67b..65122f27 100644
--- a/mrn_mysql_compat.h
+++ b/mrn_mysql_compat.h
@@ -351,4 +351,9 @@
   (c == FN_LIBCHAR || c == FN_LIBCHAR2)
 #endif
 
+#if ((MYSQL_VERSION_ID < 50636) || \
+    (MYSQL_VERSION_ID >= 50700 && MYSQL_VERSION_ID < 50718)) && !defined(MRN_MARIADB_P)
+#  define MRN_HAVE_MYSQL_FIELD_PART_OF_KEY_NOT_CLUSTERED
+#endif
+
 #endif /* MRN_MYSQL_COMPAT_H_ */

@kenhys kenhys mentioned this issue Apr 25, 2017
22 tasks
@kou
Copy link
Member

kou commented Apr 25, 2017

I applied this patch again and added a comment at 250dd0b
This change was introduced to use an InnoDB index for SELECT COUNT(*) FROM wrapper_mode_table at 72bb62c. See also http://redmine.groonga.org/issues/1196 .

mysql-test/mroonga/wrapper/count_star/mysql_5_7_or_later/t/with_index.test isn't broken with this patch. So the original case isn't broken with this patch. There may be unknown cases that InnoDB indexes aren't used. But we don't know these cases for now. So we don't think these cases for now. We'll consider these cases when someone notices them.

@kou kou closed this as completed Apr 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants