What are the values of columns which are not set i

2019-09-17 10:27发布

问题:

According to MySQL

In a before update trigger there are two mysql extensions viz NEW and OLD to refer to the old and new column values of the updating row.

Say, my table is :

            create table foo ( id primary key auto_increment,
                           fname varchar(10),
                           lname varchar(10) 
                         );

And I have inserted 1 row:

            insert into foo (fname,lname) values ("Edam","Chuti");

If I run an update like :

            update foo set fname="Edam1" where id=1;

Then in my before update trigger for this table what will be the values of :

            NEW.fname=?
            NEW.lname=?