Skip to content

Commit

Permalink
PS-6789 (Merge MySQL 8.0.20): Fixed PS-7041 (Correct Compilation erro…
Browse files Browse the repository at this point in the history
…r when -DWITH_EDITLINE=bundled is used)

https://jira.percona.com/browse/PS-6789

In MySQL Server 5.7.30 and 8.0.20 Oracle updated bundled 'libedit' library to
version 3.1 in the implementation of WL #13534
"Update bundled libedit to 20190324-3.1"
(https://dev.mysql.com/worklog/task/?id=13534)
(commit mysql/mysql-server@56d1692051d)
(commit mysql/mysql-server@2ad48d73939)
(commit mysql/mysql-server@122fbbfd13f)
(commit mysql/mysql-server@62f319d3a62)
(commit mysql/mysql-server@8b6d1be8448)
(commit mysql/mysql-server@09973667da5)
(commit mysql/mysql-server@b24d24162b7)
(commit mysql/mysql-server@576955f4e36)
(commit mysql/mysql-server@8c39496d8c6)
This caused incompatibility between expected 'fake_magic_space()' and
'no_completion()' callback function types.

Fixed PS-7041 "Correct Compilation error when -DWITH_EDITLINE=bundled is used"
(https://jira.percona.com/browse/PS-7041)

In addition for 'Mac OS' the default 'readline'/'editline' option has been
changed to '-DWITH_EDITLINE=bundled'.
  • Loading branch information
percona-ysorokin committed Jun 25, 2020
1 parent a577d71 commit 6c5dc40
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
10 changes: 1 addition & 9 deletions client/mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2653,11 +2653,7 @@ static char **new_mysql_completion(const char *text, int start, int end);
if not.
*/

#if defined(USE_NEW_XLINE_INTERFACE)
static int fake_magic_space(int, int);
char *no_completion(const char *, int)
#elif defined(USE_LIBEDIT_INTERFACE)
static int fake_magic_space(int, int);
#if defined(USE_NEW_XLINE_INTERFACE) || defined(USE_LIBEDIT_INTERFACE)
char *no_completion(const char *, int)
#else
char *no_completion()
Expand All @@ -2678,11 +2674,7 @@ static int not_in_history(const char *line) {
return 1;
}

#if defined(USE_NEW_XLINE_INTERFACE)
static int fake_magic_space(int, int)
#else
static int fake_magic_space(int, int)
#endif
{
rl_insert(1, ' ');
return 0;
Expand Down
6 changes: 5 additions & 1 deletion cmake/readline.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,11 @@ MACRO (FIND_SYSTEM_READLINE)
ENDMACRO()

IF (NOT WITH_EDITLINE AND NOT WITH_READLINE AND NOT WIN32)
SET(WITH_READLINE "system" CACHE STRING "By default use system readline")
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
SET(WITH_EDITLINE "bundled" CACHE STRING "By default use bundled editline")
ELSE()
SET(WITH_READLINE "system" CACHE STRING "By default use system readline")
ENDIF()
ELSEIF (WITH_EDITLINE AND WITH_READLINE)
MESSAGE(FATAL_ERROR "Cannot configure WITH_READLINE and WITH_EDITLINE! Use only one setting.")
ENDIF()
Expand Down

0 comments on commit 6c5dc40

Please sign in to comment.