Skip to content

Column names when using SHOW TABLES #319

@swissspidy

Description

@swissspidy

In WP-CLI we have a helper function to list database tables for the current WordPress install or a specific site within the multisite network.

There, we use the following query which seems to cause different results in MySQL vs SQLite:

https://github.com/wp-cli/wp-cli/blob/a8fba6e5d8ce9fca3150cdd4306b9a30a6ee18d0/php/utils-wp.php#L543

Specifically, column names don't appear to be prefixed with Tables_in_, which means the WHERE clause won't work in SQLite.

My current workaround is to do remove the WHERE clause and do the filtering in PHP instead, see wp-cli/wp-cli#6235

Just wanted to raise this in case it's an issue, but perhaps I'm simply missing something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions