Merge branch '2.2' into develop
This commit is contained in:
@ -2,6 +2,7 @@
|
|||||||
"build" :
|
"build" :
|
||||||
{
|
{
|
||||||
"hostname" : "default",
|
"hostname" : "default",
|
||||||
|
"memory_size" : "4096",
|
||||||
"box" : "$box"
|
"box" : "$box"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
{
|
{
|
||||||
"hostname" : "maxscale",
|
"hostname" : "maxscale",
|
||||||
"box" : "$box",
|
"box" : "$box",
|
||||||
|
"memory_size" : "4096",
|
||||||
"product" : {
|
"product" : {
|
||||||
"name": "maxscale"
|
"name": "maxscale"
|
||||||
}
|
}
|
||||||
|
@ -713,7 +713,7 @@ static bool multi_source_replication(MYSQL *conn, int node)
|
|||||||
MYSQL_RES *res;
|
MYSQL_RES *res;
|
||||||
|
|
||||||
if (mysql_query(conn, "SHOW ALL SLAVES STATUS") == 0 &&
|
if (mysql_query(conn, "SHOW ALL SLAVES STATUS") == 0 &&
|
||||||
(res = mysql_store_result(conn)))
|
(res = mysql_store_result(conn)))
|
||||||
{
|
{
|
||||||
if (mysql_num_rows(res) == 1)
|
if (mysql_num_rows(res) == 1)
|
||||||
{
|
{
|
||||||
@ -1293,7 +1293,7 @@ void Mariadb_nodes::close_active_connections()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const char *sql =
|
const char *sql =
|
||||||
"select id from information_schema.processlist where id != @@pseudo_thread_id and user not in ('system user', 'repl')";
|
"select id from information_schema.processlist where id != @@pseudo_thread_id and user not in ('system user', 'repl')";
|
||||||
|
|
||||||
for (int i = 0; i < N; i++)
|
for (int i = 0; i < N; i++)
|
||||||
{
|
{
|
||||||
@ -1326,7 +1326,7 @@ void Mariadb_nodes::stash_server_settings(int node)
|
|||||||
|
|
||||||
void Mariadb_nodes::restore_server_settings(int node)
|
void Mariadb_nodes::restore_server_settings(int node)
|
||||||
{
|
{
|
||||||
ssh_node(node, "sudo mv -f /etc/my.cnf.d.backup/* /etc/my.cnf.d/", true);
|
ssh_node(node, "sudo mv -f /etc/my.cnf.d.backup/* /etc/my.cnf.d/", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mariadb_nodes::disable_server_setting(int node, const char* setting)
|
void Mariadb_nodes::disable_server_setting(int node, const char* setting)
|
||||||
@ -1336,8 +1336,8 @@ void Mariadb_nodes::disable_server_setting(int node, const char* setting)
|
|||||||
|
|
||||||
void Mariadb_nodes::add_server_setting(int node, const char* setting)
|
void Mariadb_nodes::add_server_setting(int node, const char* setting)
|
||||||
{
|
{
|
||||||
ssh_node_f(node, true, "sudo sed -i '$a [server]' /etc/my.cnf.d/server.cnf", setting);
|
ssh_node_f(node, true, "sudo sed -i '$a [server]' /etc/my.cnf.d/server*.cnf", setting);
|
||||||
ssh_node_f(node, true, "sudo sed -i '$a %s' /etc/my.cnf.d/server.cnf", setting);
|
ssh_node_f(node, true, "sudo sed -i '$a %s' /etc/my.cnf.d/server*.cnf", setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Mariadb_nodes::reset_server_settings(int node)
|
void Mariadb_nodes::reset_server_settings(int node)
|
||||||
@ -1396,7 +1396,9 @@ int Mariadb_nodes::prepare_server(int i)
|
|||||||
ssh_node_f(i, true, "%s", stop_db_command[i]);
|
ssh_node_f(i, true, "%s", stop_db_command[i]);
|
||||||
sleep(5);
|
sleep(5);
|
||||||
ssh_node(i, "sed -i \"s/bind-address/#bind-address/g\" /etc/mysql/my.cnf.d/*.cnf", true);
|
ssh_node(i, "sed -i \"s/bind-address/#bind-address/g\" /etc/mysql/my.cnf.d/*.cnf", true);
|
||||||
ssh_node(i, "ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/usr.sbin.mysqld; sudo service apparmor restart", true);
|
ssh_node(i,
|
||||||
|
"ln -s /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/disable/usr.sbin.mysqld; sudo service apparmor restart",
|
||||||
|
true);
|
||||||
version = ssh_node_output(i, "/usr/sbin/mysqld --version", false, &ec);
|
version = ssh_node_output(i, "/usr/sbin/mysqld --version", false, &ec);
|
||||||
if (ec == 0)
|
if (ec == 0)
|
||||||
{
|
{
|
||||||
@ -1413,7 +1415,8 @@ int Mariadb_nodes::prepare_server(int i)
|
|||||||
// password in the log and reseting passord to empty string
|
// password in the log and reseting passord to empty string
|
||||||
ssh_node(i, "/usr/sbin/mysqld --initialize; sudo chown -R mysql:mysql /var/lib/mysql", true);
|
ssh_node(i, "/usr/sbin/mysqld --initialize; sudo chown -R mysql:mysql /var/lib/mysql", true);
|
||||||
ssh_node(i, start_db_command[i], true);
|
ssh_node(i, start_db_command[i], true);
|
||||||
tmp_pass = ssh_node_output(i, "cat /var/log/mysqld.log | grep \"temporary password\" | sed -n -e 's/^.*: //p'", true, &ec);
|
tmp_pass = ssh_node_output(i,
|
||||||
|
"cat /var/log/mysqld.log | grep \"temporary password\" | sed -n -e 's/^.*: //p'", true, &ec);
|
||||||
ssh_node_f(i, true, "mysqladmin -uroot -p'%s' password '%s'", tmp_pass, tmp_pass);
|
ssh_node_f(i, true, "mysqladmin -uroot -p'%s' password '%s'", tmp_pass, tmp_pass);
|
||||||
ssh_node_f(i, false, "echo \"UNINSTALL PLUGIN validate_password\" | sudo mysql -uroot -p'%s'", tmp_pass);
|
ssh_node_f(i, false, "echo \"UNINSTALL PLUGIN validate_password\" | sudo mysql -uroot -p'%s'", tmp_pass);
|
||||||
ssh_node(i, stop_db_command[i], true);
|
ssh_node(i, stop_db_command[i], true);
|
||||||
@ -1465,13 +1468,13 @@ void Mariadb_nodes::replicate_from(int slave, int master, const char* type)
|
|||||||
{
|
{
|
||||||
std::stringstream change_master;
|
std::stringstream change_master;
|
||||||
change_master << "CHANGE MASTER TO MASTER_HOST = '" << IP[master]
|
change_master << "CHANGE MASTER TO MASTER_HOST = '" << IP[master]
|
||||||
<< "', MASTER_PORT = " << port[master] << ", MASTER_USE_GTID = " << type << ", "
|
<< "', MASTER_PORT = " << port[master] << ", MASTER_USE_GTID = " << type << ", "
|
||||||
"MASTER_USER='repl', MASTER_PASSWORD='repl';";
|
"MASTER_USER='repl', MASTER_PASSWORD='repl';";
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
{
|
{
|
||||||
std::cout << "Server " << slave + 1 << " starting to replicate from server " << master + 1 << std::endl;
|
std::cout << "Server " << slave + 1 << " starting to replicate from server " << master + 1 << std::endl;
|
||||||
std::cout << "Query is '" << change_master.str() << "'" << std::endl;
|
std::cout << "Query is '" << change_master.str() << "'" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
execute_query(nodes[slave], "STOP SLAVE;");
|
execute_query(nodes[slave], "STOP SLAVE;");
|
||||||
|
@ -1793,6 +1793,7 @@ static void parsing_info_done(void* ptr)
|
|||||||
free(field.table);
|
free(field.table);
|
||||||
free(field.column);
|
free(field.column);
|
||||||
}
|
}
|
||||||
|
free(fi.fields);
|
||||||
}
|
}
|
||||||
free(pi->function_infos);
|
free(pi->function_infos);
|
||||||
|
|
||||||
|
@ -629,7 +629,7 @@ columnid(A) ::= nm(X). {
|
|||||||
PREVIOUS
|
PREVIOUS
|
||||||
QUICK
|
QUICK
|
||||||
RAISE RECURSIVE /*REINDEX*/ RELEASE /*RENAME*/ /*REPLACE*/ RESTRICT ROLLBACK ROLLUP ROW
|
RAISE RECURSIVE /*REINDEX*/ RELEASE /*RENAME*/ /*REPLACE*/ RESTRICT ROLLBACK ROLLUP ROW
|
||||||
SAVEPOINT SELECT_OPTIONS_KW /*SEQUENCE*/ SLAVE /*START*/ STATUS
|
SAVEPOINT SELECT_OPTIONS_KW /*SEQUENCE*/ SLAVE /*START*/ STATEMENT STATUS
|
||||||
TABLES TEMP TEMPTABLE /*TRIGGER*/
|
TABLES TEMP TEMPTABLE /*TRIGGER*/
|
||||||
/*TRUNCATE*/
|
/*TRUNCATE*/
|
||||||
// TODO: UNSIGNED is a reserved word and should not automatically convert into an identifer.
|
// TODO: UNSIGNED is a reserved word and should not automatically convert into an identifer.
|
||||||
@ -3157,6 +3157,14 @@ cmd ::= SET set_scope(X) TRANSACTION transaction_characteristics. {
|
|||||||
maxscaleSet(pParse, X, MXS_SET_TRANSACTION, 0);
|
maxscaleSet(pParse, X, MXS_SET_TRANSACTION, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cmd ::= SET STATEMENT variable_assignments(X) FOR cmd. {
|
||||||
|
// The parsing of cmd will cause the relevant maxscale-callback to
|
||||||
|
// be called, so we neither need to call it here, nor free cmd (as
|
||||||
|
// it will be freed by that callback). The variable definitions we
|
||||||
|
// just throw away, as they are of no interest.
|
||||||
|
sqlite3ExprListDelete(pParse->db, X);
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////// The USE statement ////////////////////////////////////
|
//////////////////////// The USE statement ////////////////////////////////////
|
||||||
//
|
//
|
||||||
cmd ::= use(X). {
|
cmd ::= use(X). {
|
||||||
|
@ -442,6 +442,7 @@ static Keyword aKeywordTable[] = {
|
|||||||
{ "SET", "TK_SET", ALWAYS },
|
{ "SET", "TK_SET", ALWAYS },
|
||||||
#ifdef MAXSCALE
|
#ifdef MAXSCALE
|
||||||
{ "START", "TK_START", ALWAYS },
|
{ "START", "TK_START", ALWAYS },
|
||||||
|
{ "STATEMENT", "TK_STATEMENT", ALWAYS },
|
||||||
{ "STATUS", "TK_STATUS", ALWAYS },
|
{ "STATUS", "TK_STATUS", ALWAYS },
|
||||||
{ "STRAIGHT_JOIN", "TK_STRAIGHT_JOIN",ALWAYS },
|
{ "STRAIGHT_JOIN", "TK_STRAIGHT_JOIN",ALWAYS },
|
||||||
#endif
|
#endif
|
||||||
|
@ -106,3 +106,6 @@ CALL p1((SELECT f1()), ?);
|
|||||||
|
|
||||||
# MXS-1829
|
# MXS-1829
|
||||||
SELECT PREVIOUS VALUE FOR SEQ;
|
SELECT PREVIOUS VALUE FOR SEQ;
|
||||||
|
|
||||||
|
# MXS-1874
|
||||||
|
SET STATEMENT max_statement_time=30 FOR SELECT seq FROM seq_0_to_100000;
|
Reference in New Issue
Block a user