Commit 6d5b723b authored by Nirbhay Choubey's avatar Nirbhay Choubey

Merge branch '5.5-galera' into 10.0-galera

parents 3eb8bc01 9eff9ed5
......@@ -24,5 +24,36 @@ SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
# MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
#
CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i;
SELECT * FROM t1;
i
1
SELECT * FROM t1;
i
1
DROP TABLE t1;
#
# MDEV-8166 : Adding index on new table from select crashes Galera
# cluster
#
CREATE TABLE t1(i int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1(i) VALUES (1), (2), (3);
CREATE TABLE t2 (i INT) SELECT i FROM t1;
ALTER TABLE t2 ADD INDEX idx(i);
SELECT * FROM t2;
i
1
2
3
SELECT * FROM t2;
i
1
2
3
SHOW CREATE TABLE t2;
Table Create Table
t2 CREATE TABLE `t2` (
`i` int(11) DEFAULT NULL,
KEY `idx` (`i`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1, t2;
# End of tests
......@@ -25,10 +25,34 @@ SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
--echo #
--echo # MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
--echo #
--connection node_1
CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i;
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
# Cleanup
DROP TABLE t1;
--echo #
--echo # MDEV-8166 : Adding index on new table from select crashes Galera
--echo # cluster
--echo #
--connection node_1
CREATE TABLE t1(i int(11) NOT NULL DEFAULT '0') ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO t1(i) VALUES (1), (2), (3);
CREATE TABLE t2 (i INT) SELECT i FROM t1;
ALTER TABLE t2 ADD INDEX idx(i);
SELECT * FROM t2;
--connection node_2
SELECT * FROM t2;
SHOW CREATE TABLE t2;
# Cleanup
DROP TABLE t1, t2;
--echo # End of tests
......@@ -4966,8 +4966,6 @@ static int init_server_components()
}
#endif
DBUG_ASSERT(!opt_bin_log || opt_bin_logname);
if (opt_bin_log)
{
/* Reports an error and aborts, if the --log-bin's path
......@@ -5052,6 +5050,11 @@ static int init_server_components()
{
set_ports(); // this is also called in network_init() later but we need
// to know mysqld_port now - lp:1071882
/*
Plugin initialization (plugin_init()) hasn't happened yet, set
maria_hton to 0.
*/
maria_hton= 0;
wsrep_init_startup(true);
}
}
......
......@@ -3301,17 +3301,10 @@ case SQLCOM_PREPARE:
/* Store reference to table in case of LOCK TABLES */
create_info.table= create_table->table;
#ifdef WITH_WSREP
if (WSREP(thd) &&
(!thd->is_current_stmt_binlog_format_row() ||
!(create_info.tmp_table())))
WSREP_TO_ISOLATION_BEGIN(create_table->db, create_table->table_name,
NULL)
#endif
/*
select_create is currently not re-execution friendly and
needs to be created for every execution of a PS/SP.
Note: In wsrep-patch, CTAS is handled like a regular transaction.
*/
if ((result= new select_create(create_table,
&create_info,
......
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