In MySQL, we can use the IGNORE
clause in statements that change data in order to ignore certain errors that might occur had we not used it. When IGNORE
is used, such errors are downgraded to warnings.
For example, we can use IGNORE
in an INSERT
statement to ignore any errors we might normally get if we tried to insert a NULL
value into a NOT NULL
column. In such a case, MySQL won’t return an error. Instead, it will deal with the issue in another way, and provide us with a warning.
If we have strict mode enabled, we can use IGNORE
to force MySQL to act as though strict mode is disabled. However, IGNORE
can also be used to downgrade certain errors regardless of the strict mode setting.
Continue reading →