*/
public function recoveryEnabledForUser() {
- $sql = 'SELECT `recovery_enabled` FROM `*PREFIX*encryption` WHERE uid = ?';
+ $sql = 'SELECT `recovery_enabled` FROM `*PREFIX*encryption` WHERE `uid` = ?';
$args = array($this->userId);
// Create a new record instead
} else {
- $sql = 'UPDATE `*PREFIX*encryption` SET recovery_enabled = ? WHERE uid = ?';
+ $sql = 'UPDATE `*PREFIX*encryption` SET `recovery_enabled` = ? WHERE `uid` = ?';
$args = array(
$enabled,
*/
public function setMigrationStatus($status) {
- $sql = 'UPDATE `*PREFIX*encryption` SET migration_status = ? WHERE uid = ?';
+ $sql = 'UPDATE `*PREFIX*encryption` SET `migration_status` = ? WHERE `uid` = ?';
$args = array(
$status,
*/
public function getMigrationStatus() {
- $sql = 'SELECT `migration_status` FROM `*PREFIX*encryption` WHERE uid = ?';
+ $sql = 'SELECT `migration_status` FROM `*PREFIX*encryption` WHERE `uid` = ?';
$args = array($this->userId);
// Fetch all shares of this file path from DB
$query = \OC_DB::prepare(
- 'SELECT share_with
+ 'SELECT `share_with`
FROM
`*PREFIX*share`
WHERE
- item_source = ? AND share_type = ?'
+ `item_source` = ? AND `share_type` = ?'
);
$result = $query->execute(array($source, self::SHARE_TYPE_USER));
// We also need to take group shares into account
$query = \OC_DB::prepare(
- 'SELECT share_with
+ 'SELECT `share_with`
FROM
`*PREFIX*share`
WHERE
- item_source = ? AND share_type = ?'
+ `item_source` = ? AND `share_type` = ?'
);
$result = $query->execute(array($source, self::SHARE_TYPE_GROUP));
//check for public link shares
if (!$publicShare) {
$query = \OC_DB::prepare(
- 'SELECT share_with
+ 'SELECT `share_with`
FROM
`*PREFIX*share`
WHERE
- item_source = ? AND share_type = ?'
+ `item_source` = ? AND `share_type` = ?'
);
$result = $query->execute(array($source, self::SHARE_TYPE_LINK));
}
public function testQuotes() {
- $query = OC_DB::prepare('SELECT `fullname` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?');
+ $query = OC_DB::prepare('SELECT `fullname` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_1'));
$this->assertTrue((bool)$result);
$row = $result->fetchRow();
$this->assertFalse($row);
- $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`,`uri`) VALUES (?,?)');
+ $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (?,?)');
$result = $query->execute(array('fullname test', 'uri_1'));
$this->assertTrue((bool)$result);
- $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?');
+ $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_1'));
$this->assertTrue((bool)$result);
$row = $result->fetchRow();
}
public function testNOW() {
- $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`,`uri`) VALUES (NOW(),?)');
+ $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (NOW(),?)');
$result = $query->execute(array('uri_2'));
$this->assertTrue((bool)$result);
- $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?');
+ $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_2'));
$this->assertTrue((bool)$result);
}
public function testUNIX_TIMESTAMP() {
- $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`,`uri`) VALUES (UNIX_TIMESTAMP(),?)');
+ $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`,`uri`) VALUES (UNIX_TIMESTAMP(),?)');
$result = $query->execute(array('uri_3'));
$this->assertTrue((bool)$result);
- $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?');
+ $query = OC_DB::prepare('SELECT `fullname`,`uri` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array('uri_3'));
$this->assertTrue((bool)$result);
}
$this->assertTrue((bool)$result);
}
- $query = OC_DB::prepare('SELECT * FROM *PREFIX*'.$this->table3);
+ $query = OC_DB::prepare('SELECT * FROM `*PREFIX*'.$this->table3.'`');
$result = $query->execute();
$this->assertTrue((bool)$result);
$this->assertEquals('4', $result->numRows());
$carddata = 'This is a vCard';
// Normal test to have same known data inserted.
- $query = OC_DB::prepare('INSERT INTO *PREFIX*'.$this->table2.' (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)');
+ $query = OC_DB::prepare('INSERT INTO `*PREFIX*'.$this->table2.'` (`fullname`, `uri`, `carddata`) VALUES (?, ?, ?)');
$result = $query->execute(array($fullname, $uri, $carddata));
$this->assertTrue((bool)$result);
- $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?');
+ $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array($uri));
$this->assertTrue((bool)$result);
$row = $result->fetchRow();
));
$this->assertTrue((bool)$result);
- $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM *PREFIX*'.$this->table2.' WHERE `uri` = ?');
+ $query = OC_DB::prepare('SELECT `fullname`, `uri`, `carddata` FROM `*PREFIX*'.$this->table2.'` WHERE `uri` = ?');
$result = $query->execute(array($uri));
$this->assertTrue((bool)$result);
$row = $result->fetchRow();