Commit 3261a78e authored by Oleksandr Byelkin's avatar Oleksandr Byelkin

Merge branch '10.4' into 10.5

parents ac5a534a 0a634390
......@@ -199,9 +199,22 @@ extern ulonglong strtoull(const char *str, char **ptr, int base);
#include <mysql/plugin.h>
#define STRING_WITH_LEN(X) (X), ((size_t) (sizeof(X) - 1))
#define USTRING_WITH_LEN(X) ((uchar*) X), ((size_t) (sizeof(X) - 1))
#define C_STRING_WITH_LEN(X) ((char *) (X)), ((size_t) (sizeof(X) - 1))
#ifdef __cplusplus
#include <type_traits>
template<typename T> inline const char *_swl_check(T s)
{
static_assert(std::is_same<T, const char (&)[sizeof(T)]>::value
|| std::is_same<T, const char [sizeof(T)]>::value,
"Wrong argument for STRING_WITH_LEN()");
return s;
}
#define STRING_WITH_LEN(X) _swl_check<decltype(X)>(X), ((size_t) (sizeof(X) - 1))
#else
#define STRING_WITH_LEN(X) (X ""), ((size_t) (sizeof(X) - 1))
#endif
#define USTRING_WITH_LEN(X) (uchar*) STRING_WITH_LEN(X)
#define C_STRING_WITH_LEN(X) (char *) STRING_WITH_LEN(X)
#define LEX_STRING_WITH_LEN(X) (X).str, (X).length
typedef struct st_mysql_const_lex_string LEX_CSTRING;
......
......@@ -280,7 +280,6 @@ show status like 'Com%function';
#
connect (root, localhost, root,,test);
connection root;
let $root_connection_id= `select connection_id()`;
--disable_warnings
create database db37908;
--enable_warnings
......@@ -296,7 +295,6 @@ delimiter ;|
connect (user1,localhost,mysqltest_1,,test);
connection user1;
let $user1_connection_id= `select connection_id()`;
--error ER_TABLEACCESS_DENIED_ERROR
select * from db37908.t1;
......@@ -315,11 +313,8 @@ drop procedure proc37908;
drop function func37908;
REVOKE ALL PRIVILEGES, GRANT OPTION FROM mysqltest_1@localhost;
DROP USER mysqltest_1@localhost;
# Wait till the sessions user1 and root are disconnected
let $wait_condition =
SELECT COUNT(*) = 0
FROM information_schema.processlist
WHERE id in ('$root_connection_id','$user1_connection_id');
# Wait until all non-default sessions are disconnected
let $wait_condition = SELECT COUNT(*) = 1 FROM information_schema.processlist;
--source include/wait_condition.inc
#
......
......@@ -239,10 +239,10 @@ static int addr_resolve(void *ptr, my_addr_loc *loc)
}
/* 500 ms should be plenty of time for addr2line to issue a response. */
/* 5000 ms should be plenty of time for addr2line to issue a response. */
/* Read in a loop till all the output from addr2line is complete. */
while (parsed == total_bytes_read &&
(ret= poll(&poll_fds, 1, 500)))
(ret= poll(&poll_fds, 1, 5000)))
{
/* error during poll */
if (ret < 0)
......@@ -286,7 +286,8 @@ static int addr_resolve(void *ptr, my_addr_loc *loc)
loc->line= atoi(output + line_number_start);
/* Addr2line was unable to extract any meaningful information. */
if (strcmp(loc->file, "??") == 0 && loc->func[0] == '?')
if ((strcmp(loc->file, "??") == 0 || strcmp(loc->file, "") == 0) &&
(loc->func[0] == '?' || loc->line == 0))
return 6;
loc->file= strip_path(loc->file);
......
......@@ -1317,7 +1317,7 @@ uchar *debug_sync_value_ptr(THD *thd)
if (opt_debug_sync_timeout)
{
static char on[]= "ON - current signal: '";
static const char on[]= "ON - current signal: '";
// Ensure exclusive access to debug_sync_global.ds_signal
mysql_mutex_lock(&debug_sync_global.ds_mutex);
......
......@@ -28263,19 +28263,19 @@ enum explainable_cmd_type
};
static
const char * const explainable_cmd_name []=
const LEX_CSTRING explainable_cmd_name []=
{
"select ",
"insert ",
"replace ",
"update ",
"delete ",
{STRING_WITH_LEN("select ")},
{STRING_WITH_LEN("insert ")},
{STRING_WITH_LEN("replace ")},
{STRING_WITH_LEN("update ")},
{STRING_WITH_LEN("delete ")},
};
static
char const *get_explainable_cmd_name(enum explainable_cmd_type cmd)
const LEX_CSTRING* get_explainable_cmd_name(enum explainable_cmd_type cmd)
{
return explainable_cmd_name[cmd];
return explainable_cmd_name + cmd;
}
static
......@@ -28577,7 +28577,7 @@ void st_select_lex::print(THD *thd, String *str, enum_query_type query_type)
query_type);
}
if (sel_type == UPDATE_CMD || sel_type == DELETE_CMD)
str->append(STRING_WITH_LEN(get_explainable_cmd_name(sel_type)));
str->append(get_explainable_cmd_name(sel_type));
if (sel_type == DELETE_CMD)
{
str->append(STRING_WITH_LEN(" from "));
......
......@@ -64,9 +64,12 @@ inline void toku_debug_sync(struct tokutxn *txn, const char *sync_point_name) {
void *client_extra;
THD *thd;
toku_txn_get_client_id(txn, &client_id, &client_extra);
thd = reinterpret_cast<THD *>(client_extra);
DEBUG_SYNC(thd, sync_point_name);
if (debug_sync_service)
{
toku_txn_get_client_id(txn, &client_id, &client_extra);
thd = reinterpret_cast<THD *>(client_extra);
debug_sync_service(thd, sync_point_name, strlen(sync_point_name));
}
}
#else // defined(ENABLED_DEBUG_SYNC)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment