Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
409dd25e
Commit
409dd25e
authored
Mar 16, 2007
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge moonbone.local:/mnt/gentoo64/work/27006-bug-5.0-opt-mysql
into moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql
parents
5233a2a5
e84584e2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
79 additions
and
0 deletions
+79
-0
mysql-test/r/trigger.result
mysql-test/r/trigger.result
+41
-0
mysql-test/t/trigger.test
mysql-test/t/trigger.test
+38
-0
No files found.
mysql-test/r/trigger.result
View file @
409dd25e
...
...
@@ -1372,4 +1372,45 @@ INSERT INTO bug22580_t1 VALUES (1,1);
DROP TABLE bug22580_t1;
DROP PROCEDURE bug22580_proc_1;
DROP PROCEDURE bug22580_proc_2;
DROP TRIGGER IF EXISTS trg27006_a_update;
DROP TRIGGER IF EXISTS trg27006_a_insert;
CREATE TABLE t1 (
`id` int(10) unsigned NOT NULL auto_increment,
`val` varchar(10) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE t2 like t1;
CREATE TRIGGER trg27006_a_insert AFTER INSERT ON t1 FOR EACH ROW
BEGIN
insert into t2 values (NULL,new.val);
END |
CREATE TRIGGER trg27006_a_update AFTER UPDATE ON t1 FOR EACH ROW
BEGIN
insert into t2 values (NULL,new.val);
END |
INSERT INTO t1(val) VALUES ('test1'),('test2');
SELECT * FROM t1;
id val
1 test1
2 test2
SELECT * FROM t2;
id val
1 test1
2 test2
INSERT INTO t1 VALUES (2,'test2') ON DUPLICATE KEY UPDATE val=VALUES(val);
INSERT INTO t1 VALUES (3,'test3') ON DUPLICATE KEY UPDATE val=VALUES(val);
SELECT * FROM t1;
id val
1 test1
2 test2
3 test3
SELECT * FROM t2;
id val
1 test1
2 test2
3 test2
4 test3
DROP TRIGGER trg27006_a_insert;
DROP TRIGGER trg27006_a_update;
drop table t1,t2;
End of 5.0 tests
mysql-test/t/trigger.test
View file @
409dd25e
...
...
@@ -1699,4 +1699,42 @@ DROP TABLE bug22580_t1;
DROP
PROCEDURE
bug22580_proc_1
;
DROP
PROCEDURE
bug22580_proc_2
;
#
# Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY
# UPDATE if the row wasn't actually changed.
#
--
disable_warnings
DROP
TRIGGER
IF
EXISTS
trg27006_a_update
;
DROP
TRIGGER
IF
EXISTS
trg27006_a_insert
;
--
enable_warnings
CREATE
TABLE
t1
(
`id`
int
(
10
)
unsigned
NOT
NULL
auto_increment
,
`val`
varchar
(
10
)
NOT
NULL
,
PRIMARY
KEY
(
`id`
)
);
CREATE
TABLE
t2
like
t1
;
DELIMITER
|
;
CREATE
TRIGGER
trg27006_a_insert
AFTER
INSERT
ON
t1
FOR
EACH
ROW
BEGIN
insert
into
t2
values
(
NULL
,
new
.
val
);
END
|
CREATE
TRIGGER
trg27006_a_update
AFTER
UPDATE
ON
t1
FOR
EACH
ROW
BEGIN
insert
into
t2
values
(
NULL
,
new
.
val
);
END
|
DELIMITER
;
|
INSERT
INTO
t1
(
val
)
VALUES
(
'test1'
),(
'test2'
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t2
;
INSERT
INTO
t1
VALUES
(
2
,
'test2'
)
ON
DUPLICATE
KEY
UPDATE
val
=
VALUES
(
val
);
INSERT
INTO
t1
VALUES
(
3
,
'test3'
)
ON
DUPLICATE
KEY
UPDATE
val
=
VALUES
(
val
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t2
;
DROP
TRIGGER
trg27006_a_insert
;
DROP
TRIGGER
trg27006_a_update
;
drop
table
t1
,
t2
;
--
echo
End
of
5.0
tests
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment