Bug #7371 Problems with using libedit instead of readline.
Submitted: 16 Dec 2004 23:30 Modified: 27 May 2005 20:11
Reporter: Boyd GERBER Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:4.1.8,4.1.9,4.1.10,4.1.11 OS:UnixWare 7.1.4
Assigned to: Assigned Account CPU Architecture:Any

[16 Dec 2004 23:30] Boyd GERBER
Description:
make fails.

Making all in libedit
make[3]: Entering directory `/home/mount/uw714/zenez1/build/uw714/mysql-4.1.8/cmd-line-utils/libedit'
/usr/bin/rm -f makelist makelist-t
/usr/local/bin/sed \
  -e 's!@''AWK''@!gawk!' \
makelist.sh > makelist-t
/usr/bin/mv makelist-t makelist
sh ./makelist -h ./vi.c > vi.h.tmp && \
mv vi.h.tmp vi.h
sh ./makelist -h ./emacs.c > emacs.h.tmp && \
mv emacs.h.tmp emacs.h
sh ./makelist -h ./common.c > common.h.tmp && \
mv common.h.tmp common.h
sh ./makelist -bh vi.c emacs.c common.c > help.h.tmp && \
mv help.h.tmp help.h
sh ./makelist -fh vi.h emacs.h common.h > fcns.h.tmp && \
mv fcns.h.tmp fcns.h
source='chared.c' object='chared.o' libtool=no \
depfile='.deps/chared.Po' tmpdepfile='.deps/chared.TPo' \
depmode=none /bin/ksh ../../depcomp \
cc -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR  -I. -I. -I../.. -I../../include -I./../.. -I..    -O -DDBUG_OFF -I/usr/local/include   -Kalloca -c chared.c
UX:acomp: WARNING: "chared.c", line 44: syntax error:  empty declaration
source='el.c' object='el.o' libtool=no \
depfile='.deps/el.Po' tmpdepfile='.deps/el.TPo' \
depmode=none /bin/ksh ../../depcomp \
cc -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR  -I. -I. -I../.. -I../../include -I./../.. -I..    -O -DDBUG_OFF -I/usr/local/include   -Kalloca -c el.c
UX:acomp: WARNING: "el.c", line 44: syntax error:  empty declaration
source='history.c' object='history.o' libtool=no \
depfile='.deps/history.Po' tmpdepfile='.deps/history.TPo' \
depmode=none /bin/ksh ../../depcomp \
cc -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK -DUNDEF_THREADS_HACK -DHAVE_CONFIG_H -DNO_KILL_INTR  -I. -I. -I../.. -I../../include -I./../.. -I..    -O -DDBUG_OFF -I/usr/local/include   -Kalloca -c history.c
UX:acomp: WARNING: "history.c", line 44: syntax error:  empty declaration
UX:acomp: ERROR: "history.c", line 734: undefined symbol: VIS_WHITE
make[3]: *** [history.o] Error 1
make[3]: Leaving directory `/home/mount/uw714/zenez1/build/uw714/mysql-4.1.8/cmd-line-utils/libedit'
make[2]: *** [all-recursive] Error 1

The previous was to default to readline.  This is what should be used or fix the libedit.  I have asked for the location of the orignail source so if I make changes to get it to work they can be feed back into the orignal project.  The source download I found on google is unavailable.

How to repeat:
download 4.1.8.tar.gz
gunzip
tar xf
CC="cc" CFLAGS="-I/usr/local/include" CXX="CC" CFLAGS="-I/usr/local/include" ./configure --prefix=/usr/local/mysql --enable-thread-safe-client --with-berkeley-db=./bdb --with-innodb --with-openssl --with-extra-charsets=complex --with-vio

edit bdb/dist/configure line 21797 change cat to /usr/local/bin/cat once you have build the gnutools.

then run gnu make

Suggested fix:
Change back to readline.
[17 Dec 2004 0:38] Boyd GERBER
Manually editing all Makefile that need libedit and change them to use readline.  This ia a real pain when this worked in all previous version of MySQL.  Such changes should be in the release notes.
[15 Jan 2005 17:11] Boyd GERBER
This is also still happening with the latest 4.1.9 release.
[15 Jan 2005 17:12] Boyd GERBER
Still happening now with all version of MySQL.
[15 Jan 2005 21:35] Stéphane Messerli
Same problem here with 4.1.8a and 4.1.9 sources (tar.gz packages). History search (ctrl+r) doesn't work.
[7 Apr 2005 3:38] Boyd GERBER
libedit has been fixed in mysql-4.1.11 so I am able to use it.  It would be better if readline was used but this is acceptable.
[7 Apr 2005 15:42] Boyd GERBER
Libedit problem is fixed and usuable, but I would prefer that readline was used.
[26 Apr 2005 10:20] Magnus Blåudd
You can select readline when configuring your package
./configure --with-readline
or select libedit with
./configure --with-libedit
or to try and link with the libreadline library installed on your system
./configure --without-readline --without-libedit

Please try the above.
[26 May 2005 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[27 May 2005 1:55] Boyd GERBER
I have been trying these with mysql-4.1.12 and I am getting a SEGFAULT.
Using the options does force the intended behaviour.  I just would like to know why the default was changed from using the systems readline to defaulting to libedit.
[27 May 2005 2:02] Boyd GERBER
Not all patches for readline have been applied for the version bundled with mysql so the system library is more up today and patched.
[27 May 2005 20:11] Boyd GERBER
--without-readline --without-libedit generates this message

Making all in client
make[2]: Entering directory `/home/mount/zensco/local/zenez/build/mysql-4.1.11.new/client'
source='mysql.cc' object='mysql.o' libtool=no \
depfile='.deps/mysql.Po' tmpdepfile='.deps/mysql.TPo' \
depmode=none /bin/ksh ../depcomp \
CC -Kthread -DUNIXWARE_7 -DHAVE_BROKEN_RWLOCK -DUNDEF_THREADS_HACK -I. -I. -I.. -I../include -I../regex     -O3 -DDBUG_OFF    -DNO_CPLUSPLUS_ALLOCA -c -o mysql.o mysql.cc
"mysql.cc", line 780: warning: statement is unreachable
    break;
    ^

"mysql.cc", line 1311: error: a value of type "CPPFunction *" cannot be assigned to an entity of type "rl_completion_func_t *"
    rl_attempted_completion_function= (CPPFunction*)&new_mysql_completion;
                                    ^

"mysql.cc", line 1312: error: a value of type "Function *" cannot be assigned to an entity of type "rl_compentry_func_t *"
    rl_completion_entry_function= (Function*)&no_completion;
                                ^

"mysql.cc", line 1331: error: identifier "completion_matches" is undefined
      return completion_matches((char *)text, (CPFunction *)new_command_generator);
             ^

make[2]: *** [mysql.o] Error 1
make[2]: Leaving directory `/home/mount/zensco/local/zenez/build/mysql-4.1.11.new/client'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/mount/zensco/local/zenez/build/mysql-4.1.11.new'
make: *** [all] Error 2