Skip to content
Permalink
Browse files
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
  • Loading branch information
abarkov committed Oct 30, 2017
2 parents 84ed288 + 58e0dcb commit 003cb2f
Show file tree
Hide file tree
Showing 412 changed files with 22,734 additions and 3,073 deletions.
@@ -1065,8 +1065,7 @@ static void fix_history(String *final_command);

static COMMANDS *find_command(char *name);
static COMMANDS *find_command(char cmd_name);
static bool add_line(String &buffer, char *line, ulong line_length,
char *in_string, bool *ml_comment, bool truncated);
static bool add_line(String &, char *, ulong, char *, bool *, bool);
static void remove_cntrl(String &buffer);
static void print_table_data(MYSQL_RES *result);
static void print_table_data_html(MYSQL_RES *result);
@@ -1078,7 +1077,7 @@ static ulong start_timer(void);
static void end_timer(ulong start_time,char *buff);
static void mysql_end_timer(ulong start_time,char *buff);
static void nice_time(double sec,char *buff,bool part_second);
extern "C" sig_handler mysql_end(int sig);
extern "C" sig_handler mysql_end(int sig) __attribute__ ((noreturn));
extern "C" sig_handler handle_sigint(int sig);
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
static sig_handler window_resize(int sig);
@@ -165,9 +165,14 @@ SETA(CPACK_RPM_server_PACKAGE_REQUIRES
"MariaDB-client")

IF(WITH_WSREP)
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
"galera" "rsync" "lsof" "grep" "gawk" "iproute"
"coreutils" "findutils" "tar" "which")
SETA(CPACK_RPM_server_PACKAGE_REQUIRES
"galera" "rsync" "lsof" "grep" "gawk" "iproute"
"coreutils" "findutils" "tar")
IF (RPM MATCHES "sles11")
SETA(CPACK_RPM_server_PACKAGE_REQUIRES "util-linux")
ELSE()
SETA(CPACK_RPM_server_PACKAGE_REQUIRES "which")
ENDIF()
ENDIF()

SET(CPACK_RPM_server_PRE_INSTALL_SCRIPT_FILE ${CMAKE_SOURCE_DIR}/support-files/rpm/server-prein.sh)
@@ -20,6 +20,11 @@ IF(have_C__Wvla)
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wvla")
ENDIF()

MY_CHECK_C_COMPILER_FLAG("-Wno-format-truncation")
IF(HAVE_C__Wno_format_truncation)
SET(MY_WARNING_FLAGS "${MY_WARNING_FLAGS} -Wno-format-truncation")
ENDIF()

# Common warning flags for GCC and Clang
SET(MY_C_WARNING_FLAGS
"${MY_WARNING_FLAGS} -Wwrite-strings -Wdeclaration-after-statement")
@@ -7,10 +7,8 @@ ENDIF()
SET(CONC_WITH_SIGNCODE ${SIGNCODE})
SET(SIGN_OPTIONS ${SIGNTOOL_PARAMETERS})

IF(TARGET zlib)
GET_PROPERTY(ZLIB_LIBRARY_LOCATION TARGET zlib PROPERTY LOCATION)
ELSE()
SET(ZLIB_LIBRARY_LOCATION ${ZLIB_LIBRARY})
IF(NOT TARGET zlib)
SET(CONC_WITH_EXTERNAL_ZLIB ON)
ENDIF()

IF(SSL_DEFINES MATCHES "YASSL")
@@ -69,13 +69,9 @@ ENDMACRO()
# Get mysql version and other interesting variables
GET_MYSQL_VERSION()

SET(MYSQL_TCP_PORT_DEFAULT "3306")

SET(MYSQL_TCP_PORT_DEFAULT 0)
IF(NOT MYSQL_TCP_PORT)
SET(MYSQL_TCP_PORT ${MYSQL_TCP_PORT_DEFAULT})
SET(MYSQL_TCP_PORT_DEFAULT "0")
ELSEIF(MYSQL_TCP_PORT EQUAL MYSQL_TCP_PORT_DEFAULT)
SET(MYSQL_TCP_PORT_DEFAULT "0")
SET(MYSQL_TCP_PORT 3306)
ENDIF()

IF(NOT COMPILATION_COMMENT)
@@ -1,11 +1,23 @@
INCLUDE (CheckCSourceRuns)

SET(WITH_PCRE "auto" CACHE STRING
"Which pcre to use (possible values are 'bundled', 'system', or 'auto')")

