~ubuntu-branches/ubuntu/precise/mysql-5.1/precise

« back to all changes in this revision

Viewing changes to mysql-test/r/trigger.result

  • Committer: Bazaar Package Importer
  • Author(s): Norbert Tretkowski
  • Date: 2010-05-11 18:47:32 UTC
  • mto: (2.1.2 sid) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100511184732-jhn055kfhxze24kt
Tags: upstream-5.1.46
ImportĀ upstreamĀ versionĀ 5.1.46

Show diffs side-by-side

added added

removed removed

Lines of Context:
2087
2087
SELECT * FROM t2;
2088
2088
a       b
2089
2089
DROP TABLE t1, t2;
 
2090
#
 
2091
# Bug#51650 crash with user variables and triggers
 
2092
#
 
2093
DROP TRIGGER IF EXISTS trg1;
 
2094
DROP TABLE IF EXISTS t1, t2;
 
2095
CREATE TABLE t1 (b VARCHAR(50) NOT NULL);
 
2096
CREATE TABLE t2 (a VARCHAR(10) NOT NULL DEFAULT '');
 
2097
CREATE TRIGGER trg1 AFTER INSERT ON t2
 
2098
FOR EACH ROW BEGIN
 
2099
SELECT 1 FROM t1 c WHERE
 
2100
(@bug51650 IS NULL OR @bug51650 != c.b) AND c.b = NEW.a LIMIT 1 INTO @foo;
 
2101
END//
 
2102
SET @bug51650 = 1;
 
2103
INSERT IGNORE INTO t2 VALUES();
 
2104
Warnings:
 
2105
Warning 1329    No data - zero rows fetched, selected, or processed
 
2106
INSERT IGNORE INTO t1 SET b = '777';
 
2107
INSERT IGNORE INTO t2 SET a = '111';
 
2108
Warnings:
 
2109
Warning 1329    No data - zero rows fetched, selected, or processed
 
2110
SET @bug51650 = 1;
 
2111
INSERT IGNORE INTO t2 SET a = '777';
 
2112
DROP TRIGGER trg1;
 
2113
DROP TABLE t1, t2;
 
2114
CREATE TABLE t1 (id INT NOT NULL);
 
2115
CREATE TABLE t2 (id INT NOT NULL);
 
2116
INSERT t1 VALUES (1),(2),(3);
 
2117
UPDATE t1 SET id=NULL;
 
2118
Warnings:
 
2119
Warning 1048    Column 'id' cannot be null
 
2120
Warning 1048    Column 'id' cannot be null
 
2121
Warning 1048    Column 'id' cannot be null
 
2122
CREATE TRIGGER t1_bu BEFORE UPDATE ON t1 FOR EACH ROW
 
2123
INSERT INTO t2 VALUES (3);
 
2124
UPDATE t1 SET id=NULL;
 
2125
Warnings:
 
2126
Warning 1048    Column 'id' cannot be null
 
2127
Warning 1048    Column 'id' cannot be null
 
2128
Warning 1048    Column 'id' cannot be null
 
2129
DROP TRIGGER t1_bu;
 
2130
DROP TABLE t1,t2;
2090
2131
End of 5.1 tests.