mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
aebb1038aa
multi-update was setting up read_set/vcol_set in multi_update::initialize_tables() that is invoked after the optimizer (JOIN::optimize_inner()). But some rows - if they're from const tables - will be read already in the optimizer, and these rows will not have all necessary column/vcol values. * multi_update::initialize_tables() uses results from the optimizer and cannot be moved to be called earlier. * multi_update::prepare() is called before the optimizer, but it cannot set up read_set/vcol_set, because the optimizer might reset them (see SELECT_LEX::update_used_tables()). As a fix I've added a new method, select_result::prepare_to_read_rows(), it's called from inside the optimizer just before make_join_statistics().
25 lines
760 B
Text
25 lines
760 B
Text
connect master,127.0.0.1,root,,test,$MASTER_MYPORT,;
|
|
connect slave,127.0.0.1,root,,test,$SLAVE_MYPORT,;
|
|
connection master;
|
|
CREATE DATABASE federated;
|
|
connection slave;
|
|
CREATE DATABASE federated;
|
|
connection slave;
|
|
create table federated.t1 (a int, b int, unique key (a), key (b));
|
|
connection master;
|
|
create table t1 (a int, b int, unique key (a), key (b))
|
|
engine=federated CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/federated/t1';
|
|
insert into t1 values (3, 3), (7, 7);
|
|
delete t1 from t1 where a = 3;
|
|
select * from t1;
|
|
a b
|
|
7 7
|
|
drop table t1;
|
|
connection slave;
|
|
connection default;
|
|
connection master;
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
DROP DATABASE IF EXISTS federated;
|
|
connection slave;
|
|
DROP TABLE IF EXISTS federated.t1;
|
|
DROP DATABASE IF EXISTS federated;
|