# Table not found error

**URL:** <https://forums.percona.com/t/table-not-found-error/7029>\
**Category:** Percona Toolkit\
**Created:** [May 23, 2019, 4:36am UTC](https://forums.percona.com/t/table-not-found-error/7029 "2019-05-23T04:36:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sazzabi](https://avatars.discourse-cdn.com/v4/letter/s/b3f665/32.png) [@sazzabi](https://forums.percona.com/u/sazzabi)\
**Post date:** [May 23, 2019, 4:36am UTC](https://forums.percona.com/t/table-not-found-error/7029/1 "2019-05-23T04:36:12Z")

</div>

Hi,

We’re testing pt-online-schema-change to use it in production environment, and some of the tests fails due to “Base table or view not found”.

For testing purpose, I made a Symfony command that does "insert into " in an infinite loop, and another Symfony command that does a "select from " in loop. In parallel, I run pt-online-schema-changes to alter a table and add a new column. But when pt tries te swap the tables, in a very brief moment, the table does not exist, and my commands fails.

This tests simulates the same case that happened on the preproduction environment, were in a very brief moment, neither the readers nor the writers could access the table.

Here is the command I used for the reader command (nothing special) runs with Doctrine:

```auto
SELECT * FROM `demo` ORDER BY id limit 1;

```

and here is the command that inserts in loop :

```auto
INSERT INTO `demo`(name) values ('a random string each time');

```

and here is the pt-online-schema-changes command that runs while the reader and the writer are looping :

```auto
pt-online-schema-change --alter="ADD name_1 VARCHAR(250) DEFAULT NULL" D= ***,t=demo,h=127.0.0.1,u=root,P=3306 --alter-foreign-keys-method=auto --ask-pass --execute --check-slave-lag=h=*** ,u=root,P=3306 --max-lag=2 --nocheck-replication-filters

```

to mention, we have a master and 1 slave, all configures in Doctrine ORM.

How can I put all queries on hold while pt-online-schema-change is renaming the tables, so I don’t get this “Base table or view not found” error ?
