diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-17 05:26:10 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-02-17 05:26:10 +0000 |
commit | 2f097f48cb768a341784f22dbfd095c4d39ada18 (patch) | |
tree | cecac6f3560107185018ed824fd0e343fffe30d4 /includes/database | |
parent | dcb47ed24d54665f87ce61bb1f8dc9761a9f219b (diff) | |
download | brdo-2f097f48cb768a341784f22dbfd095c4d39ada18.tar.gz brdo-2f097f48cb768a341784f22dbfd095c4d39ada18.tar.bz2 |
#715906 by Damien Tournoud: Fixed Schema tests fail on PostgreSQL.
Diffstat (limited to 'includes/database')
-rw-r--r-- | includes/database/pgsql/schema.inc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/includes/database/pgsql/schema.inc b/includes/database/pgsql/schema.inc index d2e837d1e..53392c170 100644 --- a/includes/database/pgsql/schema.inc +++ b/includes/database/pgsql/schema.inc @@ -378,7 +378,8 @@ class DatabaseSchema_pgsql extends DatabaseSchema { } public function indexExists($table, $name) { - return $this->connection->query("SELECT COUNT(indexname) FROM pg_indexes WHERE indexname = '$name'")->fetchField(); + $index_name = $table . '_' . $name . '_idx'; + return $this->connection->query("SELECT COUNT(indexname) FROM pg_indexes WHERE indexname = '$index_name'")->fetchField(); } /** @@ -578,8 +579,10 @@ class DatabaseSchema_pgsql extends DatabaseSchema { $table = $this->connection->prefixTables('{' . $table . '}'); // Don't use {} around pg_class, pg_attribute tables. if (isset($column)) { - $this->connection->query('SELECT col_description(oid, attnum) FROM pg_class, pg_attribute WHERE attrelid = oid AND relname = ? AND attname = ?', array($table, $column))->fetchField(); + return $this->connection->query('SELECT col_description(oid, attnum) FROM pg_class, pg_attribute WHERE attrelid = oid AND relname = ? AND attname = ?', array($table, $column))->fetchField(); + } + else { + return $this->connection->query('SELECT obj_description(oid, ?) FROM pg_class WHERE relname = ?', array('pg_class', $table))->fetchField(); } - $this->connection->query('SELECT obj_description(oid, ?) FROM pg_class WHERE relname = ?', array('pg_class', $table))->fetchField(); } } |