]> git.pld-linux.org Git - packages/mysql.git/commitdiff
- fix readline support for client
authorAdam Osuchowski <adwol@pld-linux.org>
Sat, 31 Mar 2018 20:24:10 +0000 (22:24 +0200)
committerAdam Osuchowski <adwol@pld-linux.org>
Sat, 31 Mar 2018 20:24:10 +0000 (22:24 +0200)
- rel 3

mysql-cmake.patch
mysql-readline.patch [new file with mode: 0644]
mysql.spec

index 7b7ae1c2100e24e5d81f3a164bf7ed8f352c8c60..89761cc2a6738f41b5b8aa9d0ce31de8d7e71704 100644 (file)
@@ -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>
 +      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 (file)
index 0000000..ce82211
--- /dev/null
@@ -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 */
index 8abb1649add0ac9d303e428650dfab34fe454c67..73fe2de0f6d04bc8edf652ea35b012e420cbc521 100644 (file)
@@ -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
 
This page took 0.083768 seconds and 4 git commands to generate.