Bug #106447 error: 'void std::__base_associative
Submitted: 12 Feb 2022 15:33 Modified: 18 Feb 2022 13:41
Reporter: Andy Syam Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.32 OS:Other
Assigned to: CPU Architecture:Any

[12 Feb 2022 15:33] Andy Syam
Description:
error while creating mysql in openwrt. Is there any way to fix it?

How to repeat:
/home/ubuntu/gl/build_dir/target-aarch64_generic_glibc/mysql-5.7.32/storage/innobase/dict/dict0dict.cc:2119:32: error: 'void std::__base_associative<Key, ValueType, Compare, Allocator>::swap(std::__base_associative<Key, ValueType, Compare, Allocator>&) [with Key = dict_foreign_t*; ValueType = dict_foreign_t*; Compare = dict_foreign_compare; Allocator = ut_allocator<dict_foreign_t*>]' is protected within this context
  table->foreign_set.swap(fk_set);
                                ^
[14 Feb 2022 5:43] Annamalai Gurusami
What version of what compiler are you using?  What is the version of C++ you are working with? It is not obvious to me as to what is protected in the given context.  None of the involved classes or structs have protected members - dict_table_t, dict_foreign_t, ut_allocator.  Can you try to use std::swap(set1, set2) call and see if it works?  

Can you also let me know how you are compiling so that I can try it out (if possible)?
[15 Feb 2022 2:04] Andy Syam
https://github.com/openwrt/openwrt/tree/openwrt-19.07/package/libs

https://github.com/openwrt/openwrt/tree/openwrt-19.07/toolchain

Openwrt aarch64

where should i change?

https://github.com/mysql/mysql-server/blob/2032b65c44e242a7e452a38bf7626dfacc315b9c/storag...
[15 Feb 2022 2:09] Andy Syam
#
# Copyright (C) 2006-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/uclibc++.mk

PKG_NAME:=mysql
PKG_VERSION:=5.7.32
PKG_RELEASE:=2

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=\
	http://www.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.7/ \
	https://downloads.mysql.com/archives/get/p/23/file/

PKG_MD5SUM:=c85e4dc80176925891f45180ef1c95e0

PKG_BUILD_DEPENDS:=libncurses libreadline
PKG_BUILD_PARALLEL:=1
PKG_USE_MIPS16:=0

PKG_FIXUP:=libtool

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/libmysqlclient/Default
  SECTION:=libs
  CATEGORY:=Libraries
  DEPENDS:=$(CXX_DEPENDS) +zlib
  TITLE:=MySQL client library
  URL:=http://dev.mysql.com/
endef

define Package/mysql-server
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libmysqlclient +libpthread +libncursesw +libreadline
  TITLE:=MySQL Server
  URL:=http://dev.mysql.com/
  SUBMENU:=database
endef

define Package/libmysqlclient
  $(call Package/libmysqlclient/Default)
endef

ifneq ($(CONFIG_USE_UCLIBCXX),)
  TARGET_CXX=g++-uc
endif

CMAKE_OPTIONS += -DSTACK_DIRECTION=-1
CMAKE_OPTIONS += -DCMAKE_CXX_FLAGS="-std=gnu++98"

define Build/Compile
	+$(MAKE) $(PKG_JOBS) -C "$(PKG_BUILD_DIR)" \
		SUBDIRS="include" \
		DESTDIR="$(PKG_INSTALL_DIR)"
	$(MAKE) -C "$(PKG_BUILD_DIR)" \
		SUBDIRS="include" \
		DESTDIR="$(PKG_INSTALL_DIR)" \
		install
endef

define Build/InstallDev
	$(INSTALL_DIR) $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql_config $(1)/usr/bin/
	ln -sf $(STAGING_DIR)/usr/bin/mysql_config $(2)/bin/
	$(CP) $(PKG_INSTALL_DIR)/usr/include/mysql $(1)/usr/include/
	# NOTE: needed for MySQL-Python
	$(CP) $(PKG_BUILD_DIR)/include/mysqld_error.h $(1)/usr/include/mysql/
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/mysql $(1)/usr/lib/
	rm -f $(1)/usr/lib/mysql/libmysqlclient.la
endef

define Package/libmysqlclient/install
	$(INSTALL_DIR) $(1)/usr/lib
	$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmysqlclient.so.* $(1)/usr/lib/
endef

