[packages/mysql] - fix readline support for client - rel 3

adwol adwol at pld-linux.org
Sat Mar 31 22:26:13 CEST 2018


commit bd62a2c5ee7068c7c961e3e1d97fec92c539f291
Author: Adam Osuchowski <adwol at pld-linux.org>
Date:   Sat Mar 31 22:24:10 2018 +0200

    - fix readline support for client
    - rel 3

 mysql-cmake.patch    | 22 ++++++++++++++++------
 mysql-readline.patch | 34 ++++++++++++++++++++++++++++++++++
 mysql.spec           |  6 ++++--
 3 files changed, 54 insertions(+), 8 deletions(-)
---
diff --git a/mysql.spec b/mysql.spec
index 8abb164..73fe2de 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -35,7 +35,7 @@ Summary(uk.UTF-8):	MySQL - швидкий SQL-сервер
 Summary(zh_CN.UTF-8):	MySQL数据库服务器
 Name:		mysql
 Version:	5.7.21
-Release:	2
+Release:	3
 License:	GPL + MySQL FLOSS Exception
 Group:		Applications/Databases
 Source0:	http://cdn.mysql.com/Downloads/MySQL-5.7/%{name}-%{version}.tar.gz
@@ -67,6 +67,7 @@ Patch18:	%{name}-sphinx.patch
 Patch19:	%{name}-chain-certs.patch
 
 Patch24:	%{name}-cmake.patch
+Patch25:	%{name}-readline.patch
 
 Patch26:	%{name}dumpslow-clusters.patch
 URL:		http://www.mysql.com/products/community/
@@ -475,6 +476,7 @@ mv sphinx-*/mysqlse storage/sphinx
 %patch19 -p1
 
 %patch24 -p1
+%patch25 -p1
 
 %patch26 -p1
 
@@ -524,7 +526,7 @@ CPPFLAGS="%{rpmcppflags}" \
 	-DWITH_UNIT_TESTS=%{?with_tests:ON}%{!?with_tests:OFF} \
 	%{!?with_system_boost:-DWITH_BOOST="$(pwd)/$(ls -1d ../boost_*)"} \
 	-DWITH_ZLIB=system \
-	-DWITH_READLINE=system \
+	-DWITH_EDITLINE=system \
 	-DWITH_MECAB=system \
 	-DTMPDIR=/var/tmp
 
diff --git a/mysql-cmake.patch b/mysql-cmake.patch
index 7b7ae1c..89761cc 100644
--- a/mysql-cmake.patch
+++ b/mysql-cmake.patch
@@ -1,6 +1,7 @@
---- Percona-Server-5.6.15-rel63.0/cmake/readline.cmake.orig	2013-12-18 10:52:13.000000000 +0100
-+++ Percona-Server-5.6.15-rel63.0/cmake/readline.cmake	2014-02-09 06:17:56.079619159 +0100
-@@ -131,23 +131,23 @@
+diff -ruN mysql-5.7.21.orig/cmake/readline.cmake mysql-5.7.21/cmake/readline.cmake
+--- mysql-5.7.21.orig/cmake/readline.cmake	2017-12-28 04:46:26.000000000 +0100
++++ mysql-5.7.21/cmake/readline.cmake	2018-03-31 21:17:28.373826351 +0200
+@@ -110,23 +110,23 @@ ENDMACRO()
  
  MACRO (FIND_SYSTEM_EDITLINE)
    FIND_PATH(FOUND_EDITLINE_READLINE
@@ -28,7 +29,7 @@
    )
    MARK_AS_ADVANCED(EDITLINE_INCLUDE_DIR EDITLINE_LIBRARY)
  
-@@ -160,7 +160,7 @@
+@@ -139,7 +139,7 @@ MACRO (FIND_SYSTEM_EDITLINE)
      SET(CMAKE_REQUIRED_LIBRARIES ${EDITLINE_LIBRARY})
      CHECK_CXX_SOURCE_COMPILES("
      #include <stdio.h>
@@ -37,7 +38,7 @@
      int main(int argc, char **argv)
      {
         HIST_ENTRY entry;
-@@ -170,14 +170,13 @@
+@@ -149,14 +149,13 @@ MACRO (FIND_SYSTEM_EDITLINE)
  
      CHECK_CXX_SOURCE_COMPILES("
      #include <stdio.h>
@@ -55,5 +56,14 @@
 +      rl_completion_matches(0,0);
 +      return res ? 0 : 1;
      }"
-     EDITLINE_HAVE_COMPLETION)
+     EDITLINE_HAVE_COMPLETION_INT)
  
+@@ -168,7 +167,7 @@ MACRO (FIND_SYSTEM_EDITLINE)
+       typedef char* MYFunction(const char*, int);
+       MYFunction* myf= rl_completion_entry_function;
+       char *res= (myf)(NULL, 0);
+-      completion_matches(0,0);
++      rl_completion_matches(0,0);
+       return res != NULL;
+     }"
+     EDITLINE_HAVE_COMPLETION_CHAR)
diff --git a/mysql-readline.patch b/mysql-readline.patch
new file mode 100644
index 0000000..ce82211
--- /dev/null
+++ b/mysql-readline.patch
@@ -0,0 +1,34 @@
+diff -ruNp mysql-5.7.21.orig/client/mysql.cc mysql-5.7.21/client/mysql.cc
+--- mysql-5.7.21.orig/client/mysql.cc	2017-12-28 04:46:26.000000000 +0100
++++ mysql-5.7.21/client/mysql.cc	2018-03-31 21:37:27.879569060 +0200
+@@ -67,6 +67,7 @@
+ #else
+ #include <syslog.h>
+ #include <readline.h>
++#include <history.h>
+ #define HAVE_READLINE
+ #define USE_POPEN
+ #endif
+@@ -1126,22 +1127,6 @@ static const char *embedded_server_group
+ { "server", "embedded", "mysql_SERVER", 0 };
+ 
+ #ifdef HAVE_READLINE
+-/*
+- HIST_ENTRY is defined for libedit, but not for the real readline
+- Need to redefine it for real readline to find it
+-*/
+-#if !defined(HAVE_HIST_ENTRY)
+-typedef struct _hist_entry {
+-  const char      *line;
+-  const char      *data;
+-} HIST_ENTRY; 
+-#endif
+-
+-extern "C" int add_history(const char *command); /* From readline directory */
+-extern "C" int read_history(const char *command);
+-extern "C" int write_history(const char *command);
+-extern "C" HIST_ENTRY *history_get(int num);
+-extern "C" int history_length;
+ static int not_in_history(const char *line);
+ static void initialize_readline (char *name);
+ #endif                                          /* HAVE_READLINE */
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mysql.git/commitdiff/9c2f854ae060a209c1df81a1e1c3ea4466d4c46e



More information about the pld-cvs-commit mailing list