use strict; use DBI; my $connstr = 'dbi:mysql:port=9306;host=127.0.0.1'; my $user = 'root'; { my $dbh1 = DBI->connect($connstr, $user); $dbh1->do("CREATE DATABASE IF NOT EXISTS test"); $dbh1->do("USE test"); $dbh1->do("DROP TABLE IF EXISTS t1"); $dbh1->do("DROP TABLE IF EXISTS t2"); $dbh1->do("CREATE TABLE IF NOT EXISTS t1 (f1 integer not null auto_increment, primary key (f1)) ENGINE = Falcon;"); $dbh1->do("CREATE TABLE IF NOT EXISTS t2 (f2 integer not null auto_increment, primary key (f2)) ENGINE = Falcon;"); $dbh1->do("CREATE OR REPLACE ALGORITHM = Merge VIEW v21 (f1, f2) AS SELECT * FROM t2 LEFT JOIN t1 ON (f2 = f1) ORDER BY f1 DESC;"); $dbh1->disconnect(); } fork(); fork(); use strict; use DBI; my $dbh2 = DBI->connect($connstr, $user); foreach my $i (1..1000) { $dbh2->do("USE test"); $dbh2->do("INSERT IGNORE INTO t2 (f2) VALUES (1);"); $dbh2->do("UPDATE v21 AS a SET a.f1 = a.f1 + 20;"); }