summaryrefslogtreecommitdiff
path: root/framework/Data/Common
diff options
context:
space:
mode:
authorwei <>2007-10-08 00:59:27 +0000
committerwei <>2007-10-08 00:59:27 +0000
commitc31900c9c909f42b722bfb03b164d548b602cdd4 (patch)
tree43c6972ef58134aede5a99880740a1dfa0bd0060 /framework/Data/Common
parentb7a0c37ad82ef4dcfb031643434538d600e37757 (diff)
Fixed #716
Diffstat (limited to 'framework/Data/Common')
-rw-r--r--framework/Data/Common/Pgsql/TPgsqlMetaData.php6
-rw-r--r--framework/Data/Common/Sqlite/TSqliteMetaData.php2
-rw-r--r--framework/Data/Common/TDbMetaData.php6
3 files changed, 7 insertions, 7 deletions
diff --git a/framework/Data/Common/Pgsql/TPgsqlMetaData.php b/framework/Data/Common/Pgsql/TPgsqlMetaData.php
index 9b6a5cdf..80c38d60 100644
--- a/framework/Data/Common/Pgsql/TPgsqlMetaData.php
+++ b/framework/Data/Common/Pgsql/TPgsqlMetaData.php
@@ -330,6 +330,7 @@ EOD;
*/
protected function getPrimaryKeys($tableName, $schemaName, $columnIndex)
{
+ $index = join(', ', split(' ', $columnIndex));
$sql =
<<<EOD
SELECT attnum, attname FROM pg_catalog.pg_attribute WHERE
@@ -338,13 +339,12 @@ EOD;
SELECT oid FROM pg_catalog.pg_namespace WHERE nspname=:schema
)
)
- AND attnum IN (:columnIndex)
+ AND attnum IN ({$index})
EOD;
$command = $this->getDbConnection()->createCommand($sql);
$command->bindValue(':table', $tableName);
$command->bindValue(':schema', $schemaName);
- $command->bindValue(':columnIndex', join('\',\'', split(' ', $columnIndex)));
-
+// $command->bindValue(':columnIndex', join(', ', split(' ', $columnIndex)));
$primary = array();
foreach($command->query() as $row)
{
diff --git a/framework/Data/Common/Sqlite/TSqliteMetaData.php b/framework/Data/Common/Sqlite/TSqliteMetaData.php
index aa2ed724..3b63fcef 100644
--- a/framework/Data/Common/Sqlite/TSqliteMetaData.php
+++ b/framework/Data/Common/Sqlite/TSqliteMetaData.php
@@ -177,5 +177,5 @@ CREATE TABLE bar
CONSTRAINT fk_foo_id REFERENCES foo(id) ON DELETE CASCADE
);
*/
-
+
?> \ No newline at end of file
diff --git a/framework/Data/Common/TDbMetaData.php b/framework/Data/Common/TDbMetaData.php
index 660e65f0..24079e6d 100644
--- a/framework/Data/Common/TDbMetaData.php
+++ b/framework/Data/Common/TDbMetaData.php
@@ -1,4 +1,4 @@
-<?php
+<?php
/**
* TDbMetaData class file.
*
@@ -64,7 +64,7 @@ abstract class TDbMetaData extends TComponent
case 'sqlite2': //sqlite 2
Prado::using('System.Data.Common.Sqlite.TSqliteMetaData');
return new TSqliteMetaData($conn);
- case 'mssql': // Mssql driver on windows hosts
+ case 'mssql': // Mssql driver on windows hosts
case 'dblib': // dblib drivers on linux (and maybe others os) hosts
Prado::using('System.Data.Common.Mssql.TMssqlMetaData');
return new TMssqlMetaData($conn);
@@ -120,5 +120,5 @@ abstract class TDbMetaData extends TComponent
return 'TDbTableInfo';
}
}
-
+
?> \ No newline at end of file