$this->replacePlaceholders($sqlString, $parameters);
// debug($sqlString,-2);
$this->databaseHandle->sql_query($sqlString);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($sqlString);
$uid = $this->databaseHandle->sql_insert_id();
if (!$isRelation) {
$this->clearPageCache($tableName, $uid);
$this->replacePlaceholders($sqlString, $parameters);
// debug($sqlString,-2);
$returnValue = $this->databaseHandle->sql_query($sqlString);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($sqlString);
if (!$isRelation) {
$this->clearPageCache($tableName, $uid);
}
}
// debug($statement, -2);
$returnValue = $this->databaseHandle->sql_query($statement);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($statement);
return $returnValue;
}
$this->replacePlaceholders($statement, $identifier);
// debug($statement,-2);
$res = $this->databaseHandle->sql_query($statement);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($statement);
$row = $this->databaseHandle->sql_fetch_assoc($res);
if ($row !== FALSE) {
return $row;
$this->replacePlaceholders($sql, $parameters);
// debug($sql,-2);
$result = $this->databaseHandle->sql_query($sql);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($sql);
$rows = $this->getRowsFromResult($query->getSource(), $result);
$rows = $this->doLanguageAndWorkspaceOverlay($query->getSource(), $rows);
// TODO: implement $objectData = $this->processObjectRecords($statementHandle);
$this->replacePlaceholders($statement, $parameters);
// debug($sql,-2);
$result = $this->databaseHandle->sql_query($statement);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($statement);
$rows = $this->getRowsFromResult($query->getSource(), $result);
return current(current($rows));
}
$this->replacePlaceholders($statement, $parameters);
// debug($statement,-2);
$res = $this->databaseHandle->sql_query($statement);
- $this->checkSqlErrors();
+ $this->checkSqlErrors($statement);
$row = $this->databaseHandle->sql_fetch_assoc($res);
if ($row !== FALSE) {
return (int)$row['uid'];
* Checks if there are SQL errors in the last query, and if yes, throw an exception.
*
* @return void
+ * @param string $sql The SQL statement
* @throws Tx_Extbase_Persistence_Storage_Exception_SqlError
*/
- protected function checkSqlErrors() {
+ protected function checkSqlErrors($sql='') {
$error = $this->databaseHandle->sql_error();
if ($error !== '') {
+ $error .= $sql ? ': ' . $sql : '';
throw new Tx_Extbase_Persistence_Storage_Exception_SqlError($error, 1247602160);
}
}