~ubuntu-branches/ubuntu/trusty/drizzle/trusty-updates

« back to all changes in this revision

Viewing changes to plugin/transaction_log/tests/t/update.inc

  • Committer: Package Import Robot
  • Author(s): Tobias Frost
  • Date: 2012-04-04 15:12:07 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20120404151207-xwsgn1xegslle4p0
Tags: 1:7.1.32-rc-1
* New upstream release.
* Plugin-filtered-replicator upstream removed and will no longer be built.
* Updating d/*install files to accommodate upstream changes from drizzle7
  to drizzle
* Added symlink in libdrizzledmessage-dev to library
* libdrizzle: soname-bump
* Rename package drizzle-plugin-performance-dictionary to shorten package name
  (due to linitan warning package-has-long-file-name)
* Debian/control: removed unused substitution variable ${shlibs:Depends} for
  -dbg and -dev packages

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
2
 
# Simple test of the serial event log for UPDATE statements
3
 
4
 
# We create a table and insert some records
5
 
# into it.  We then update the table.
6
 
7
 
#
8
 
 
9
 
--disable_warnings
10
 
DROP TABLE IF EXISTS t1;
11
 
--enable_warnings
12
 
 
13
 
CREATE TABLE t1 (
14
 
  id INT NOT NULL
15
 
, padding VARCHAR(200) NOT NULL
16
 
, PRIMARY KEY (id)
17
 
);
18
 
 
19
 
INSERT INTO t1 VALUES (1, "I love testing.");
20
 
INSERT INTO t1 VALUES (2, "I hate testing.");
21
 
 
22
 
# Simple PK update
23
 
UPDATE t1 SET padding= "XXX" WHERE id= 1;
24
 
 
25
 
# UPDATE all records in table
26
 
UPDATE t1 SET padding= "AAA";
27
 
 
28
 
DROP TABLE t1;
29
 
 
30
 
# Test for LP Bug#440141:
31
 
#
32
 
# Replication generates incorrect update commands when 
33
 
# where clause uses a field contained in set clause
34
 
#
35
 
CREATE TABLE t1 (
36
 
  id int AUTO_INCREMENT NOT NULL PRIMARY KEY
37
 
, name varchar(1024)
38
 
, alias varchar(1024)
39
 
);
40
 
 
41
 
INSERT INTO t1 (name,alias) VALUES ("jeff lebowski","dude");
42
 
 
43
 
UPDATE t1 SET alias = "the dude" WHERE alias = "dude";
44
 
 
45
 
DROP TABLE t1;
46
 
 
47
 
# Tests UPDATE statement which changes an existing row
48
 
# by referencing the changed field.
49
 
 
50
 
CREATE TABLE t1 (
51
 
  id INT NOT NULL
52
 
, counter INT NOT NULL
53
 
, PRIMARY KEY (id)
54
 
);
55
 
 
56
 
INSERT INTO t1 (id, counter) VALUES (1,1),(2,2),(3,3);
57
 
 
58
 
UPDATE t1 SET counter = counter + 1 WHERE id = 1;
59
 
UPDATE t1 SET counter = counter + 1 WHERE id IN (2,3);
60
 
 
61
 
DROP TABLE t1;
62
 
 
63
 
# Test for updating a primary key value
64
 
# in an UPDATE statement.  LP Bug#480710
65
 
 
66
 
CREATE TABLE t1 (
67
 
  id INT NOT NULL
68
 
, padding VARCHAR(200) NOT NULL
69
 
, PRIMARY KEY (id)
70
 
);
71
 
 
72
 
INSERT INTO t1 VALUES (1, "I love testing.");
73
 
INSERT INTO t1 VALUES (2, "I hate testing.");
74
 
 
75
 
UPDATE t1 SET id = 4 WHERE id = 2;
76
 
 
77
 
DROP TABLE t1;