1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Merge branch '5.5-galera' into 10.0-galera

This commit is contained in:
Nirbhay Choubey
2015-06-02 13:27:39 -04:00
4 changed files with 61 additions and 10 deletions

View File

@ -24,5 +24,36 @@ SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
# MDEV-7673: CREATE TABLE SELECT fails on Galera cluster # MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
# #
CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i; 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; 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 # End of tests

View File

@ -25,10 +25,34 @@ SET @@GLOBAL.wsrep_forced_binlog_format=@wsrep_forced_binlog_format_saved;
--echo # --echo #
--echo # MDEV-7673: CREATE TABLE SELECT fails on Galera cluster --echo # MDEV-7673: CREATE TABLE SELECT fails on Galera cluster
--echo # --echo #
--connection node_1
CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i; CREATE TABLE t1 (i INT) ENGINE=INNODB DEFAULT CHARSET=utf8 SELECT 1 as i;
SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
# Cleanup # Cleanup
DROP TABLE t1; 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 --echo # End of tests

View File

@ -4966,8 +4966,6 @@ static int init_server_components()
} }
#endif #endif
DBUG_ASSERT(!opt_bin_log || opt_bin_logname);
if (opt_bin_log) if (opt_bin_log)
{ {
/* Reports an error and aborts, if the --log-bin's path /* 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 set_ports(); // this is also called in network_init() later but we need
// to know mysqld_port now - lp:1071882 // 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); wsrep_init_startup(true);
} }
} }

View File

@ -3301,17 +3301,10 @@ case SQLCOM_PREPARE:
/* Store reference to table in case of LOCK TABLES */ /* Store reference to table in case of LOCK TABLES */
create_info.table= create_table->table; 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 select_create is currently not re-execution friendly and
needs to be created for every execution of a PS/SP. 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, if ((result= new select_create(create_table,
&create_info, &create_info,