MySQL Forums
Forum List  »  Triggers

Re: Server crashes
Posted by: Paul McArdle
Date: June 29, 2005 12:20AM

works ok for me on 5.0.7-beta
red hat 9

create table a ( a int(4), b varchar(4) );
Query OK, 0 rows affected (0.00 sec)

delimiter //
mysql> create trigger a_bfu before update on a FOR EACH ROW
-> begin
-> if new.a <> OLD.a THEN
-> set NEW.b = 'c';
-> end if;
-> end
-> //
Query OK, 0 rows affected (0.03 sec)

insert into a values( 1, 'a');
-> //
Query OK, 1 row affected (0.00 sec)

mysql> select * from a //
+------+------+
| a | b |
+------+------+
| 1 | a |
+------+------+
1 row in set (0.00 sec)

mysql> update a set a = 2 where a = 1//
Query OK, 1 row affected (0.01 sec)
Rows matched: 1 Changed: 1 Warnings: 0

mysql> select * from a //
+------+------+
| a | b |
+------+------+
| 2 | c |
+------+------+
1 row in set (0.00 sec)

mysql> select version()//
+---------------------+
| version() |
+---------------------+
| 5.0.7-beta-standard |
+---------------------+

Options: ReplyQuote


Subject
Views
Written By
Posted
3263
May 29, 2005 12:04PM
2329
May 29, 2005 03:08PM
2260
June 01, 2005 01:12AM
Re: Server crashes
2221
June 29, 2005 12:20AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.