Hi, Sergey! On Jul 22, Sergey Vojtovich wrote:
There are also additional checks that would prevent dropping P_S database if there are non-PFS tables/views/events/routines. Should we abandon these checks too?
I'm not sure. P_S doesn't allow anyone to create table in the P_S database. But yes, one can copy files manually. So, the options are
1. db is not needed, don't preserve files: DROP DATABASE IF EXISTS performance_schema 2. db is needed, don't preserve files: DROP DATABASE IF EXISTS performance_schema CREATE DATABASE performance_schema 3. preserve files: CREATE DATABASE IF NOT EXISTS performance_schema
Either way, there's no need to do any IF's and checks.
I tend to agree, it's better to preserve user's files (and other objects) in P_S. Then what about:
4. db is not needed, but preserve files:
- nothing -
That's fine too.
5. db is not needed, preserve files, but drop database if there are no user files:
IF-s and then DROP DATABASE IF EXISTS performance_schema
I wouldn't bother - too complicated. But it's up to you. Regards, Sergei