Skip to content
Browse files

Merge branch 'master' of github.com:yiisoft/yii into 1827-gii-pgsql-s…

…chema-name
  • Loading branch information...
2 parents d786dd3 + 8afd193 commit 14d5c0c13c1f419cebfa1b0f120fbf17ef93d7ae @resurtm committed Apr 5, 2013
View
1 CHANGELOG
@@ -41,6 +41,7 @@ Version 1.1.14 work in progress
- Bug #2244: MessageCommand has been updated, allowing to merge string with value '0' correctly (klimov-paul)
- Bug #2258: CJuiSliderInput didn't support string typed 'range' option (bookin)
- Bug #2283: Gii Model Generator's tooltips are not working and always invisible (resurtm)
+- Bug #2299: CMssqlSchema: findTableNames(), getTables() and getTableNames() methods used to prepend schema prefix to the table names twice (resurtm)
- Enh: Better CFileLogRoute performance (Qiang, samdark)
- Enh: Refactored CHttpRequest::getDelete and CHttpRequest::getPut not to use _restParams directly (samdark)
- Enh #1142: CSecurityManager::computeHMAC() has been made public (resurtm)
View
2 docs/guide/de/test.unit.txt
@@ -70,7 +70,7 @@ $comments = $this->comments;
// Zeile mit dem Alias 'sample1' aus der Fixturetabelle 'Post' zurückliefern
$post = $this->posts['sample1'];
// Die AR-Instanz, die der Fixturezeile 'sample1' entspricht zurückliefern
-$post = $this->post('sample1');
+$post = $this->posts('sample1');
~~~
> Note|Hinweis: Wenn ein Fixture über seinen Tabellennamen festgelegt wurde
View
28 framework/db/schema/mssql/CMssqlColumnSchema.php
@@ -19,20 +19,20 @@
class CMssqlColumnSchema extends CDbColumnSchema
{
- /**
- * Initializes the column with its DB type and default value.
- * This sets up the column's PHP type, size, precision, scale as well as default value.
- * @param string $dbType the column's DB type
- * @param mixed $defaultValue the default value
- */
- public function init($dbType, $defaultValue)
- {
- if ($defaultValue=='(NULL)')
- {
- $defaultValue=null;
- }
- parent::init($dbType, $defaultValue);
- }
+ /**
+ * Initializes the column with its DB type and default value.
+ * This sets up the column's PHP type, size, precision, scale as well as default value.
+ * @param string $dbType the column's DB type
+ * @param mixed $defaultValue the default value
+ */
+ public function init($dbType, $defaultValue)
+ {
+ if ($defaultValue=='(NULL)')
+ {
+ $defaultValue=null;
+ }
+ parent::init($dbType, $defaultValue);
+ }
/**
View
2 framework/db/schema/mssql/CMssqlPdoAdapter.php
@@ -25,7 +25,7 @@ class CMssqlPdoAdapter extends PDO
*/
public function lastInsertId ($sequence=NULL)
{
- return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
+ return $this->query('SELECT CAST(COALESCE(SCOPE_IDENTITY(), @@IDENTITY) AS bigint)')->fetchColumn();
}
/**
View
46 framework/db/schema/mssql/CMssqlSchema.php
@@ -24,20 +24,20 @@ class CMssqlSchema extends CDbSchema
* @var array the abstract column types mapped to physical column types.
* @since 1.1.6
*/
- public $columnTypes=array(
- 'pk' => 'int IDENTITY PRIMARY KEY',
- 'string' => 'varchar(255)',
- 'text' => 'text',
- 'integer' => 'int',
- 'float' => 'float',
- 'decimal' => 'decimal',
- 'datetime' => 'datetime',
- 'timestamp' => 'timestamp',
- 'time' => 'time',
- 'date' => 'date',
- 'binary' => 'binary',
- 'boolean' => 'bit',
- );
+ public $columnTypes=array(
+ 'pk' => 'int IDENTITY PRIMARY KEY',
+ 'string' => 'varchar(255)',
+ 'text' => 'text',
+ 'integer' => 'int',
+ 'float' => 'float',
+ 'decimal' => 'decimal',
+ 'datetime' => 'datetime',
+ 'timestamp' => 'timestamp',
+ 'time' => 'time',
+ 'date' => 'date',
+ 'binary' => 'binary',
+ 'boolean' => 'bit',
+ );
/**
* Quotes a table name for use in a query.
@@ -191,13 +191,13 @@ protected function findPrimaryKey($table)
$sql = <<<EOD
SELECT k.column_name field_name
- FROM {$this->quoteTableName($kcu)} k
- LEFT JOIN {$this->quoteTableName($tc)} c
- ON k.table_name = c.table_name
- AND k.constraint_name = c.constraint_name
- WHERE c.constraint_type ='PRIMARY KEY'
- AND k.table_name = :table
- AND k.table_schema = :schema
+ FROM {$this->quoteTableName($kcu)} k
+ LEFT JOIN {$this->quoteTableName($tc)} c
+ ON k.table_name = c.table_name
+ AND k.constraint_name = c.constraint_name
+ WHERE c.constraint_type ='PRIMARY KEY'
+ AND k.table_name = :table
+ AND k.table_schema = :schema
EOD;
$command = $this->getDbConnection()->createCommand($sql);
$command->bindValue(':table', $table->name);
@@ -354,7 +354,7 @@ protected function findTableNames($schema='',$includeViews=true)
else
$condition="TABLE_TYPE='BASE TABLE'";
$sql=<<<EOD
-SELECT TABLE_NAME, TABLE_SCHEMA FROM [INFORMATION_SCHEMA].[TABLES]
+SELECT TABLE_NAME FROM [INFORMATION_SCHEMA].[TABLES]
WHERE TABLE_SCHEMA=:schema AND $condition
EOD;
$command=$this->getDbConnection()->createCommand($sql);
@@ -366,7 +366,7 @@ protected function findTableNames($schema='',$includeViews=true)
if ($schema == self::DEFAULT_SCHEMA)
$names[]=$row['TABLE_NAME'];
else
- $names[]=$schema.'.'.$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME'];
+ $names[]=$schema.'.'.$row['TABLE_NAME'];
}
return $names;

0 comments on commit 14d5c0c

Please sign in to comment.
Something went wrong with that request. Please try again.