Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111

# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
This commit is contained in:
counterpoint
2015-11-11 11:08:02 +00:00
436 changed files with 289135 additions and 8102 deletions

File diff suppressed because it is too large Load Diff

View File

@ -18,11 +18,6 @@
#include <sharding_common.h>
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/**
* Extract the database name from a COM_INIT_DB or literal USE ... query.
* @param buf Buffer with the database change query
@ -100,17 +95,17 @@ void create_error_reply(char* fail_str,DCB* dcb)
}
/**
* Read new database name from MYSQL_COM_INIT_DB packet or a literal USE ... COM_QUERY packet, check that it exists
* in the hashtable and copy its name to MYSQL_session.
* Read new database name from MYSQL_COM_INIT_DB packet or a literal USE ... COM_QUERY
* packet, check that it exists in the hashtable and copy its name to MYSQL_session.
*
* @param mysql_session The MySQL session structure
* @param dest Destination where the database name will be written
* @param dbhash Hashtable containing valid databases
* @param buf Buffer containing the database change query
*
* @return true if new database is set, false if non-existent database was tried
* to be set
*/
bool change_current_db(MYSQL_session* mysql_session,
bool change_current_db(char* dest,
HASHTABLE* dbhash,
GWBUF* buf)
{
@ -139,7 +134,7 @@ bool change_current_db(MYSQL_session* mysql_session,
}
else
{
strncpy(mysql_session->db,db,MYSQL_DATABASE_MAXLEN);
strcpy(dest,db);
skygw_log_write(LOGFILE_TRACE,"change_current_db: database is on server: '%s'.",target);
succp = true;
goto retblock;

View File

@ -46,10 +46,6 @@ MODULE_INFO info = {
};
/** Defined in log_manager.cc */
extern int lm_enabled_logfiles_bitmask;
extern size_t log_ses_count[];
extern __thread log_info_t tls_log_info;
/**
* @file shardrouter.c
*
@ -1699,7 +1695,7 @@ routeQuery(ROUTER* instance,
if(packet_type == MYSQL_COM_INIT_DB)
{
if(!(change_successful = change_current_db(router_cli_ses->rses_mysql_session,
if(!(change_successful = change_current_db(router_cli_ses->current_db,
router_cli_ses->dbhash,
querybuf)))
{
@ -2472,23 +2468,6 @@ execute_sescmd_in_backend(SUBSERVICE* subsvc)
rc = SESSION_ROUTE_QUERY(subsvc->session,sescmd_cursor_clone_querybuf(scur));
break;
case MYSQL_COM_INIT_DB:
{
/**
* Record database name and store to session.
*/
GWBUF* tmpbuf;
MYSQL_session* data;
unsigned int qlen;
data = subsvc->session->data;
tmpbuf = scur->scmd_cur_cmd->my_sescmd_buf;
qlen = MYSQL_GET_PACKET_LEN((unsigned char*) tmpbuf->start);
memset(data->db, 0, MYSQL_DATABASE_MAXLEN + 1);
strncpy(data->db, tmpbuf->start + 5, qlen - 1);
rc = SESSION_ROUTE_QUERY(subsvc->session,sescmd_cursor_clone_querybuf(scur));
}
/** Fallthrough */
case MYSQL_COM_QUERY:
default:
/**