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

Database update for version 4.7.2 failed #334

Closed
DalbertHab opened this issue Mar 29, 2023 · 3 comments · Fixed by #335
Closed

Database update for version 4.7.2 failed #334

DalbertHab opened this issue Mar 29, 2023 · 3 comments · Fixed by #335

Comments

@DalbertHab
Copy link

After updating the plugin, we had to update the database. During the update we git the error message * SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option where option_name like '%_isLDAPUser'' at line 1.

After debugging the code, the problem occurs as we use no prefix for the tables and option is a reserved keyword in mysql MySQL Keywords.

After changing the SQL statement, everything went smoothly:

OLD: $optionValues = $db->fetchAll("Select option_name from $optionTable where option_name like '%$searchPattern'");
NEW: $optionValues = $db->fetchAll("Select option_name from `$optionTable` where option_name like '%$searchPattern'");

@AltamashShaikh
Copy link
Contributor

@DalbertHab Sorry, I should have thought about it, will release a new version with the fixed script

@AltamashShaikh
Copy link
Contributor

@DalbertHab Should be fixed with release of 4.7.3 version

@DalbertHab
Copy link
Author

Thanks :)

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

Successfully merging a pull request may close this issue.

2 participants