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

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Monty Taylor
  • Date: 2010-03-18 12:12:31 UTC
  • Revision ID: james.westby@ubuntu.com-20100318121231-k6g1xe6cshbwa0f8
Tags: upstream-2010.03.1347
ImportĀ upstreamĀ versionĀ 2010.03.1347

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# Simple test of the transaction log for INSERT ...
 
3
# ON DUPLICATE KEY UPDATE statements
 
4
 
5
# We create a table and insert some records
 
6
# into it.  We then issue an INSERT ... ON DUPLICATE KEY UPDATE
 
7
# statement which will affect an existing record.
 
8
 
9
# We then use the transaction_reader in drizzled/message/ to read the events.
 
10
#
 
11
 
 
12
--disable_warnings
 
13
DROP TABLE IF EXISTS t1;
 
14
--enable_warnings
 
15
 
 
16
CREATE TABLE t1 (
 
17
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
 
18
, padding VARCHAR(200) NOT NULL
 
19
);
 
20
 
 
21
INSERT INTO t1 VALUES (1, "I love testing.");
 
22
INSERT INTO t1 VALUES (2, "I hate testing.");
 
23
 
 
24
INSERT INTO t1 VALUES (2, "I love testing")
 
25
ON DUPLICATE KEY UPDATE padding="I love testing";
 
26
 
 
27
DROP TABLE t1;