]> git.joonet.de Git - adminer.git/commitdiff
Fix detecting oid column in PDO_PGSQL
authorJakub Vrana <jakub@vrana.cz>
Fri, 24 May 2013 04:05:45 +0000 (21:05 -0700)
committerJakub Vrana <jakub@vrana.cz>
Fri, 24 May 2013 04:05:45 +0000 (21:05 -0700)
adminer/drivers/pgsql.inc.php
adminer/drivers/sqlite.inc.php
adminer/select.inc.php
changes.txt

index 2d9eba6419be6df84cd45fa4872d72ea8fa963d1..a6997e2dc2b01f795acd66c031713b0bb4d2da14 100644 (file)
@@ -206,7 +206,7 @@ if (isset($_GET["pgsql"])) {
 
        function table_status($name = "") {
                $return = array();
-               foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids AS \"Oid\", reltuples as \"Rows\"
+               foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids::int AS \"Oid\", reltuples as \"Rows\"
 FROM pg_class
 WHERE relkind IN ('r','v')
 AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())"
index 03f4482194919e0a30ba060d8d61a5c8407f9ac6..5bd43edfb039bc48794b0e4147b72f2efab062f2 100644 (file)
@@ -254,7 +254,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                global $connection;
                $return = array();
                foreach (get_rows("SELECT name AS Name, type AS Engine FROM sqlite_master WHERE type IN ('table', 'view')" . ($name != "" ? " AND name = " . q($name) : "")) as $row) {
-                       $row["Oid"] = "t";
+                       $row["Oid"] = 1;
                        $row["Auto_increment"] = "";
                        $row["Rows"] = $connection->result("SELECT COUNT(*) FROM " . idf_escape($row["Name"]));
                        $return[$row["Name"]] = $row;
index 36fbe557cf59803b6b287eb0700b22bdb697fe9b..c9e9e565058efa01d884ff4bdb160b125e7d7645 100644 (file)
@@ -5,7 +5,7 @@ $indexes = indexes($TABLE);
 $fields = fields($TABLE);
 $foreign_keys = column_foreign_keys($TABLE);
 $oid = "";
-if ($table_status["Oid"] == "t") {
+if ($table_status["Oid"]) {
        $oid = ($jush == "sqlite" ? "rowid" : "oid");
        $indexes[] = array("type" => "PRIMARY", "columns" => array($oid));
 }
index b985e5913153558ead8dcdf04466c4a74bd53ad0..6f24878a0b11023c8780ea2352145b729fab22e7 100644 (file)
@@ -2,6 +2,7 @@ Adminer 3.7.1-dev:
 Increase click target for checkboxes
 Use shadow for highlighting default button
 PostgreSQL: Order table list by name
+PostgreSQL: Fix detecting oid column in PDO
 
 Adminer 3.7.0 (released 2013-05-19):
 Allow more SQL files to be uploaded at the same time
@@ -26,7 +27,7 @@ MySQL: Fix handling of POINT data type (bug #3582578)
 MySQL: Don't export binary and geometry columns twice in select
 MySQL: Fix EXPLAIN in MySQL < 5.1, bug since Adminer 3.6.4
 SQLite: Export views
-PostgreSQL: Fix swapped NULL and NOT NULL columns in weird setups
+PostgreSQL: Fix swapped NULL and NOT NULL columns in PDO
 
 Adminer 3.6.4 (released 2013-04-26):
 Display pagination on a fixed position