Compile 1.4.0 on on FreeBSD #898

v1.4.0-955
René Cannaò 9 years ago
parent 91a379ce3f
commit abd83ff1a3

@ -20,7 +20,7 @@ class MySQL_Event {
char *client;
size_t server_len;
size_t client_len;
uint64_t total_length;
//uint64_t total_length;
unsigned char buf[10];
enum log_event_type et;
uint64_t hid;

@ -2,5 +2,7 @@
// If defined then active pthread mutex in ProxySQL_Admin else use the wrlock
#define PA_PTHREAD_MUTEX
#ifndef __FreeBSD__
// If enabled, it adds support for auxiliary threads
#define IDLE_THREADS
#endif

@ -48,9 +48,11 @@
#include <sys/ioctl.h>
#ifndef __FreeBSD__
#define HAVE_BOOL
#include "my_global.h"
#include "my_pthread.h"
//#include "my_pthread.h"
#endif
#include "mysql.h"
#include "proxysql_mem.h"

@ -17,6 +17,8 @@
#include "thread.h"
#include "wqueue.h"
#include <fcntl.h>
#ifdef DEBUG
#define DEB "_DEBUG"
#else

@ -10,6 +10,11 @@ extern MySQL_Threads_Handler *GloMTH;
#undef max_allowed_packet
#endif
#ifdef __FreeBSD__
typedef uint8_t uint8;
typedef uint8_t uchar;
#endif
//#define RESULTSET_BUFLEN 16300
#ifdef DEBUG

@ -2594,7 +2594,7 @@ bool MySQL_Thread::process_data_on_data_stream(MySQL_Data_Stream *myds, unsigned
}
if (myds->active==FALSE) {
if (myds->active==0) {
if (myds->sess->client_myds==myds) {
proxy_debug(PROXY_DEBUG_NET,1, "Session=%p, DataStream=%p -- Deleting FD %d\n", myds->sess, myds, myds->fd);
myds->sess->set_unhealthy();
@ -3800,7 +3800,11 @@ void MySQL_Thread::Get_Memory_Stats() {
} else {
status_variables.mysql_frontend_buffers_bytes+=(mysql_sessions->len * QUEUE_T_DEFAULT_SIZE * 2);
status_variables.mysql_session_internal_bytes+=(mysql_sessions->len * sizeof(MySQL_Connection));
#ifndef __FreeBSD__
status_variables.mysql_session_internal_bytes+=((sizeof(int) + sizeof(int) + sizeof(std::_Rb_tree_node_base)) * mysql_sessions->len );
#else
status_variables.mysql_session_internal_bytes+=((sizeof(int) + sizeof(int) + 32) * mysql_sessions->len );
#endif
}
}
}

@ -19,6 +19,9 @@
#include <arpa/inet.h>
#include <pthread.h>
#include "SpookyV2.h"
#include <fcntl.h>
//#define MYSQL_THREAD_IMPLEMENTATION
#define SELECT_VERSION_COMMENT "select @@version_comment limit 1"
@ -2197,7 +2200,7 @@ static void * admin_main_loop(void *arg)
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize (&attr, mystacksize);
//pthread_attr_setstacksize (&attr, mystacksize);
if(GloVars.global.nostart) {
nostart_=true;
@ -2418,7 +2421,7 @@ bool ProxySQL_Admin::init() {
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setstacksize (&attr, mystacksize);
//pthread_attr_setstacksize (&attr, mystacksize);
admindb=new SQLite3DB();
admindb->open((char *)"file:mem_admindb?mode=memory&cache=shared", SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX);

@ -1,6 +1,7 @@
#include "proxysql.h"
#include "cpp.h"
#include "SpookyV2.h"
#include <fcntl.h>
extern const CHARSET_INFO * proxysql_find_charset_nr(unsigned int nr);

@ -113,7 +113,7 @@ MySQL_Data_Stream::MySQL_Data_Stream() {
queue_init(queueIN,QUEUE_T_DEFAULT_SIZE);
queue_init(queueOUT,QUEUE_T_DEFAULT_SIZE);
mybe=NULL;
active=TRUE;
active=1;
mypolls=NULL;
myconn=NULL; // 20141011
DSS=STATE_NOT_CONNECTED;
@ -245,7 +245,7 @@ void MySQL_Data_Stream::init(enum MySQL_DS_type _type, MySQL_Session *_sess, int
// TODO: should check the status of the data stream, and identify if it is safe to reconnect or if the session should be destroyed
void MySQL_Data_Stream::shut_soft() {
proxy_debug(PROXY_DEBUG_NET, 4, "Shutdown soft fd=%d. Session=%p, DataStream=%p\n", fd, sess, this);
active=FALSE;
active=0;
set_net_failure();
//if (sess) sess->net_failure=1;
}
@ -363,10 +363,10 @@ void MySQL_Data_Stream::set_pollout() {
int MySQL_Data_Stream::write_to_net_poll() {
int rc=0;
if (active==FALSE) return rc;
if (active==0) return rc;
proxy_debug(PROXY_DEBUG_NET,1,"Session=%p, DataStream=%p --\n", sess, this);
if (queue_data(queueOUT)) {
if ((sess->admin==false)) {
if (sess->admin==false) {
if (poll_fds_idx>-1) { // NOTE: attempt to force writes
if (net_failure==false)
rc=write_to_net();

@ -132,7 +132,9 @@ static volatile int load_;
//const char *malloc_conf = "xmalloc:true,lg_tcache_max:16,purge:decay,junk:true,tcache:false";
//#else
//const char *malloc_conf = "xmalloc:true,lg_tcache_max:16,purge:decay";
#ifndef __FreeBSD__
const char *malloc_conf = "xmalloc:true,lg_tcache_max:16,purge:decay,prof:true,prof_leak:true,lg_prof_sample:20,lg_prof_interval:30,prof_active:false";
#endif
//#endif /* DEBUG */
//const char *malloc_conf = "prof_leak:true,lg_prof_sample:0,prof_final:true,xmalloc:true,lg_tcache_max:16";

Loading…
Cancel
Save