[packages/percona-server] - rel 2; reenable sphinx but: SphinxSE is not supported anymore starting from 3.0 anyway. Switching

2018-03-11 Thread arekm
commit 4c62e38419a541d56d01fbb7b17ee1458efd18e8
Author: Arkadiusz Miśkiewicz 
Date:   Sat Mar 10 20:40:20 2018 +0100

- rel 2; reenable sphinx but: SphinxSE is not supported anymore starting 
from 3.0 anyway. Switching to SphinxQL is recommended.

 percona-server.spec | 13 +
 1 file changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/percona-server.spec b/percona-server.spec
index 87b30dc..9f68144 100644
--- a/percona-server.spec
+++ b/percona-server.spec
@@ -29,7 +29,7 @@
 %bcond_without ssl # OpenSSL support
 %bcond_withsystemtap   # systemtap/dtrace probes
 %bcond_without tcpd# libwrap (tcp_wrappers) support
-%bcond_withsphinx  # Sphinx storage engine support
+%bcond_without sphinx  # Sphinx storage engine support
 %bcond_without tokudb  # TokuDB
 %bcond_without rocksdb # RocksDB
 # mysql needs boost 1.59.0 and doesn't support newer/older boost versions
@@ -43,7 +43,7 @@
 %undefine  with_tokudb
 %endif
 
-%definerel 1
+%definerel 2
 %definepercona_rel 20
 %include   /usr/lib/rpm/macros.perl
 Summary:   Percona Server: a very fast and reliable SQL database engine
@@ -87,7 +87,9 @@ Patch7:   lz4.patch
 
 Patch11:   mysql-upgrade.patch
 Patch12:   mysql-config.patch
-Patch18:   mysql-sphinx.patch
+Patch17:   mysql-sphinx.patch
+# https://github.com/sphinxsearch/sphinx/pull/32/
+Patch18:   mysql-5.7-sphinx.patch
 Patch19:   mysql-chain-certs.patch
 # from fedora
 Patch20:   mysql-dubious-exports.patch
@@ -498,7 +500,10 @@ Ten pakiet zawiera standardowego demona Percona Server NDB 
CPC.
 %if %{with sphinx}
 # http://www.sphinxsearch.com/docs/manual-0.9.9.html#sphinxse-mysql51
 mv sphinx-*/mysqlse storage/sphinx
-%patch18 -p1
+%patch17 -p1
+cd storage/sphinx
+%patch18 -p2
+cd ../..
 %endif
 %patch1 -p1
 


 gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/percona-server.git/commitdiff/4c62e38419a541d56d01fbb7b17ee1458efd18e8

___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


[packages/percona-server] - rel 2; reenable sphinx but: SphinxSE is not supported anymore starting from 3.0 anyway. Switching

2018-03-11 Thread arekm
commit 52f61ee2da63d7faa7e061226cf817443aebb568
Author: Arkadiusz Miśkiewicz 
Date:   Sat Mar 10 20:40:33 2018 +0100

- rel 2; reenable sphinx but: SphinxSE is not supported anymore starting 
from 3.0 anyway. Switching to SphinxQL is recommended.

 mysql-5.7-sphinx.patch | 442 +
 1 file changed, 442 insertions(+)
---
diff --git a/mysql-5.7-sphinx.patch b/mysql-5.7-sphinx.patch
new file mode 100644
index 000..4d2f088
--- /dev/null
+++ b/mysql-5.7-sphinx.patch
@@ -0,0 +1,442 @@
+From 8bc97078153cfae322a36151143f1a06196730d7 Mon Sep 17 00:00:00 2001
+From: Adrian Nuta 
+Date: Tue, 27 Sep 2016 16:41:36 +0300
+Subject: [PATCH] sphinxse patches for mariadb 10.1 and mysql 5.7
+
+---
+ mysqlse/ha_sphinx.cc | 170 +--
+ mysqlse/ha_sphinx.h  |  30 ++---
+ 2 files changed, 161 insertions(+), 39 deletions(-)
+
+diff --git a/mysqlse/ha_sphinx.cc b/mysqlse/ha_sphinx.cc
+index 9b0c3a8e..080f7ce0 100644
+--- a/mysqlse/ha_sphinx.cc
 b/mysqlse/ha_sphinx.cc
