MantisBT - ATutor
View Issue Details
0005536ATutorUpgradingpublic2014-09-19 14:392016-01-01 09:59
greg 
greg 
normalminorhave not tried
closedfixed 
 
2.2 
SVN
0005536: Upgrade from 2.1 to 2.2 DB error
There have been a couple posts regarding db connect errors when upgrading from v2.1 to 2.2

http://www.atutor.ca/view/7/24848/1.html [^]
No tags attached.
Issue History
2014-09-19 14:39gregNew Issue
2014-09-20 11:19gregNote Added: 0006990
2014-09-20 11:22gregNote Edited: 0006990bug_revision_view_page.php?bugnote_id=6990#r190
2014-09-20 11:23gregNote Edited: 0006990bug_revision_view_page.php?bugnote_id=6990#r191
2014-09-20 11:56gregNote Added: 0006991
2014-09-20 12:01gregSVN Revision# => f70b9ff..c62d839 master -> master
2014-09-20 12:01gregNote Added: 0006992
2014-09-20 12:01gregStatusnew => resolved
2014-09-20 12:01gregFixed in Version => 2.2
2014-09-20 12:01gregResolutionopen => fixed
2014-09-20 12:01gregAssigned To => greg
2014-09-20 12:02gregChangeset attached => ATutor master c62d8393
2015-09-18 19:43anonymousSVN Revision#f70b9ff..c62d839 master -> master =>
2016-01-01 09:59gregNote Added: 0007172
2016-01-01 09:59gregStatusresolved => closed

Notes
(0006990)
greg   
2014-09-20 11:19   
(edited on: 2014-09-20 11:23)
The problem is the query at line 226 in include/classes/sqlutility.class.php expect $result to return the number of affected rows, but the ALTER statement does not return any affected_rows, always returning 0. Thus when an ALTER statement is run the conditions that follow think the query has failed, when infact it was successful.

See line
https://github.com/atutor/ATutor/blob/master/include/classes/sqlutility.class.php#L226-L227 [^]

Another means is needed to determine if the ALTER statement was run successfully.

(0006991)
greg   
2014-09-20 11:56   
Change
if($result > 0){

to

if(queryDB($prefixed_query[0], array()) !== false){
(0006992)
greg   
2014-09-20 12:01   
replaced test on $result with test of false on queryDB() ALTER query

Updated 2.2 bundle released, replacing the previous 2.2 bundle on sourceforge
(0007172)
greg   
2016-01-01 09:59   
closed for 2.2.1