define Package/mysql-server/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysql $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqld $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/myisamchk $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqladmin $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mysqldump $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/scripts/mysql_install_db $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/my_print_defaults $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN) files/mysqld.init $(1)/etc/init.d/mysqld
	$(INSTALL_CONF) conf/my.cnf $(1)/etc/
	$(INSTALL_DIR) $(1)/usr/share/mysql
	$(INSTALL_DIR) $(1)/usr/share/mysql/english
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/english/errmsg.sys $(1)/usr/share/mysql/english
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/fill_help_tables.sql $(1)/usr/share/mysql/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql_system_tables.sql $(1)/usr/share/mysql/
	$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/share/mysql_system_tables_data.sql $(1)/usr/share/mysql/
endef

define Package/mysql-server/conffiles
/etc/my.cnf
endef

$(eval $(call BuildPackage,mysql-server))
$(eval $(call BuildPackage,libmysqlclient))
[15 Feb 2022 2:17] Andy Syam
i got this error also in mysql-5.6.20. i have tried musl and glibc in openwrt
[15 Feb 2022 6:37] Andy Syam
I currently use and successfully create mysql-5.6.19 and mysql-5.7.4-m14 in openwrt. but for mysql-5.7.32 i get the error i report here
[15 Feb 2022 6:37] Andy Syam
BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.4, r11208-ce6496d796
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# ls
libatomic1_7.5.0-2_aarch64_generic.ipk
libncurses6_6.1-5_aarch64_generic.ipk
mysql
mysqld
terminfo_6.1-5_aarch64_generic.ipk
uclibcxx_0.2.5-3_aarch64_generic.ipk
root@OpenWrt:~# chmod +x mysql mysqld
root@OpenWrt:~# ./mysql -V                                                
./mysql  Ver 14.14 Distrib 5.7.4-m14, for Linux (aarch64) using  EditLine wrapper
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# ./mysqld
2022-02-15T06:32:17.845657Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2022-02-15T06:32:17.846128Z 0 [Note] ./mysqld (mysqld 5.7.4-m14) starting as process 19001 ...
2022-02-15T06:32:17.846301Z 0 [ERROR] Can't find error-message file '/usr/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2022-02-15T06:32:17.848537Z 0 [Warning] Can't create test file /usr/data/OpenWrt.lower-test
2022-02-15T06:32:17.848627Z 0 [Warning] Can't create test file /usr/data/OpenWrt.lower-test
mysqld: Can't change dir to '/usr/data/' (Errcode: 2 - No such file or directory)
2022-02-15T06:32:17.848731Z 0 [ERROR] Aborting

2022-02-15T06:32:17.848772Z 0 [Note] Binlog end
2022-02-15T06:32:17.849001Z 0 [Note] 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~# 
root@OpenWrt:~#
[15 Feb 2022 9:41] Andy Syam
gcc v-7.5.0 and gcc v-8.4.0

aarch64 cross compilation
[15 Feb 2022 10:59] Andy Syam
I have found the problem. there is an error in my makefile. thanks
[15 Feb 2022 13:51] MySQL Verification Team
Hi Mr. Syam,

Thank you for your note.

You are truly welcome ....

However, please in the future, use our own build methodology, since we are not use MAKE for quite a long time. Instead, we are using CMake building system.
[15 Feb 2022 22:25] Andy Syam
i use CMAKE in makefile to create mysql
[18 Feb 2022 13:41] Andy Syam
Test mysql 8

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.4, r11208-ce6496d796
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt: ./mysql -V                                                
./mysql  Ver 8.0.15 for Linux on aarch64 (Source distribution)                                                        
root@OpenWrt: ./mysqld                                                  
2022-02-14T01:22:26.661572Z 0 [System] [MY-010116] [Server] /root/mysqld (mysqld 8.0.15) starting as process 3997
2022-02-14T01:22:26.661773Z 0 [ERROR] [MY-010338] [Server] Can't find error-message file '/share/errmsg.sys'. Check error-message file location and 'lc-messages-dir' configuration directive.
2022-02-14T01:22:26.670225Z 0 [Warning] [MY-010091] [Server] Can't create test file /data/OpenWrt.lower-test
2022-02-14T01:22:26.670296Z 0 [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /data/ is case insensitive
2022-02-14T01:22:26.670388Z 0 [ERROR] [MY-010123] [Server] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2022-02-14T01:22:26.670690Z 0 [ERROR] [MY-010119] [Server] Aborting
2022-02-14T01:22:26.671569Z 0 [System] [MY-010910] [Server] /root/mysqld: Shutdown complete (mysqld 8.0.15)  Source distribution.
root@OpenWrt: