Hi, Holyfoot! On Jan 31, holyfoot@askmonty.org wrote:
revno: 4029 revision-id: holyfoot@askmonty.org-20140131103303-1rx7ielo83f8iahe parent: holyfoot@askmonty.org-20140124020722-dd5twtwlcc8o1xiy committer: Alexey Botchkov <holyfoot@askmonty.org> branch nick: mdev-4856 timestamp: Fri 2014-01-31 14:33:03 +0400 message: MDEV-4856 SQL_ERROR_LOG shows 1146 errors which didnt appear in mysql client. The fill_schema_table() function used to call get_table_share() for a table name in WHERE then clear the error list. That way plugins receive the superfluous error notification if it happens in it. Also the problem was that error handler didn't prevent the suppressed error message from logging anyway as the logging happens in THD::raise_condition before the handler call. Fixed by adding the No_table_error_handler before the call. raise_condition() also fixed.
=== modified file 'sql/sql_class.cc' --- a/sql/sql_class.cc 2014-01-23 18:21:02 +0000 +++ b/sql/sql_class.cc 2014-01-31 10:33:03 +0000 @@ -1145,7 +1145,6 @@ MYSQL_ERROR* THD::raise_condition(uint s got_warning= 1; break; case MYSQL_ERROR::WARN_LEVEL_ERROR: - mysql_audit_general(this, MYSQL_AUDIT_GENERAL_ERROR, sql_errno, msg); break; default: DBUG_ASSERT(FALSE); @@ -1156,6 +1155,8 @@ MYSQL_ERROR* THD::raise_condition(uint s
if (level == MYSQL_ERROR::WARN_LEVEL_ERROR) { + mysql_audit_general(this, MYSQL_AUDIT_GENERAL_ERROR, sql_errno, msg); +
This is good.
=== modified file 'sql/sql_show.cc' --- a/sql/sql_show.cc 2013-11-19 12:16:25 +0000 +++ b/sql/sql_show.cc 2014-01-31 10:33:03 +0000 @@ -4199,8 +4199,13 @@ static int fill_schema_table_from_frm(TH key_length= create_table_def_key(thd, key, &table_list, 0); hash_value= my_calc_hash(&table_def_cache, (uchar*) key, key_length); mysql_mutex_lock(&LOCK_open); - share= get_table_share(thd, &table_list, key, - key_length, OPEN_VIEW, ¬_used, hash_value); + { + No_such_table_error_handler no_such_table_handler; + thd->push_internal_handler(&no_such_table_handler); + share= get_table_share(thd, &table_list, key, + key_length, OPEN_VIEW, ¬_used, hash_value); + thd->pop_internal_handler(); + }
But I don't understand that. Do you mean, old code did *not* suppress errors here? How could selects from I_S tables work without it? Regards, Sergei