$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);
+ }
}
$_COLONARR = array();
$_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 results are attached to this pointer from Stored Proceedure calls, the next standard query will die 2014
//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);
}
class ADORecordSet_ext_mysqlt extends ADORecordSet_mysqlt {
- function ADORecordSet_ext_mysqlt($queryID,$mode=false)
+ function __construct($queryID,$mode=false)
{
parent::__construct($queryID,$mode);
}
Our changes:
* 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