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 error on users page related to LearnDash LMS plugin #300

Open
GitCouth opened this Issue Aug 21, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@GitCouth
Copy link

GitCouth commented Aug 21, 2018

I'm seeing several database errors on the WordPress users page - all are code 102. I believe they're related to the LearnDash LMS plugin and the use of REGEXP, which is a problem for MSSQL. Below is the simplest error. Is this something that can be handled with translation or am I going to need to get with the LearnDash team?

WordPress database error: [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'REGEXP'. Code - 102]
SELECT postmeta.post_id as post_id FROM wp01_postmeta as postmeta INNER JOIN wp01_posts as posts ON posts.ID = postmeta.post_id WHERE posts.post_status='publish' AND posts.post_type='sfwd-courses' AND postmeta.meta_key='_sfwd-courses' AND ( postmeta.meta_value REGEXP '"sfwd-courses_course_price_type";s:4:"open";' )
@patrickebates

This comment has been minimized.

Copy link
Member

patrickebates commented Aug 21, 2018

Am I missing something, or is there nothing in the REGEXP match that actually requires REGEXP?

@GitCouth

This comment has been minimized.

Copy link
Author

GitCouth commented Aug 21, 2018

I'm not sure. This is the full list of errors I see.

WordPress database error: [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'REGEXP'. Code - 102]
SELECT postmeta.post_id as post_id FROM wp01_postmeta as postmeta INNER JOIN wp01_posts as posts ON posts.ID = postmeta.post_id WHERE posts.post_status='publish' AND posts.post_type='sfwd-courses' AND postmeta.meta_key='_sfwd-courses' AND ( postmeta.meta_value REGEXP '"sfwd-courses_course_price_type";s:4:"open";' )

WordPress database error: [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'REGEXP'. Code - 102]
SELECT postmeta.post_id FROM wp01_postmeta as postmeta INNER JOIN wp01_posts as posts ON posts.ID = postmeta.post_id WHERE posts.post_status='publish' AND posts.post_type='sfwd-courses' AND postmeta.meta_key='_sfwd-courses' AND (( postmeta.meta_value REGEXP 's:30:"sfwd-courses_course_price_type";s:6:"paynow";' ) AND ( postmeta.meta_value REGEXP 's:25:"sfwd-courses_course_price";s:0:"";' ))

WordPress database error: [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'REGEXP'. Code - 102]
SELECT post_id FROM wp01_postmeta as postmeta INNER JOIN wp01_posts as posts ON posts.ID = postmeta.post_id WHERE posts.post_status='publish' AND posts.post_type='sfwd-courses' AND postmeta.meta_key='_sfwd-courses' AND ( postmeta.meta_value NOT REGEXP '"sfwd-courses_course_access_list";s:0:"";' AND ( postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";i:3;s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";i:3;s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";i:3;s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"3";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"3";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"3";s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"3,(.*)";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"3,(.*)";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"3,(.*)";s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),3,(.*)";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),3,(.*)";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),3,(.*)";s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),3";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),3";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),3";s:35:"sfwd-courses_course_lesson_per_page"' ))

WordPress database error: [[Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Incorrect syntax near 'REGEXP'. Code - 102]
SELECT post_id FROM wp01_postmeta as postmeta INNER JOIN wp01_posts as posts ON posts.ID = postmeta.post_id WHERE posts.post_status='publish' AND posts.post_type='sfwd-courses' AND postmeta.meta_key='_sfwd-courses' AND ( postmeta.meta_value NOT REGEXP '"sfwd-courses_course_access_list";s:0:"";' AND ( postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";i:5;s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";i:5;s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";i:5;s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"5";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"5";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"5";s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"5,(.*)";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"5,(.*)";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"5,(.*)";s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),5,(.*)";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),5,(.*)";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),5,(.*)";s:35:"sfwd-courses_course_lesson_per_page"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),5";s:34:"sfwd-courses_course_lesson_orderby"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),5";s:40:"sfwd-courses_course_prerequisite_compare"' OR postmeta.meta_value REGEXP 's:31:"sfwd-courses_course_access_list";s:(.*):"(.*),5";s:35:"sfwd-courses_course_lesson_per_page"' ))
@patrickebates

This comment has been minimized.

Copy link
Member

patrickebates commented Aug 22, 2018

The last two examples do show actual use of the REGEXP functionality. There might be a way to translate this to LIKE statements without breaking something or causing too many matches. I will look into some options.

@MoatazAbdAlmageed

This comment has been minimized.

Copy link

MoatazAbdAlmageed commented Sep 25, 2018

@patrickebates sorry for my reply but I don't love this project I think WordPress run well in PHP & MySQL

@patrickebates

This comment has been minimized.

Copy link
Member

patrickebates commented Sep 26, 2018

Project Nami isn't for everyone. We don't want to supplant Wordpress, we simply want to open up another database platform for an already great product. I think you'd be surprised just how high a percentage of our users are in corporate or government environments where, for issues of personal preference or policy, they want to or must run SQL Server. That's why we are here. And if along the way we produce results which can also benefit vanilla Wordpress (which we have done with at least one Core commit and some plugins and tools), then all the better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment