DB prefix issue with same domain but different extension

Not sure if anyone else has had this issue or it’s a bug.
OS Ubuntu 18.04 LTS
Fresh install today

Only VPS I have with the same domain with different extension

I have a few domains with the same domain name but different extensions. one a testing site and other live site which use databases.

I will use example as an example domain
example.com and example.shop

The prefix assigned example.com is exa when the database is created,
this database is called db1906 (exa_db1906)

Now I create a database for example.shop called production and it is added,
I go to list databases under example.shop and nothing is showing.

I look under example.com and it is listed there as exa_production instead of under example.shop.

so if you have the same domain with different extensions on the same install the same prefix is used. the first domain added is assigned the prefix.

Is there any way to have own input in database fields?