db_text: properly initialize memory when caching tables