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

Bug - "View user statistics" produces an error #164

Open
acquaalta opened this issue Sep 23, 2023 · 3 comments
Open

Bug - "View user statistics" produces an error #164

acquaalta opened this issue Sep 23, 2023 · 3 comments
Assignees

Comments

@acquaalta
Copy link

acquaalta commented Sep 23, 2023

Hi,
Moodle version: 4.1.3
Plugin version: v4.2-r1

When pressing the "View user statistics" button in a specific Moodleoverflow activity, I get the following error/exception:

Error reading from database

More information about this error

Debug info: 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 'OVER (ORDER BY ratings.id)) AS row_num,
ratings.id A' at line 1
SELECT (ROW_NUMBER() OVER (ORDER BY ratings.id)) AS row_num,
ratings.id AS rateid,
discuss.userid AS discussuserid,
posts.id AS postid,
posts.userid AS postuserid,
ratings.rating AS rating,
ratings.userid AS rateuserid,
ratings.postid AS ratepostid,
discuss.id AS discussid,
posts.discussion AS postdiscussid,
ratings.discussionid AS ratediscussid
FROM mdl_moodleoverflow_discussions discuss
LEFT JOIN mdl_moodleoverflow_posts posts ON discuss.id = posts.discussion
LEFT JOIN mdl_moodleoverflow_ratings ratings ON posts.id = ratings.postid
WHERE discuss.course = 7;
[array (
)]
Error code: dmlreadexception
Dismiss this notification
Stack trace:
line 494 of /lib/dml/moodle_database.php: dml_read_exception thrown
line 293 of /lib/dml/moodle_read_slave_trait.php: call to moodle_database->query_end()
line 1278 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->query_end()
line 206 of /mod/moodleoverflow/classes/tables/userstats_table.php: call to mysqli_native_moodle_database->get_records_sql()
line 81 of /mod/moodleoverflow/classes/tables/userstats_table.php: call to mod_moodleoverflow\tables\userstats_table->get_table_data()
line 67 of /mod/moodleoverflow/userstats.php: call to mod_moodleoverflow\tables\userstats_table->__construct()

Could you please check if this as an issue that can somehow get fixed?

Thanks :-)

@NinaHerrmann
Copy link
Contributor

@TamaroWalter

@TamaroWalter
Copy link
Contributor

Hi,
thank you for your feedback. We tried to reproduce the bug on our moodle system but couldn't find it.
Is there more information about the bug?
Is there something different in the specific moodleoverflow to others in your system?
What is your mysql-version? As the bug refers to the SQL-Syntax it could be a version problem with your current my-sql version

In our new plugin version v4.2-r2 the userstats feature improved. If you want you can update your plugin version and test if the bug is still there.

@acquaalta
Copy link
Author

Hi,

  1. It happens in every Moodleoverflow activity I created in the system. When I wrote the original report I had a memory that it's a problem in a specific Moodleoverflow forum only.

  2. It doesn't seem like an issue with a specific content in the activity that causes this bug. I checked and it happens even in an empty forum (Moodleoverflow activity).

  3. It happens on a system with MySQL v8.1

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