diff options
Diffstat (limited to 'framework/Testing/Data')
-rwxr-xr-x | framework/Testing/Data/Schema/mssql/TMssqlSchema.php | 3 | ||||
-rwxr-xr-x | framework/Testing/Data/TDbConnection.php | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/framework/Testing/Data/Schema/mssql/TMssqlSchema.php b/framework/Testing/Data/Schema/mssql/TMssqlSchema.php index 1b3d815c..d728a6ce 100755 --- a/framework/Testing/Data/Schema/mssql/TMssqlSchema.php +++ b/framework/Testing/Data/Schema/mssql/TMssqlSchema.php @@ -10,6 +10,7 @@ */ prado::using('System.Testing.Data.Schema.TDbSchema'); +prado::using('System.Testing.Data.Schema.mssql.*'); /** * TMssqlSchema is the class for retrieving metadata information from a MS SQL Server database. @@ -286,7 +287,7 @@ SELECT TABLE_NAME, TABLE_SCHEMA FROM [INFORMATION_SCHEMA].[TABLES] WHERE TABLE_TYPE='BASE TABLE' AND TABLE_SCHEMA=:schema EOD; $command=$this->getDbConnection()->createCommand($sql); - $command->bindParam(":schema", $schema); + $command->bindParameter(":schema", $schema); $rows=$command->queryAll(); $names=array(); foreach ($rows as $row) diff --git a/framework/Testing/Data/TDbConnection.php b/framework/Testing/Data/TDbConnection.php index 99484454..c34a07cb 100755 --- a/framework/Testing/Data/TDbConnection.php +++ b/framework/Testing/Data/TDbConnection.php @@ -289,7 +289,7 @@ class TDbConnection extends TComponent $pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES,true); if($this->charset!==null) { - switch ($pdo->getAttribute(PDO::ATTR_DRIVER_NAME)) + switch (($driver=$pdo->getAttribute(PDO::ATTR_DRIVER_NAME))) { case 'mysql': $stmt = $pdo->prepare('SET CHARACTER SET ?'); @@ -300,6 +300,8 @@ class TDbConnection extends TComponent case 'sqlite': $stmt = $pdo->prepare ('SET NAMES ?'); break; + default: + throw new TDbException('dbconnection_unsupported_driver_charset', $driver); } $stmt->execute(array($this->charset)); } |