2
# Simple test of the serial event log for UPDATE statements
4
# We create a table and insert some records
5
# into it. We then update the table.
10
DROP TABLE IF EXISTS t1;
15
, padding VARCHAR(200) NOT NULL
19
INSERT INTO t1 VALUES (1, "I love testing.");
20
INSERT INTO t1 VALUES (2, "I hate testing.");
23
UPDATE t1 SET padding= "XXX" WHERE id= 1;
25
# UPDATE all records in table
26
UPDATE t1 SET padding= "AAA";
30
# Test for LP Bug#440141:
32
# Replication generates incorrect update commands when
33
# where clause uses a field contained in set clause
36
id int AUTO_INCREMENT NOT NULL PRIMARY KEY
41
INSERT INTO t1 (name,alias) VALUES ("jeff lebowski","dude");
43
UPDATE t1 SET alias = "the dude" WHERE alias = "dude";
47
# Tests UPDATE statement which changes an existing row
48
# by referencing the changed field.
52
, counter INT NOT NULL
56
INSERT INTO t1 (id, counter) VALUES (1,1),(2,2),(3,3);
58
UPDATE t1 SET counter = counter + 1 WHERE id = 1;
59
UPDATE t1 SET counter = counter + 1 WHERE id IN (2,3);
63
# Test for updating a primary key value
64
# in an UPDATE statement. LP Bug#480710
68
, padding VARCHAR(200) NOT NULL
72
INSERT INTO t1 VALUES (1, "I love testing.");
73
INSERT INTO t1 VALUES (2, "I hate testing.");
75
UPDATE t1 SET id = 4 WHERE id = 2;