# QAN fails on explain

**URL:** <https://forums.percona.com/t/qan-fails-on-explain/11257>\
**Category:** PMM 2.x\
**Created:** [July 8, 2021, 12:42am UTC](https://forums.percona.com/t/qan-fails-on-explain/11257 "2021-07-08T00:42:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dopessoa](https://avatars.discourse-cdn.com/v4/letter/d/65b543/32.png) [@dopessoa](https://forums.percona.com/u/dopessoa)\
**Post date:** [July 8, 2021, 12:42am UTC](https://forums.percona.com/t/qan-fails-on-explain/11257/1 "2021-07-08T00:42:24Z")

</div>

Hi, we have a situation where some queries fail when requesting and explain of them in QAN.

The errors can be categorized in two groups:

> Error 1046: No database selected

Example of failing query:

```auto
select
  *
from
  table
where
  arbitrary_no = '11111111'

```

And

> Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '‘1111111 …’ at line 1

For some queries like this: (with a very long in clause)

```auto
SELECT
  id
FROM
  table
WHERE id in(
    '5522555',
    '2224452',
    '3444434',
    '5544223',
    '5653343',
    '111 ...

```

We are currently running PMM 2.15.1.

How can we get those queries having their explain working on QAN?

---

<div class="post-metadata">

**Author:** ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)\
**Post date:** [July 13, 2021, 1:49am UTC](https://forums.percona.com/t/qan-fails-on-explain/11257/2 "2021-07-13T01:49:20Z")

</div>

Hi @dopessoa!

Can you check if these reports help you with these questions?

[https://jira.percona.com/browse/PMM-4832](https://jira.percona.com/browse/PMM-4832)  
[https://jira.percona.com/browse/PMM-1899](https://jira.percona.com/browse/PMM-1899)

Best,  
Agustín.
