moodleou / moodle-report_customsql

A Moodle report plugin that lets you easily create simple reports that can be expressed as a single SQL query
48 stars 101 forks source link

SHOW TABLES does not work #145

Closed Fragonite closed 11 months ago

Fragonite commented 11 months ago

The statement SHOW TABLES or SHOW TABLES LIKE ... generates the following error:

Error when executing the query: Error reading from database 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 'LIMIT 0, 2' at line 1 SHOW TABLES LIMIT 0, 2 [array ( )]

I propose adding an option or special case to fix the problem.

Fragonite commented 11 months ago

For anyone running into this problem, a workaround is using a statement like:

SELECT TABLE_NAME FROM information_schema.TABLES