Moodle

MySQLi connection hardcoded

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.0
  • Fix Version/s: 2.0
  • Component/s: Other
  • Labels:
    None
  • Database:
    Any
  • Affected Branches:
    MOODLE_20_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

\lib\simpletest\fixtures\gradetest.php hardcodes a mysqli_adodb connection. Should use the driver type and family from the $CFG file. Patch attached.

Activity

Hide
Nicolas Connault added a comment -

Thanks Andrei, applying now.

Show
Nicolas Connault added a comment - Thanks Andrei, applying now.
Hide
Nicolas Connault added a comment -

Applied your patch. It fixes the issue, but there is still a fatal error in the closing block. For some reason, running the unit tests in the lib/ folder changes the global $DB variable to NULL. I haven't pinpointed the source yet.

Show
Nicolas Connault added a comment - Applied your patch. It fixes the issue, but there is still a fatal error in the closing block. For some reason, running the unit tests in the lib/ folder changes the global $DB variable to NULL. I haven't pinpointed the source yet.
Hide
Andrei Bautu added a comment -

The $DB = null was happening before that. It happened to me in events tests on MySQL. I also tried to find out why. I'll keep you informed if I found something.

Show
Andrei Bautu added a comment - The $DB = null was happening before that. It happened to me in events tests on MySQL. I also tried to find out why. I'll keep you informed if I found something.
Hide
Petr Škoda (skodak) added a comment -

1/ oh, we can not have prefix "mdl_unittest_" this can not work on for all supported databases
2/ the connect is also missing dboptions parameter

Show
Petr Škoda (skodak) added a comment - 1/ oh, we can not have prefix "mdl_unittest_" this can not work on for all supported databases 2/ the connect is also missing dboptions parameter
Hide
Nicolas Connault added a comment -

Fixed these two points, thanks for your review, Petr.

Show
Nicolas Connault added a comment - Fixed these two points, thanks for your review, Petr.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: