Bug #63130 CMake-based check for the presence of a system readline library is not reliable.
Submitted: 7 Nov 2011 17:00 Modified: 16 Jan 2014 11:44
Reporter: Davi Arnaut (OCA) Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5 OS:Linux (CentOS 5.5)
Assigned to: CPU Architecture:Any
Tags: centos 5.5, Contribution, curses, readline, tercamp
Triage: Needs Triage: D3 (Medium)

[7 Nov 2011 17:00] Davi Arnaut
Description:
The MYSQL_FIND_SYSTEM_READLINE macro, which tests whether the Readline library is availability by trying to compile and link a test program, does not handle the case where the Readline library uses termcap functions, but does not link with the termcap or curses library itself.

Also, the History library is not properly detected/used. The <readline/history.h> file should be include in any file that uses the History library's features. It supplies extern declarations for all of the library's public functions and variables, and declares all of the public data structures.

How to repeat:
cmake . -DWITH_READLINE=OFF -DWITH_LIBEDIT=OFF
[7 Nov 2011 18:01] Davi Arnaut
Use the curses library and history header.

Attachment: Bug-63130-CMake-based-check-for-the-presence-of-a-system-readline.patch (application/octet-stream, text), 3.98 KiB.

[30 Sep 2012 1:05] Brad Smith
I'm the OpenBSD port/package maintainer and was just about to file a bug report when I noticed this one. I have a similar patch for fixing the issue with the libreadline test not using FIND_CURSES() first and then using ${CURSES_LIBRARY} when testing for the libreadline library.
[30 Sep 2012 1:06] Brad Smith
and FYI this affects both 5.5, 5.6 and anything newer.
[30 Sep 2012 1:11] Brad Smith
Fix mysql_embedded linking with libreadline

Attachment: patch-libmysqld_examples_CMakeLists_txt (application/octet-stream, text), 532 bytes.

[30 Sep 2012 1:12] Brad Smith
The patch I added is also necessary to fix linking mysql_embedded in addition to the patch provided by Davi.
[30 Sep 2012 1:18] Brad Smith
Oh sorry I see the diff I posted isn't necessary since the approach Davi took was a little different and overrided READLINE_LIBRARY.
[15 Jan 2013 15:23] Sveta Smirnova
Bug #68087 was marked as duplicate of this one.
[12 Feb 2013 22:54] Davi Arnaut
Fix

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: Bug#63130-CMake-based-check-for-the-presence-of-a-sy.patch (application/octet-stream, text), 3.97 KiB.

[16 Jan 2014 11:43] Ståle Deraas
Posted by developer:
 
readline is no longer used in MySQL.
[15 Sep 2015 9:35] Are you mortal Then prepare to die.
"readline is no longer used in MySQL"... Does the patch work then?

EditLine makes me feel sick ...