MantisBT - ATutor
View Issue Details
0003911ATutorModulespublic2009-08-11 03:082009-12-01 08:41
0003911: SQL queries preceeded by comments are skipped on module installation
If a module.sql file contains a "/*"-style comment (even on a separate line), during file parsing it gets prepended to the SQL query immediately following it instead of being discarded. Supposedly, function splitSqlFile() of include/classes/sqlutility.class.php is responsible for that bug.

Once that happens, function prefixQuery() tries to detect a SQL command (like INSERT, UPDATE, CREATE TABLE etc.) at the start of the query and fails because of a comment being there. As a result, TABLE_PREFIX is never appended to the query in question and the query fails too.
That can (and, in fact, did) have effects as adverse as failing to create a table for a module to store data in.

The bug doesn't happen with "#"-style comments.
No tags attached.
Issue History
2009-08-11 03:08IndieRectNew Issue
2009-08-11 03:08IndieRectAffects version => SVN
2009-11-05 10:01gregStatusnew => assigned
2009-11-05 10:01gregAssigned To => cindy
2009-11-09 10:09cindyStatusassigned => resolved
2009-11-09 10:09cindyFixed in Version => 1.6.4
2009-11-09 10:09cindyResolutionopen => fixed
2009-11-09 10:09cindyNote Added: 0003851
2009-12-01 08:41gregStatusresolved => closed

2009-11-09 10:09   
SVN revision: 8895

Solution: handle comment signs "/* ... */". Now, the accepted comment signs in atutor sql files are: "# ", "/* ... */", "--". All comment start signs must be at the beginning of the line.

Affected scripts: include/classes/sqlutility.class.php