MACRO (CHECK_PCRE)
IF(WITH_PCRE STREQUAL "system" OR WITH_PCRE STREQUAL "auto")
CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE)
CHECK_LIBRARY_EXISTS(pcre pcre_stack_guard "" HAVE_PCRE_STACK_GUARD)
IF(NOT CMAKE_CROSSCOMPILING)
SET(CMAKE_REQUIRED_LIBRARIES "pcre")
CHECK_C_SOURCE_RUNS("
#include <pcre.h>
int main() {
return -pcre_exec(NULL, NULL, NULL, -999, -999, 0, NULL, 0) < 256;
}" PCRE_STACK_SIZE_OK)
SET(CMAKE_REQUIRED_LIBRARIES)
ENDIF()
ENDIF()
IF(NOT HAVE_PCRE OR WITH_PCRE STREQUAL "bundled")
IF(NOT HAVE_PCRE_STACK_GUARD OR NOT PCRE_STACK_SIZE_OK OR
WITH_PCRE STREQUAL "bundled")
IF (WITH_PCRE STREQUAL "system")
MESSAGE(FATAL_ERROR "system pcre is not found or unusable")
ENDIF()
@@ -259,7 +259,7 @@ typedef struct _db_code_state_ {
#define ListDel(A,B,C) ListAddDel(A,B,C,EXCLUDE)
static struct link *ListAddDel(struct link *, const char *, const char *, int);
static struct link *ListCopy(struct link *);
static int InList(struct link *linkp,const char *cp, int exact_match);
static int InList(struct link *linkp,const char *cp,int exact_match);
static uint ListFlags(struct link *linkp);
static void FreeList(struct link *linkp);

@@ -458,8 +458,8 @@ static int DbugParse(CODE_STATE *cs, const char *control)

if (!(org_cs_locked= cs->locked))
{
cs->locked= 1;
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked= 1;
}

if (control[0] == '-' && control[1] == '#')
@@ -666,8 +666,8 @@ static int DbugParse(CODE_STATE *cs, const char *control)
}
if (!org_cs_locked)
{
pthread_mutex_unlock(&THR_LOCK_dbug);
cs->locked= 0;
pthread_mutex_unlock(&THR_LOCK_dbug);
}
return !rel || f_used;
}
@@ -1096,7 +1096,7 @@ int _db_explain_init_(char *buf, size_t len)
void _db_enter_(const char *_func_, const char *_file_,
uint _line_, struct _db_stack_frame_ *_stack_frame_)
{
int save_errno;
int save_errno, org_cs_locked;
CODE_STATE *cs;
if (!((cs=code_state())))
{
@@ -1125,12 +1125,20 @@ void _db_enter_(const char *_func_, const char *_file_,
cs->stack->flags &= ~SANITY_CHECK_ON;
if (TRACING)
{
if (!cs->locked)
if (!(org_cs_locked= cs->locked))
{
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked= 1;
}
DoPrefix(cs, _line_);
Indent(cs, cs->level);
(void) fprintf(cs->stack->out_file->file, ">%s\n", cs->func);
DbugFlush(cs); /* This does a unlock */
if (!org_cs_locked)
{
cs->locked= 0;
pthread_mutex_unlock(&THR_LOCK_dbug);
}
}
break;
case DISABLE_TRACE:
@@ -1181,16 +1189,25 @@ void _db_return_(struct _db_stack_frame_ *_stack_frame_)

if (DoTrace(cs) & DO_TRACE)
{
int org_cs_locked;
if ((cs->stack->flags & SANITY_CHECK_ON) && sf_sanity())
cs->stack->flags &= ~SANITY_CHECK_ON;
if (TRACING)
{
if (!cs->locked)
if (!(org_cs_locked= cs->locked))
{
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked= 1;
}
DoPrefix(cs, _stack_frame_->line);
Indent(cs, cs->level);
(void) fprintf(cs->stack->out_file->file, "<%s\n", cs->func);
DbugFlush(cs);
if (!org_cs_locked)
{
cs->locked= 0;
pthread_mutex_unlock(&THR_LOCK_dbug);
}
}
}
/*
@@ -1267,14 +1284,17 @@ void _db_doprnt_(const char *format,...)
{
va_list args;
CODE_STATE *cs;
int save_errno;
int save_errno, org_cs_locked;

get_code_state_or_return;

va_start(args,format);

if (!cs->locked)
if (!(org_cs_locked= cs->locked))
{
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked= 1;
}
save_errno=errno;
DoPrefix(cs, cs->u_line);
if (TRACING)
@@ -1284,6 +1304,11 @@ void _db_doprnt_(const char *format,...)
(void) fprintf(cs->stack->out_file->file, "%s: ", cs->u_keyword);
DbugVfprintf(cs->stack->out_file->file, format, args);
DbugFlush(cs);
if (!org_cs_locked)
{
cs->locked= 0;
pthread_mutex_unlock(&THR_LOCK_dbug);
}
errno=save_errno;

va_end(args);
@@ -1323,12 +1348,15 @@ static void DbugVfprintf(FILE *stream, const char* format, va_list args)
void _db_dump_(uint _line_, const char *keyword,
const unsigned char *memory, size_t length)
{
int pos;
int pos, org_cs_locked;
CODE_STATE *cs;
get_code_state_or_return;

if (!cs->locked)
if (!(org_cs_locked= cs->locked))
{
pthread_mutex_lock(&THR_LOCK_dbug);
cs->locked= 1;
}
if (_db_keyword_(cs, keyword, 0))
{
DoPrefix(cs, _line_);
@@ -1360,8 +1388,11 @@ void _db_dump_(uint _line_, const char *keyword,
(void) fputc('\n',cs->stack->out_file->file);
DbugFlush(cs);
}
else if (!cs->locked)
if (!org_cs_locked)
{
cs->locked= 0;
pthread_mutex_unlock(&THR_LOCK_dbug);
}
}


@@ -1509,11 +1540,13 @@ static struct link *ListCopy(struct link *orig)
static int InList(struct link *linkp, const char *cp, int exact_match)
{
int result;

for (result=MATCHED; linkp != NULL; linkp= linkp->next_link)
{
if (!(exact_match ? strcmp(linkp->str,cp) : fnmatch(linkp->str, cp, 0)))
return linkp->flags;
{
result= linkp->flags;
break;
}
if (!(linkp->flags & EXCLUDE))
result=NOT_MATCHED;
if (linkp->flags & SUBDIR)
@@ -1647,6 +1680,7 @@ void _db_end_()
FreeState(cs, 0);
pthread_mutex_destroy(&THR_LOCK_dbug);
init_done= 0;
_dbug_on_= 0;
}


@@ -1665,22 +1699,39 @@ void _db_end_()

static int DoTrace(CODE_STATE *cs)
{
int res= DONT_TRACE;
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
if ((cs->stack->maxdepth == 0 || cs->level <= cs->stack->maxdepth) &&
InList(cs->stack->processes, cs->process, 0) & (MATCHED|INCLUDE))
{
switch(InList(cs->stack->functions, cs->func, 0)) {
case INCLUDE|SUBDIR: return ENABLE_TRACE;
case INCLUDE: return DO_TRACE;
case INCLUDE|SUBDIR:
res= ENABLE_TRACE;
break;
case INCLUDE:
res= DO_TRACE;
break;
case MATCHED|SUBDIR:
case NOT_MATCHED|SUBDIR:
case MATCHED: return framep_trace_flag(cs, cs->framep) ?
DO_TRACE : DONT_TRACE;
case MATCHED:
res= (framep_trace_flag(cs, cs->framep) ? DO_TRACE : DONT_TRACE);
break;
case EXCLUDE:
case NOT_MATCHED: return DONT_TRACE;
case EXCLUDE|SUBDIR: return DISABLE_TRACE;
case NOT_MATCHED:
res= DONT_TRACE;
break;
case EXCLUDE|SUBDIR:
res= DISABLE_TRACE;
break;
}
return DONT_TRACE;
}
if (!cs->locked)
pthread_mutex_unlock(&THR_LOCK_dbug);
return res;
}


FILE *_db_fp_(void)
{
CODE_STATE *cs;
@@ -1711,10 +1762,17 @@ FILE *_db_fp_(void)
BOOLEAN _db_keyword_(CODE_STATE *cs, const char *keyword, int strict)
{
int match= strict ? INCLUDE : INCLUDE|MATCHED;
int res;
get_code_state_if_not_set_or_return FALSE;

return (DEBUGGING && DoTrace(cs) & DO_TRACE &&
InList(cs->stack->keywords, keyword, strict) & match);
if (!(DEBUGGING && (DoTrace(cs) & DO_TRACE)))
return 0;
if (!cs->locked)
pthread_mutex_lock(&THR_LOCK_dbug);
res= (InList(cs->stack->keywords, keyword, strict) & match);
if (!cs->locked)
pthread_mutex_unlock(&THR_LOCK_dbug);
return res != 0;
}

/*
@@ -2130,8 +2188,6 @@ static void DbugFlush(CODE_STATE *cs)
if (cs->stack->delay)
(void) Delay(cs->stack->delay);
}
if (!cs->locked)
pthread_mutex_unlock(&THR_LOCK_dbug);
} /* DbugFlush */


@@ -2141,7 +2197,12 @@ void _db_flush_()
{
CODE_STATE *cs;
get_code_state_or_return;
(void) fflush(cs->stack->out_file->file);
if (DEBUGGING)
{
pthread_mutex_lock(&THR_LOCK_dbug);
(void) fflush(cs->stack->out_file->file);
pthread_mutex_unlock(&THR_LOCK_dbug);
}
}


@@ -1896,6 +1896,13 @@ decrypt_decompress_file(const char *filepath, uint thread_n)
if (system(cmd.str().c_str()) != 0) {
return(false);
}

if (opt_remove_original) {
msg_ts("[%02u] removing %s\n", thread_n, filepath);
if (my_delete(filepath, MYF(MY_WME)) != 0) {
return(false);
}
}
}

return(true);

0 comments on commit 003cb2f

Please sign in to comment.