0

I'm not a developer but a system administrator,

I found this query SELECT * FROM bogus_table LIMIT 0\G in the MySQL-slow-query.log in the production server.

I asked the developer about this query and he has no idea where this query coming from.

Thank to this post i assume that SELECT * FROM bogus_table LIMIT 0\G is to clear the kill flag which mean this query will be trigger afterward if the previous query return an error.- correct me if i'm wrong.

So here my question: How do i find/trace what query that running is triggering this query to be executed afterward (Based on my above assumption) SELECT * FROM bogus_table LIMIT 0\G ?

Thank you.

8
  • Based on this bug report, this is seen when a user account does not have SELECT privileges for a table. If the application is not logging when/where SQL errors are being encountered, then you may need to run through user account permissions with SHOW GRANTS FOR 'user'@... to determine where the issue is coming from
    – matigo
    May 6 at 3:55
  • @matigo I didn't think so that the case, because the user had been granted ALL PRIVILEGES on that database, plus the Bogus table is never existed to begin with.
    – DagaReiN
    May 6 at 5:56
  • Is it possible that bogus_table is a (potentially a large) temporary table created in code? Have you searched the code repo? If you simply try to SELECT from a non-existent table, it'll fail instantly and won't reach the slow_query_log!
    – Vérace
    May 6 at 6:52
  • @Vérace No, it actually a SQL query that hard coded in the MySQL-driver and this query will trigger on certain circumstances. ref
    – DagaReiN
    May 6 at 14:59
  • 1
    Hmmm... looks like this is a C++ coding issue and not really a DBA one - it's just possible that someone here might know about this - but I think you'd be better off asking on the MySQL tool devel lists or similar?
    – Vérace
    May 6 at 15:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.