sriram patil <spsrirampatil@gmail.com> writes:
> In case of CREATE VIEW (method: mysql_create_view file: sql/sql_view.cc),
> while the bin logging is skipped for most of the errors by jumping to "err"
> label, it is not skipped in following code snippet (line number: 616)
>
> res= mysql_register_view(thd, view, mode);
> If an error occurs in mysql_register_view, e.g. ER_OUT_OF_RESOURCES,Looks like a bug to me.
> ER_TABLE_EXISTS_ERROR, etc. the query is still logged.
>
> Is there a specific reason why it is logged even though an error occurs? Or
> is it a bug?
If you want to verify it, you can make a test case in the following way:
1. Add a DBUG_EXECUTE_IF("simulate_register_view_failure") that causes
mysql_register_view to return an error.
2. Create a test case with master-slave replication that sets
simulate_register_view_failure in @@debug_dbug and attempts to create the view
on the master.
3. If the bug is as it looks from the code and from your explanation, we
should see that the view is missing from the master, but present on the slave.
- Kristian.