Bug #10411 | A trigger behaves incorrectly if a column that it alters is not available. | ||
---|---|---|---|
Submitted: | 6 May 2005 11:54 | Modified: | 19 May 2005 18:29 |
Reporter: | Disha | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S2 (Serious) |
Version: | 5.0.4 Beta | OS: | Windows (Windows 2003) |
Assigned to: | Dmitry Lenev | CPU Architecture: | Any |
[6 May 2005 11:54]
Disha
[19 May 2005 18:29]
Dmitry Lenev
Hi! What you are observing is not a bug. This is expected behavior. NEW and OLD transition variables accessible in triggers represent new and old versions of rows being updated (inserted or deleted). This behavior documented in our manual at in chapter "20.3. Using Triggers" http://dev.mysql.com/doc/mysql/en/using-triggers.html) and is consistenet with SQL standard. In your case when update statement will invoke before trigger initial value of NEW transition variable will be ('NEW', 'BB') (since NEW represent new full version of row being updated, and not array of fields explicitly set in UPDATE statement). So naturally the final version of row which will be stored in table is ('NEWADDED TEXT', 'BBADDED TEXT'). And this is exactly what you observe.