Details
-
Type:
Sub-task
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9
-
Fix Version/s: 1.9.1
-
Component/s: Assignment, Backup, Database SQL/XMLDB
-
Labels:None
-
Database:PostgreSQL
-
Affected Branches:MOODLE_19_STABLE
-
Fixed Branches:MOODLE_19_STABLE
Description
Error at three places:
=======================================================
ERROR: invalid input syntax for integer: ""
DELETE FROM mdl_backup_ids
WHERE backup_code = 1202567977 AND
table_name = 'assignment' AND
old_id = ''
...
line 451 of backup/lib.php: call to backup_delid()
...
=======================================================
ERROR: invalid input syntax for integer: ""
DELETE FROM mdl_backup_ids
WHERE backup_code = 1202567977 AND
table_name = 'quiz' AND
old_id = ''
...
line 451 of backup/lib.php: call to backup_delid()
...
=======================================================
ERROR: invalid input syntax for integer: ""
SELECT * FROM mdl_backup_ids WHERE backup_code = '1202567977' AND table_name = 'assignment' AND old_id = '
...
line 32 of mod/assignment/restorelib.php: call to backup_getid()
...
=======================================================
I do not know if this is problem of dmlib, backup/recovery or assignment module. I will try to look at assignment to realize if empty old_id is allowed during recovery process.
After some research, this seems to be a result of combination of several incidents. Somehow (I am trying to find out how) the ZIP course backup contains "empty" module instances like:
<INSTANCES>
<INSTANCE>
<ID></ID>
<NAME></NAME>
<INCLUDED>true</INCLUDED>
<USERINFO>false</USERINFO>
</INSTANCE>
</INSTANCES>
<MOD>
<ID></ID>
<MODTYPE>assignment</MODTYPE>
<NAME></NAME>
<DESCRIPTION></DESCRIPTION>
<FORMAT></FORMAT>
<RESUBMIT></RESUBMIT>
<PREVENTLATE></PREVENTLATE>
<EMAILTEACHERS></EMAILTEACHERS>
<VAR1></VAR1>
<VAR2></VAR2>
<VAR3></VAR3>
<VAR4></VAR4>
<VAR5></VAR5>
<ASSIGNMENTTYPE></ASSIGNMENTTYPE>
<MAXBYTES></MAXBYTES>
<TIMEDUE></TIMEDUE>
<TIMEAVAILABLE></TIMEAVAILABLE>
<GRADE></GRADE>
<TIMEMODIFIED></TIMEMODIFIED>
</MOD>
This XML record is then processed by backup_delid() and other backup functions: <ID></ID> => $old_id="" => error on PostgreSQL 8.
So, the major problem here is how the ZIP backup may contain an empty mod instance record