~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/suite/transaction_log/t/replace.inc

Added code necessary for building plugins dynamically.
Merged in changes from lifeless to allow autoreconf to work.
Touching plugin.ini files now triggers a rebuid - so config/autorun.sh is no
longer required to be run after touching those.
Removed the duplicate plugin names - also removed the issue that getting them
different would silently fail weirdly later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# Simple test of the transaction log for testing REPLACE command 
 
3
 
4
# We create a table then fill it with a few records and then
 
5
# issue a few REPLACE statements on it.
 
6
#
 
7
 
 
8
--disable_warnings
 
9
DROP TABLE IF EXISTS t1, t2;
 
10
--enable_warnings
 
11
 
 
12
CREATE TABLE t1 (
 
13
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
 
14
, padding VARCHAR(200) NOT NULL
 
15
) ENGINE=InnoDB;
 
16
 
 
17
INSERT INTO t1 VALUES (1, "I love testing.");
 
18
INSERT INTO t1 VALUES (2, "I hate testing.");
 
19
 
 
20
# This will actually execute an UPDATE for InnoDB, 
 
21
# as this is an optimized scenario that can have the
 
22
# REPLACE INTO converted into an INSERT ... ON DUPLICATE
 
23
# KEY UPDATE.
 
24
 
 
25
REPLACE INTO t1 VALUE (2, "I love testing.");
 
26
 
 
27
DROP TABLE t1;
 
28
 
 
29
CREATE TABLE t1 (
 
30
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
 
31
, padding VARCHAR(200) NOT NULL
 
32
) ENGINE=InnoDB;
 
33
CREATE TABLE t2 (
 
34
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY
 
35
, fk_id INT NOT NULL
 
36
, CONSTRAINT fk_t1 FOREIGN KEY (fk_id) REFERENCES t1 (id) ON DELETE CASCADE
 
37
) ENGINE=InnoDB;
 
38
 
 
39
INSERT INTO t1 VALUES (1, "I love testing.");
 
40
INSERT INTO t1 VALUES (2, "I hate testing.");
 
41
 
 
42
# Should delete original and insert a new one
 
43
# with a different "padding" column value...
 
44
 
 
45
REPLACE INTO t1 VALUE (2, "I love testing.");
 
46
 
 
47
DROP TABLE t2, t1;