Merge branch 'wip-MDL-52286-master' of https://github.com/marinaglancy/moodle

This commit is contained in:
Dan Poltawski 2015-12-14 10:23:28 +00:00
commit 037397bf98
6 changed files with 25 additions and 5 deletions

View file

@ -381,4 +381,22 @@ class auth_db_testcase extends advanced_testcase {
$this->cleanup_auth_database(); $this->cleanup_auth_database();
} }
/**
* Testing the function _colonscope() from ADOdb.
*/
public function test_adodb_colonscope() {
global $CFG;
require_once($CFG->libdir.'/adodb/adodb.inc.php');
require_once($CFG->libdir.'/adodb/drivers/adodb-odbc.inc.php');
require_once($CFG->libdir.'/adodb/drivers/adodb-db2ora.inc.php');
$this->resetAfterTest(false);
$sql = "select * from table WHERE column=:1 AND anothercolumn > :0";
$arr = array('b', 1);
list($sqlout, $arrout) = _colonscope($sql,$arr);
$this->assertEquals("select * from table WHERE column=? AND anothercolumn > ?", $sqlout);
$this->assertEquals(array(1, 'b'), $arrout);
}
} }

View file

@ -38,7 +38,7 @@ global $_COLONARR,$_COLONSZ;
$_COLONARR = array(); $_COLONARR = array();
$_COLONSZ = sizeof($arr); $_COLONSZ = sizeof($arr);
$sql2 = preg_replace("/(:[0-9]+)/e","_colontrack('\\1')",$sql); $sql2 = preg_replace_callback('/(:[0-9]+)/', create_function('$m', 'return _colontrack($m[0]);'), $sql);
if (empty($_COLONARR)) return array($sql,$arr); if (empty($_COLONARR)) return array($sql,$arr);

View file

@ -1050,7 +1050,7 @@ class ADORecordSet_mysqli extends ADORecordSet{
//if results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014 //if results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014
//only a problem with persistant connections //only a problem with persistant connections
while(mysqli_more_results($this->connection->_connectionID)){ while (@mysqli_more_results($this->connection->_connectionID)) {
@mysqli_next_result($this->connection->_connectionID); @mysqli_next_result($this->connection->_connectionID);
} }

View file

@ -130,7 +130,7 @@ class ADORecordSet_mysqlt extends ADORecordSet_mysql{
class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt { class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
function ADORecordSet_ext_mysqlt($queryID,$mode=false) function __construct($queryID,$mode=false)
{ {
parent::__construct($queryID,$mode); parent::__construct($queryID,$mode);
} }

View file

@ -1,4 +1,4 @@
Description of ADODB V5.21 library import into Moodle Description of ADODB V5.20.1 library import into Moodle
This library will be probably removed in Moodle 2.1, This library will be probably removed in Moodle 2.1,
it is now used only in enrol and auth db plugins. it is now used only in enrol and auth db plugins.
@ -24,5 +24,7 @@ Added:
Our changes: Our changes:
* Removed random seed initialization from lib/adodb/adodb.inc.php:216 (see 038f546 and MDL-41198). * Removed random seed initialization from lib/adodb/adodb.inc.php:216 (see 038f546 and MDL-41198).
* MDL-52286 fixed usage of /e in preg_replace, incorrect constructor in ADORecordSet_ext_mysqlt
and ADORecordSet_mysqli::_close(). Check if fixed upstream during the next upgrade and remove this line.
skodak, iarenaza, moodler, stronk7 skodak, iarenaza, moodler, stronk7

View file

@ -4,7 +4,7 @@
<location>adodb</location> <location>adodb</location>
<name>AdoDB</name> <name>AdoDB</name>
<license>BSD/GPL</license> <license>BSD/GPL</license>
<version>5.21</version> <version>5.20.1</version>
<licenseversion>2.1+</licenseversion> <licenseversion>2.1+</licenseversion>
</library> </library>
<library> <library>