Issue #3240601 by alexpott, daffie, daniel.bosen: The standard logic we use in ::ensureTableExists() is wrong