Schema::tableExists doesn't check schema

Created on 18 January 2022, almost 3 years ago
Updated 2 June 2023, over 1 year ago

Problem/Motivation

Schema::tableExists gets the prefix info for the target table, but does not check the schema when performing the select against INFORMATION_SCHEMA.TABLES, so if a table exists in the database on an alternate schema the function will return a false positive.

Proposed resolution

Add a table_schema = :schema condition to the where clause.

🐛 Bug report
Status

Fixed

Version

4.3

Component

Schema handling

Created by

🇬🇧United Kingdom pstewart

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024