← Back to team overview

mahara-contributors team mailing list archive

[Bug 1810427] A change has been merged

 

Reviewed:  https://reviews.mahara.org/9399
Committed: https://git.mahara.org/mahara/mahara/commit/dae3023da7706ae29170c1f856f560663d476316
Submitter: Robert Lyon (robertl@xxxxxxxxxxxxxxx)
Branch:    master

commit dae3023da7706ae29170c1f856f560663d476316
Author: Marie-Eve L��vesque <marie-eve.levesque.8@xxxxxxxxxxxx>
Date:   Tue Jan 8 11:20:34 2019 +1300

Bug 1810427: constraint drop fails in MySQL in unit testing

behatnotneeded

Change-Id: I72c2ce1f592f316c591583e7e3020f6e9c5d380e

-- 
You received this bug notification because you are a member of Mahara
Contributors, which is subscribed to Mahara.
Matching subscriptions: Subscription for all Mahara Contributors -- please ask on #mahara-dev or mahara.org forum before editing or unsubscribing it!
https://bugs.launchpad.net/bugs/1810427

Title:
  Bug in unit tests with constraints in mysql

Status in Mahara:
  Fix Committed

Bug description:
  Mahara version : 18.10
  Database : MySQL

  The unit tests fail to execute when using MySQL, because of an sql
  error due to constraints ("DROP CONSTRAINT" is not supported in
  MySQL).

  In htdocs/testing/classes/util.php, I think that the following line 
  execute_sql('ALTER TABLE {lti_assessment} DROP CONSTRAINT {ltiasse_oau_fk}');

  should be replaced by 
  if (is_mysql()) {
      execute_sql('ALTER TABLE {lti_assessment} DROP FOREIGN KEY {ltiasse_oau_fk}');
  } 
  else {
      execute_sql('ALTER TABLE {lti_assessment} DROP CONSTRAINT {ltiasse_oau_fk}');
  }

  and 
  execute_sql('ALTER TABLE {collection} DROP CONSTRAINT {coll_fra_fk}');

  should be 
  if (is_mysql()) {
      execute_sql('ALTER TABLE {collection} DROP FOREIGN KEY {coll_fra_fk}');
  } 
  else {
      execute_sql('ALTER TABLE {collection} DROP CONSTRAINT {coll_fra_fk}');
  }

  The same logic is already used in the same file for other contraints.
  Maybe some indexes should be dropped also, not only the foreign key.

To manage notifications about this bug go to:
https://bugs.launchpad.net/mahara/+bug/1810427/+subscriptions


References