/**
* Usually aborts on failure
+ * @param String $server
+ * @param String $user
+ * @param String $password
+ * @param String $dbName
+ * @throws DBConnectionError
* @return bool|DatabaseBase|null
*/
function open( $server, $user, $password, $dbName ) {
*
* Usually aborts on failure
* If errors are explicitly ignored, returns success
+ * @param String $table
+ * @param Array $arrToInsert
+ * @param string $fname
+ * @param array $options
+ * @throws DBQueryError
* @return bool
*/
function insert( $table, $arrToInsert, $fname = 'DatabaseMssql::insert', $options = array() ) {
* Source items may be literals rather than field names, but strings should be quoted with Database::addQuotes()
* $conds may be "*" to copy the whole table
* srcTable may be an array of tables.
+ * @param string $destTable
+ * @param array|string $srcTable
+ * @param array $varMap
+ * @param array $conds
+ * @param string $fname
+ * @param array $insertOptions
+ * @param array $selectOptions
+ * @throws DBQueryError
* @return null|\ResultWrapper
*/
function insertSelect( $destTable, $srcTable, $varMap, $conds, $fname = 'DatabaseMssql::insertSelect',
return $sql;
}
- // MSSQL does support this, but documentation is too thin to make a generalized
- // function for this. Apparently UPDATE TOP (N) works, but the sort order
- // may not be what we're expecting so the top n results may be a random selection.
- // TODO: Implement properly.
- function limitResultForUpdate( $sql, $num ) {
- return $sql;
- }
-
function timestamp( $ts = 0 ) {
return wfTimestamp( TS_ISO_8601, $ts );
}
/**
* Begin a transaction, committing any previously open transaction
*/
- function begin( $fname = 'DatabaseMssql::begin' ) {
+ protected function doBegin( $fname = 'DatabaseMssql::begin' ) {
sqlsrv_begin_transaction( $this->mConn );
$this->mTrxLevel = 1;
}
/**
* End a transaction
*/
- function commit( $fname = 'DatabaseMssql::commit' ) {
+ protected function doCommit( $fname = 'DatabaseMssql::commit' ) {
sqlsrv_commit( $this->mConn );
$this->mTrxLevel = 0;
}
* Rollback a transaction.
* No-op on non-transactional databases.
*/
- function rollback( $fname = 'DatabaseMssql::rollback' ) {
+ protected function doRollback( $fname = 'DatabaseMssql::rollback' ) {
sqlsrv_rollback( $this->mConn );
$this->mTrxLevel = 0;
}
* Escapes a identifier for use inm SQL.
* Throws an exception if it is invalid.
* Reference: http://msdn.microsoft.com/en-us/library/aa224033%28v=SQL.80%29.aspx
+ * @param $identifier
+ * @throws MWException
* @return string
*/
private function escapeIdentifier( $identifier ) {