Remove unnecessary #ifdefs and dead code, in Spider, which is protected by #ifdef.
Some time ago, the Spider was a separate project, and Kentoku tried to make it compile on many MySQL and MariaDB versions without changes. So, there are many #ifdef macro in the Spider codebase, which were to adjust Spider for changes in API over different server versions. For example, see ITEM_FUNC_CASE_PARAMS_ARE_PUBLIC. Now, the Spider is part of the source tree, and thus we can remove dead code in #ifdef.
Use unifdef as far as possible.
Attachments
Issue Links
relates to
MDEV-26858Spider: Remove dead code related to HandlerSocket
Closed
MDEV-26912Spider: Remove dead code related to Oracle OCI
Hi holyfoot, ptal thanks. There are 22 commits below, including some previously fixed subtask MDEVs for higher versions, as well as all remaining unfixed subtask MDEVs. The commits not applicable to any subtask are marked with the present ticket, i.e. MDEV-26178. All subtasks covered by these changes will have their fixversions updated accordingly once they are pushed.
I have also applied the commits on 10.6 and 11.1, which are at af5c50df1a4bd2e796ce51745d0ee076ffb07419 and b7af1f4fb67f6e52c217127f859540bdeb5f4639 respectively.
Yuchen Pei
added a comment - - edited Hi holyfoot , ptal thanks. There are 22 commits below, including some previously fixed subtask MDEVs for higher versions, as well as all remaining unfixed subtask MDEVs. The commits not applicable to any subtask are marked with the present ticket, i.e. MDEV-26178 . All subtasks covered by these changes will have their fixversions updated accordingly once they are pushed.
7e000f0e075 upstream/bb-10.5-mdev-26178 MDEV-27648 remove #define HASH_UPDATE_WITH_HASH_VALUE
8005450625d MDEV-26178 spider: delete spd_environ.h
c5638c5e9bb MDEV-27644 Spider: remove HANDLER_HAS_DIRECT_AGGREGATE
b963146789c MDEV-27662 remove SPIDER_SUPPORT_CREATE_OR_REPLACE_TABLE
fb512706b7a MDEV-27809 remove SPIDER_I_S_USE_SHOW_FOR_COLUMN
770220edff0 MDEV-27652 remove #ifdef HA_HAS_CHECKSUM_EXTENDED
41812502e0c MDEV-27808 remove SPIDER_LIKE_FUNC_HAS_GET_NEGATED
302548ab918 MDEV-27664 remove SPIDER_SQL_CACHE_IS_IN_LEX
e6cc59f827e MDEV-27663 remove SPIDER_USE_CONST_ITEM_FOR_STRING_INT_REAL_DECIMAL_DATE_ITEM
f4936f9ef37 MDEV-27811: remove SPIDER_MDEV_16246
acf97c666cc MDEV-28226 Remove HANDLER_HAS_NEED_INFO_FOR_AUTO_INC
72e9a3096a3 MDEV-26178 spider: remove PARTITION_HAS_GET_PART_SPEC
d645d2dd51c MDEV-26178 Spider: remove HANDLER_HAS_TOP_TABLE_FIELDS
d945e1f4b9a MDEV-27660 Remove #ifdef SPIDER_HANDLER_START_BULK_INSERT_HAS_FLAGS
ff94f4796ba MDEV-28896 Spider: remove #ifdef SPIDER_UPDATE_ROW_HAS_CONST_NEW_DATA
bc843c552fe MDEV-28895 Spider: remove #ifdef HANDLER_HAS_CAN_USE_FOR_AUTO_INC_INIT
6d480d4466a MDEV-27647 Spider: remove HANDLER_HAS_DIRECT_UPDATE_ROWS
ee5bdcf4078 MDEV-26178 Spider: remove HA_EXTRA_HAS_HA_EXTRA_USE_CMP_REF
60e54cfd363 MDEV-28894 Spider: remove #ifdef HA_EXTRA_HAS_STARTING_ORDERED_INDEX_SCAN
d5a6fef64f5 MDEV-28893 Spider: remove #ifdef SPIDER_NET_HAS_THD
ff8dac182f0 MDEV-28892 remove #ifdef SPIDER_Item_args_arg_count_IS_PROTECTED
bc737d5c5e9 MDEV-27646 remove SPIDER_HAS_HASH_VALUE_TYPE
As expected, application to 10.11 is nontrivial, as 13 of the 22 commits are already in 10.11, and here are the patches on 10.11
e115a1cb9b7 * upstream/bb-10.11-mdev-26178 MDEV-26178 spider: delete spd_environ.h
d24aa9ee971 * MDEV-26178 spider: remove PARTITION_HAS_GET_PART_SPEC
7f33185318a * MDEV-26178 Spider: remove HANDLER_HAS_TOP_TABLE_FIELDS
e62fc09b632 * MDEV-28896 Spider: remove #ifdef SPIDER_UPDATE_ROW_HAS_CONST_NEW_DATA
443f5f25a02 * MDEV-28895 Spider: remove #ifdef HANDLER_HAS_CAN_USE_FOR_AUTO_INC_INIT
771ae466df2 * MDEV-26178 Spider: remove HA_EXTRA_HAS_HA_EXTRA_USE_CMP_REF
284a095e2b2 * MDEV-28894 Spider: remove #ifdef HA_EXTRA_HAS_STARTING_ORDERED_INDEX_SCAN
145a207d9d3 * MDEV-28893 Spider: remove #ifdef SPIDER_NET_HAS_THD
e6a624477c8 * MDEV-28892 remove #ifdef SPIDER_Item_args_arg_count_IS_PROTECTED
I have also applied the commits on 10.6 and 11.1, which are at af5c50df1a4bd2e796ce51745d0ee076ffb07419 and b7af1f4fb67f6e52c217127f859540bdeb5f4639 respectively.
Hi ycp Thank you for your detailed work on this. Once reviewed, let's give this branch a test run before it's pushed to main, just assign to me and let me know what branch to test. If you would have a recent 10.5 trunk with the patch, or patches, applied on top, that would work best (to avoid old regressions etc.), thank you.
Roel Van de Paar
added a comment - - edited Hi ycp Thank you for your detailed work on this. Once reviewed, let's give this branch a test run before it's pushed to main, just assign to me and let me know what branch to test. If you would have a recent 10.5 trunk with the patch, or patches, applied on top, that would work best (to avoid old regressions etc.), thank you.
Roel I've included which commits to test in my latest comment in MDEV-31788[1]. The 10.5 branch based on a two week old 10.5 - is that new enough for the purpose of testing?
Yuchen Pei
added a comment - holyfoot thanks for the review.
Roel I've included which commits to test in my latest comment in MDEV-31788 [1] . The 10.5 branch based on a two week old 10.5 - is that new enough for the purpose of testing?
[1] https://jira.mariadb.org/browse/MDEV-31788?focusedCommentId=287314&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-287314
https://buildbot.mariadb.org/#/builders/234