+@@ -34,13 +34,37 @@
+ #include "../mysql_priv.h"
+ #endif
+ 
++#if !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709
++#include "item_timefunc.h"
++#define sphinx_append push_back
++#define sphinx_array std::vector
++#define sphinx_elements size
++#if defined(_WIN32)
++#define __WIN__ _WIN32
++#define pthread_mutex_init(A,B)  (InitializeCriticalSection(A),0)
++#define pthread_mutex_lock(A)  (EnterCriticalSection(A),0)
++#define pthread_mutex_unlock(A)  (LeaveCriticalSection(A), 0)
++#define pthread_mutex_destroy(A) (DeleteCriticalSection(A), 0)
++#define in_addr_t uint32
++#include 
++#endif
++#else
++#define sphinx_append append
++#define sphinx_array Dynamic_array
++#define sphinx_elements elements
++#endif
++
+ #include 
+ #include 
+ #include  // include client for INSERT table (sort of redoing 
federated..)
+ 
+ #ifndef __WIN__
+   // UNIX-specific
+-  #include 
++  #if  !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709
++  #include 
++  #else
++  #include 
++  #endif
+   #include 
+   #include 
+ 
+@@ -286,6 +310,12 @@ inline void SPH_DEBUG ( const char *, ... ) {}
+ #define SafeDelete(_arg)  { if ( _arg ) delete ( _arg );  
(_arg) = NULL; }
+ #define SafeDeleteArray(_arg) { if ( _arg ) delete [] ( _arg );   (_arg) 
= NULL; }
+ 
++#if  !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID>=50709
++#ifdef __WIN__
++typedef native_mutex_t pthread_mutex_t;
++#endif
++#endif
++
+ //
+ 
+ /// per-table structure that will be shared among all open Sphinx SE handlers
+@@ -602,10 +632,10 @@ struct CSphSEQuery
+   };
+   char *  m_sName; ///< 
points to query buffer
+   int m_iType;
+-  Dynamic_arraym_dIds;
+-  Dynamic_array  m_dValues;
++  sphinx_array m_dIds;
++  sphinx_array   m_dValues;
+   };
+-  Dynamic_array m_dOverrides;
++  sphinx_array m_dOverrides;
+ 
+ public:
+   charm_sParseError[256];
+@@ -634,10 +664,10 @@ struct CSphSEQuery
+   voidSendString ( const char * v )   { int iLen = 
strlen(v); SendDword(iLen); SendBytes ( v, iLen ); }
+   voidSendFloat ( float v )   { 
SendDword ( sphF2DW(v) ); }
+ };
+-
++#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
+ template int CSphSEQuery::ParseArray ( uint32 **, const char * );
+ template int CSphSEQuery::ParseArray ( longlong **, const char * );
+-
++#endif
+ //
+ 
+ #if MYSQL_VERSION_ID>50100
+@@ -733,13 +763,21 @@ static int sphinx_init_func ( void * p )
+   {
+   sphinx_init = 1;
+   void ( pthread_mutex_init ( _mutex, MY_MUTEX_INIT_FAST ) 
);
++  #if  !defined(MARIADB_BASE_VERSION) && MYSQL_VERSION_ID >= 50709
++  sphinx_hash_init ( _open_tables, system_charset_info, 
32, 0, 0,
++  sphinx_get_key, 0, 0, 0 );
++  #else
+   sphinx_hash_init ( _open_tables, system_charset_info, 
32, 0, 0,
+   sphinx_get_key, 0, 0 );
+-
++  #endif
+   #if MYSQL_VERSION_ID > 50100
+   handlerton * hton = (handlerton*) p;
+   hton->state = SHOW_OPTION_YES;
++  #if  !defined(MARIADB_BASE_VERSION)
+   hton->db_type = DB_TYPE_FIRST_DYNAMIC;
++  #else
++  hton->db_type = DB_TYPE_AUTOASSIGN;
++  #endif
+   hton->create = sphinx_create_handler;
+   hton->close_connection = sphinx_close_connection;
+