Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 517248 - dev-db/mysql-5.0.96 - In file included from sql_lex.cc:79: lex.h:112:26: error: ‘CLIENT_STATS_SYM’ was not declared in this scope
Summary: dev-db/mysql-5.0.96 - In file included from sql_lex.cc:79: lex.h:112:26: erro...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Linux MySQL bugs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-16 14:39 UTC by pajislaff
Modified: 2021-10-11 20:42 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
complete build log (build.log,650.58 KB, text/plain)
2014-07-16 14:39 UTC, pajislaff
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pajislaff 2014-07-16 14:39:11 UTC
Created attachment 380818 [details]
complete build log

mysql-5.0.96 fails to compile with this error (full build log attached):

make[4]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.96/work/mysql/sql/share'
make[4]: Entering directory `/var/tmp/portage/dev-db/mysql-5.0.96/work/mysql/sql'
x86_64-pc-linux-gnu-g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\"" -DMYSQL_DATADIR="\"/var/lib/mysql\"" -DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I../include -I/usr/include -I../innobase/include -I../innobase/include -I../include -I../include -I../regex -I.   -DHAVE_ERRNO_AS_DEFINE=1  -DDBUG_OFF -mtune=nocona -O2 -pipe -fomit-frame-pointer -fno-exceptions -fno-strict-aliasing -felide-constructors -fno-rtti -fno-implicit-templates -fno-strict-aliasing   -fno-implicit-templates -fno-exceptions -fno-rtti -c -o sql_lex.o sql_lex.cc
x86_64-pc-linux-gnu-g++ -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\"" -DMYSQL_DATADIR="\"/var/lib/mysql\"" -DSHAREDIR="\"/usr/share/mysql\"" -DHAVE_CONFIG_H -I. -I../include -I/usr/include -I../innobase/include -I../innobase/include -I../include -I../include -I../regex -I.   -DHAVE_ERRNO_AS_DEFINE=1  -DDBUG_OFF -mtune=nocona -O2 -pipe -fomit-frame-pointer -fno-exceptions -fno-strict-aliasing -felide-constructors -fno-rtti -fno-implicit-templates -fno-strict-aliasing   -fno-implicit-templates -fno-exceptions -fno-rtti -c -o item.o item.cc
In file included from lex_hash.h:17:0,
                 from sql_lex.cc:79:
lex.h:112:26: error: ‘CLIENT_STATS_SYM’ was not declared in this scope
lex.h:242:25: error: ‘INDEX_STATS_SYM’ was not declared in this scope
lex.h:247:26: error: ‘INNODB_IO_PATTERN’ was not declared in this scope
lex.h:373:17: error: ‘PATCHES’ was not declared in this scope
lex.h:449:25: error: ‘SLOW_SYM’ was not declared in this scope
lex.h:495:25: error: ‘TABLE_STATS_SYM’ was not declared in this scope
lex.h:533:24: error: ‘USER_STATS_SYM’ was not declared in this scope
make[4]: *** [sql_lex.o] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.96/work/mysql/sql'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.96/work/mysql/sql'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.96/work/mysql/sql'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/dev-db/mysql-5.0.96/work/mysql'
make: *** [all] Error 2

Here is the output of emerge --info:

Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.7.3, glibc-2.17, 2.6.32.42 x86_64)
=================================================================
System uname: Linux-2.6.32.42-x86_64-Intel-R-_Xeon-R-_CPU_E5320_@_1.86GHz-with-gentoo-2.2
KiB Mem:     4054720 total,    151064 free
KiB Swap:    8000352 total,   7936116 free
Timestamp of tree: Tue, 15 Jul 2014 14:30:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.6.8-r3, 2.7.6, 3.2.5-r3, 3.3.3
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28-r1
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.1.2, 4.3.6-r1, 4.7.3-r1
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-mtune=nocona -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/apache2-php5.4/ext-active/ /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-mtune=nocona -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
USE="amd64 bash-completion berkdb bzip2 cli cracklib crypt cxx dri examples fortran gdbm iconv ipv6 maildir mmx modules multilib ncurses nls nptl openmp pcre readline ruby session socks5 sse sse2 ssl symlink tcpd threads unicode zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_svn authz_user autoindex cache dav dav_fs dav_lock dav_svn deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias proxy proxy_balancer proxy_http proxy_connect" APACHE2_MPMS="worker" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="cs en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5 php5-3 php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="vesa vga" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON
Comment 1 Brian Evans (RETIRED) gentoo-dev 2014-07-16 15:30:49 UTC
Is there any reason you are trying to build this ancient version that has known security holes?

It has only been left for transitions between versions, but the cruft is starting to build it seems.

The build log looks a little strange too.  It is in an overlay for one. Also, there are 3 different build attempts which just doesn't look right.
Comment 2 pajislaff 2014-07-17 12:58:03 UTC
(In reply to Brian Evans from comment #1)
> Is there any reason you are trying to build this ancient version that has
> known security holes?
> 
> It has only been left for transitions between versions, but the cruft is
> starting to build it seems.
> 
> The build log looks a little strange too.  It is in an overlay for one.
> Also, there are 3 different build attempts which just doesn't look right.

Thanks Brian. Unfortunatelly, one of my customers wants to keep this old major version as the change could break his old PHP app (or he thinks so). I was only wondering why the old version is still in portage, if it can't be compiled.

But if it's caused by my unique server configuration, I would be glad, if you can me point to the strange things in build.log that you mentioned.
Comment 3 Brian Evans (RETIRED) gentoo-dev 2014-07-17 17:27:41 UTC
(In reply to pajislaff from comment #2)

> Thanks Brian. Unfortunatelly, one of my customers wants to keep this old
> major version as the change could break his old PHP app (or he thinks so). I
> was only wondering why the old version is still in portage, if it can't be
> compiled.
> 
> But if it's caused by my unique server configuration, I would be glad, if
> you can me point to the strange things in build.log that you mentioned.

I can replicate the issue but not sure how to fix this issue or where it stems from.  I attempted to downgrade bison to see if it was a generation issue and still the same result.

As for the app, 5.1 has very little SQL changes that a client should worry about.
https://dev.mysql.com/doc/refman/5.1/en/upgrading-from-previous-series.html describes all of the changes to be mindful of.  Most of these are administrative that the app should no interest in.

@mysql team: Any thoughts how/if we should fix this?
Comment 4 Brian Evans (RETIRED) gentoo-dev 2014-08-28 13:05:20 UTC
MySQL 5.0.x was removed from the tree and we won't be fixing it to work in modern times.
Comment 5 Igor Franchuk 2021-10-11 20:42:36 UTC
I all so bumped into this problem. It happens because automake that we have is newer than mysql, the newer version produces sql_yacc.hh instead of sql_yacc.h which mysql/sql/Makefile.am expects 

I wrote a patch - it will fix the problem. 

--- mysql-5.0.84-r1/work/mysql/sql/Makefile..am	1970-01-01 03:00:00.000000000 +0300
+++ mysql-5.0.84-r1/work/mysql/sql/Makefile.am	2021-10-11 23:18:28.000000000 +0300
@@ -0,0 +1,180 @@
+# Copyright (C) 2000-2006 MySQL AB
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+# 
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+#called from the top level Makefile
+
+MYSQLDATAdir =		$(localstatedir)
+MYSQLSHAREdir =		$(pkgdatadir)
+MYSQLBASEdir=		$(prefix)
+INCLUDES =		@ZLIB_INCLUDES@ \
+			@bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \
+			-I$(top_builddir)/include -I$(top_srcdir)/include \
+			-I$(top_srcdir)/regex -I$(srcdir) \
+                        $(openssl_includes)
+WRAPLIBS=		@WRAPLIBS@
+SUBDIRS =		share
+libexec_PROGRAMS =	mysqld
+EXTRA_PROGRAMS =	gen_lex_hash
+bin_PROGRAMS =		mysql_tzinfo_to_sql
+gen_lex_hash_LDFLAGS =  @NOINST_LDFLAGS@
+LDADD =			$(top_builddir)/myisam/libmyisam.a \
+			$(top_builddir)/myisammrg/libmyisammrg.a \
+			$(top_builddir)/heap/libheap.a \
+			$(top_builddir)/vio/libvio.a \
+			$(top_builddir)/mysys/libmysys.a \
+			$(top_builddir)/dbug/libdbug.a \
+			$(top_builddir)/regex/libregex.a \
+			$(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@ @NDB_SCI_LIBS@
+
+mysqld_LDADD =		@MYSQLD_EXTRA_LDFLAGS@ \
+			@bdb_libs@ @innodb_libs@ @pstack_libs@ \
+                        @innodb_system_libs@ \
+			@ndbcluster_libs@ @ndbcluster_system_libs@ \
+			$(LDADD)  $(CXXLDFLAGS) $(WRAPLIBS) @LIBDL@ \
+			$(yassl_libs) $(openssl_libs) @MYSQLD_EXTRA_LIBS@
+
+noinst_HEADERS =	item.h item_func.h item_sum.h item_cmpfunc.h \
+			item_strfunc.h item_timefunc.h item_uniq.h \
+			item_create.h item_subselect.h item_row.h \
+			mysql_priv.h item_geofunc.h sql_bitmap.h \
+			procedure.h sql_class.h sql_lex.h sql_list.h \
+			sql_manager.h sql_map.h sql_string.h unireg.h \
+			sql_error.h field.h handler.h mysqld_suffix.h \
+ 			sql_profile.h \
+			ha_myisammrg.h\
+			ha_heap.h ha_myisam.h ha_berkeley.h ha_innodb.h \
+			ha_ndbcluster.h ha_ndbcluster_cond.h \
+			opt_range.h protocol.h \
+			sql_select.h structs.h table.h sql_udf.h hash_filo.h\
+			lex.h lex_symbol.h sql_acl.h sql_crypt.h  \
+			log_event.h sql_repl.h slave.h \
+			stacktrace.h sql_sort.h sql_cache.h set_var.h \
+			spatial.h gstream.h client_settings.h tzfile.h \
+                        tztime.h my_decimal.h\
+			sp_head.h sp_pcontext.h sp_rcontext.h sp.h sp_cache.h \
+			parse_file.h sql_view.h	sql_trigger.h \
+			sql_array.h sql_cursor.h \
+			examples/ha_example.h ha_archive.h \
+			examples/ha_tina.h ha_blackhole.h  \
+			ha_federated.h
+mysqld_SOURCES =	sql_lex.cc sql_handler.cc \
+			item.cc item_sum.cc item_buff.cc item_func.cc \
+			item_cmpfunc.cc item_strfunc.cc item_timefunc.cc \
+			thr_malloc.cc item_create.cc item_subselect.cc \
+			item_row.cc item_geofunc.cc \
+			field.cc strfunc.cc key.cc sql_class.cc sql_list.cc \
+			net_serv.cc protocol.cc sql_state.c \
+			lock.cc my_lock.c \
+			sql_string.cc sql_manager.cc sql_map.cc \
+			mysqld.cc password.c hash_filo.cc hostname.cc \
+			set_var.cc sql_parse.cc sql_yacc.yy \
+			sql_base.cc table.cc sql_select.cc sql_insert.cc \
+                        sql_prepare.cc sql_error.cc sql_locale.cc \
+			sql_profile.cc \
+			sql_update.cc sql_delete.cc uniques.cc sql_do.cc \
+			procedure.cc item_uniq.cc sql_test.cc \
+			log.cc log_event.cc init.cc derror.cc sql_acl.cc \
+			unireg.cc des_key_file.cc \
+			discover.cc time.cc opt_range.cc opt_sum.cc \
+		   	records.cc filesort.cc handler.cc \
+		        ha_heap.cc ha_myisam.cc ha_myisammrg.cc \
+	                ha_berkeley.cc ha_innodb.cc \
+			ha_ndbcluster.cc ha_ndbcluster_cond.cc \
+			sql_db.cc sql_table.cc sql_rename.cc sql_crypt.cc \
+			sql_load.cc mf_iocache.cc field_conv.cc sql_show.cc \
+			sql_udf.cc sql_analyse.cc sql_analyse.h sql_cache.cc \
+			slave.cc sql_repl.cc sql_union.cc sql_derived.cc \
+			client.c sql_client.cc mini_client_errors.c pack.c\
+			stacktrace.c repl_failsafe.h repl_failsafe.cc \
+			sql_olap.cc sql_view.cc \
+			gstream.cc spatial.cc sql_help.cc sql_cursor.cc \
+			tztime.cc my_time.c my_user.c my_decimal.cc\
+			sp_head.cc sp_pcontext.cc  sp_rcontext.cc sp.cc \
+			sp_cache.cc parse_file.cc sql_trigger.cc \
+			examples/ha_example.cc ha_archive.cc \
+			examples/ha_tina.cc ha_blackhole.cc \
+			ha_federated.cc
+
+gen_lex_hash_SOURCES =	gen_lex_hash.cc
+gen_lex_hash_LDADD =	$(LDADD) $(CXXLDFLAGS)
+mysql_tzinfo_to_sql_SOURCES =   mysql_tzinfo_to_sql.cc
+mysql_tzinfo_to_sql_LDADD =  @MYSQLD_EXTRA_LDFLAGS@ $(LDADD) $(CXXLDFLAGS)
+
+DEFS =			-DMYSQL_SERVER \
+			-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
+			-DDATADIR="\"$(MYSQLDATAdir)\"" \
+			-DSHAREDIR="\"$(MYSQLSHAREdir)\"" \
+			@DEFS@
+
+BUILT_SOURCES =		sql_yacc.cc sql_yacc.hh lex_hash.h
+EXTRA_DIST =		$(BUILT_SOURCES) nt_servc.cc nt_servc.h \
+			message.mc message.h message.rc MSG00001.bin \
+			examples/CMakeLists.txt CMakeLists.txt \
+			udf_example.c udf_example.def
+DISTCLEANFILES =        lex_hash.h sql_yacc.output
+
+AM_YFLAGS =		-d --debug --verbose
+
+mysql_tzinfo_to_sql.cc:
+	rm -f mysql_tzinfo_to_sql.cc
+	@LN_CP_F@ $(srcdir)/tztime.cc mysql_tzinfo_to_sql.cc
+
+link_sources: mysql_tzinfo_to_sql.cc
+	rm -f mini_client_errors.c
+	@LN_CP_F@ $(top_srcdir)/libmysql/errmsg.c mini_client_errors.c
+	rm -f pack.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/pack.c pack.c
+	rm -f client.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/client.c client.c
+	rm -f my_time.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/my_time.c my_time.c
+	rm -f my_user.c
+	@LN_CP_F@ $(top_srcdir)/sql-common/my_user.c my_user.c
+
+mysql_tzinfo_to_sql.o:	$(mysql_tzinfo_to_sql_SOURCES)
+			$(CXXCOMPILE) -c $(INCLUDES) -DTZINFO2SQL $<
+
+# Try to get better dependencies for the grammar. Othervise really bad
+# things like different grammars for different pars of MySQL can
+# happen if you are unlucky.
+sql_yacc.cc:	sql_yacc.yy
+sql_yacc.hh:	sql_yacc.yy
+
+# Be careful here, note that we use VPATH and might or might not have
+# a pregenerated "sql_yacc.cc" in $(srcdir) or one we just built in
+# $(builddir). And it has to work if $(srcdir) == $(builddir).
+sql_yacc.o:	sql_yacc.cc sql_yacc.hh $(HEADERS)
+		@SED@ -e 's/__attribute__ ((__unused__))//' $< > sql_yacc.cc-new
+		@MV@ sql_yacc.cc-new sql_yacc.cc
+		@echo "Note: The following compile may take a long time."
+		@echo "If it fails, re-run configure with --with-low-memory"
+		$(CXXCOMPILE) $(LM_CFLAGS) -c sql_yacc.cc
+
+# This generates lex_hash.h
+# NOTE Built sources should depend on their sources not the tool
+# this avoid the rebuild of the built files in a source dist
+lex_hash.h:	gen_lex_hash.cc lex.h
+		$(MAKE) $(AM_MAKEFLAGS) gen_lex_hash$(EXEEXT)
+		./gen_lex_hash$(EXEEXT) > $@-t
+		$(MV) $@-t $@
+
+# For testing of udf_example.so
+noinst_LTLIBRARIES= udf_example.la
+udf_example_la_SOURCES= udf_example.c
+udf_example_la_LDFLAGS= -module -rpath $(pkglibdir)
+
+
+# Don't update the files from bitkeeper
+%::SCCS/s.%