00001 # 00002 # Simple test of the transaction log for INSERT ... 00003 # ON DUPLICATE KEY UPDATE statements 00004 # 00005 # We create a table and insert some records 00006 # into it. We then issue an INSERT ... ON DUPLICATE KEY UPDATE 00007 # statement which will affect an existing record. 00008 # 00009 # We then use the transaction_reader in plugin/transaction_log/utilities to read the events. 00010 # 00011 00012 --disable_warnings 00013 DROP TABLE IF EXISTS t1; 00014 --enable_warnings 00015 00016 CREATE TABLE t1 ( 00017 id INT NOT NULL AUTO_INCREMENT PRIMARY KEY 00018 , padding VARCHAR(200) NOT NULL 00019 ); 00020 00021 INSERT INTO t1 VALUES (1, "I love testing."); 00022 INSERT INTO t1 VALUES (2, "I hate testing."); 00023 00024 INSERT INTO t1 VALUES (2, "I love testing") 00025 ON DUPLICATE KEY UPDATE padding="I love testing"; 00026 00027 DROP TABLE t1;