Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed upgrade of lock table #808

Open
zpqrtbnk opened this issue Mar 18, 2024 · 1 comment
Open

Failed upgrade of lock table #808

zpqrtbnk opened this issue Mar 18, 2024 · 1 comment
Assignees

Comments

@zpqrtbnk
Copy link

In file plugins/payplug/src/Model/Lock.php method create_lock_table verifies whether the lock table has the id column with:

$result = $wpdb->get_row(
  $wpdb->prepare(
    "SELECT count(column_name) as column_exists FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = '{$wpdb->base_prefix}woocommerce_payplug_lock' AND column_name = %s ", ['id']
  )
);

Unfortunately that request totally ignore the database that is containing the table. So if you have two copies of one site (say, production and staging) running on the same database server, with the same tablename prefix (say, staging is a direct duplicate of production), only one of the two site will receive the upgrade -- the other will not.

Expected: both sites receive the upgrade.

Suggested fix: add a WHERE table_schema = '{$wpdb->dbname}' to filter results for the current database only.

@PPmmesquita
Copy link
Contributor

Thank you for your feedback, we'll work on it asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants