"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "framework/db/mssql/QueryBuilder.php" between
yii2-2.0.35.tar.gz and yii2-2.0.36.tar.gz

About: Yii 2 is a high-performance component-based PHP framework for developing large-scale Web applications (source).

QueryBuilder.php  (yii2-2.0.35):QueryBuilder.php  (yii2-2.0.36)
skipping to change at line 439 skipping to change at line 439
$columns[$name] = new Expression("CONVERT(VARBINARY(MAX), $p hName)", $params); $columns[$name] = new Expression("CONVERT(VARBINARY(MAX), $p hName)", $params);
} }
} }
} }
return $columns; return $columns;
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
* Added OUTPUT construction for getting inserted data (for SQL Server 2005
or later)
* OUTPUT clause - The OUTPUT clause is new to SQL Server 2005 and has the a
bility to access
* the INSERTED and DELETED tables as is the case with a trigger.
*/ */
public function insert($table, $columns, &$params) public function insert($table, $columns, &$params)
{ {
return parent::insert($table, $this->normalizeTableRowData($table, $colu $columns = $this->normalizeTableRowData($table, $columns, $params);
mns, $params), $params);
$version2005orLater = version_compare($this->db->getSchema()->getServerV
ersion(), '9', '>=');
list($names, $placeholders, $values, $params) = $this->prepareInsertValu
es($table, $columns, $params);
return 'INSERT INTO ' . $this->db->quoteTableName($table)
. (!empty($names) ? ' (' . implode(', ', $names) . ')' : '')
. ($version2005orLater ? ' OUTPUT INSERTED.*' : '')
. (!empty($placeholders) ? ' VALUES (' . implode(', ', $placeholders
) . ')' : $values);
} }
/** /**
* {@inheritdoc} * {@inheritdoc}
* @see https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact -sql * @see https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact -sql
* @see http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condi tion-With-MERGE.aspx * @see http://weblogs.sqlteam.com/dang/archive/2009/01/31/UPSERT-Race-Condi tion-With-MERGE.aspx
*/ */
public function upsert($table, $insertColumns, $updateColumns, &$params) public function upsert($table, $insertColumns, $updateColumns, &$params)
{ {
/** @var Constraint[] $constraints */ /** @var Constraint[] $constraints */
 End of changes. 2 change blocks. 
2 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)