Description:
I get the following compile error when using --with-embedded-server:
if g++ -DEMBEDDED_LIBRARY -DMYSQL_SERVER -DDEFAULT_MYSQL_HOME="\"/usr\"" -DDATADIR="\"/var/lib/mysql\"" -DSHAREDIR="\"/usr/share/mysql\"" -DLIBDIR="\"/usr/li
b\"" -I. -I. -I.. -I../include -I../include -I../sql -I../sql -I../sql/examples -I../regex -I../storage/federated/ -I../storage/heap/ -I../storage/innobase/
handler/ -I../storage/myisam/ -I../storage/myisammrg/ -DBIG_JOINS=1 -felide-constructors -fno-rtti -O2 -fno-implicit-templates -fno-exceptions -fno-rtti
-MT sql_parse.o -MD -MP -MF ".deps/sql_parse.Tpo" -c -o sql_parse.o sql_parse.cc; \
then mv -f ".deps/sql_parse.Tpo" ".deps/sql_parse.Po"; else rm -f ".deps/sql_parse.Tpo"; exit 1; fi
sql_parse.cc: In function 'bool check_table_access(THD*, ulong, TABLE_LIST*, bool)':
sql_parse.cc:5707: error: 'org_tables' was not declared in this scope
make[4]: *** [sql_parse.o] Fehler 1
make[4]: Leaving directory `/home/ch/debian/mysql/exp-5.1/mysql-dfsg-5.1-5.1.16beta/libmysqld'
The reason is that in sql_parse.cc the variable org_tables is only defined when
embedded-server is not used:
bool
check_table_access(THD *thd, ulong want_access,TABLE_LIST *tables,
bool no_errors)
{
uint found=0;
ulong found_access=0;
#ifndef EMBEDDED_LIBRARY
TABLE_LIST *org_tables= tables;
#endif
and later the unconditional use of this symbol:
if (grant_option)
return check_grant(thd,want_access & ~EXTRA_ACL,org_tables,
test(want_access & EXTRA_ACL), UINT_MAX, no_errors);
How to repeat:
compile (on amd64 but most probably architecture independend) with:
$ ./configure --build=x86_64-linux-gnu --host=x86_64-linux-gnu --prefix=/usr --exec-prefix=/usr --libexecdir=/usr/sbin --datadir=/usr/share --localstatedir
=/var/lib/mysql --includedir=/usr/include --infodir=/usr/share/info --mandir=/usr/share/man --with-server-suffix=-Debian_1 --with-comment=Debian etch distrib
ution --enable-shared --enable-static --enable-thread-safe-client --enable-local-infile --with-big-tables --with-raid --with-unix-socket-path=/var/run/mysqld
/mysqld.sock --with-mysqld-user=mysql --with-libwrap --with-vio --with-ssl --without-docs --with-bench --with-libedit --with-extra-charsets=all --with-innodb
--with-isam --with-archive-storage-engine --with-csv-storage-engine --with-federated-storage-engine --without-embedded-server --with-ndbcluster --with-ndb-s
hm --without-ndb-sci --without-ndb-test --with-embedded-server --with-embedded-privilege-control --with-ndb-docs
Suggested fix:
Probably make the symbol unconditionally available?