return true;
}
- function fields($table) {
+ function fields($table, $hidden = false) {
global $connection;
$return = array();
$result = $connection->query("SELECT c.*, t.name type, d.definition [default]
/** Get information about fields
* @param string
+ * @param bool display hidden table columns
* @return array array($name => array("field" => , "full_type" => , "type" => , "length" => , "unsigned" => , "default" => , "null" => , "auto_increment" => , "on_update" => , "collation" => , "privileges" => , "comment" => , "primary" => ))
*/
- function fields($table) {
+ function fields($table, $hidden = false) {
global $connection;
$return = array();
$result = $connection->query("SHOW FULL COLUMNS FROM " . table($table));
return true;
}
- function fields($table) {
+ function fields($table, $hidden = false) {
global $connection;
$return = array();
$result = $connection->query("SELECT * FROM all_tab_columns WHERE table_name = " . $connection->quote($table) . " ORDER BY column_id");
return true;
}
- function fields($table) {
+ function fields($table, $hidden = false) {
global $connection;
$return = array();
$result = $connection->query("SELECT a.attname AS field, format_type(a.atttypid, a.atttypmod) AS full_type, d.adsrc AS default, a.attnotnull, col_description(c.oid, a.attnum) AS comment
LEFT JOIN pg_attrdef d ON c.oid = d.adrelid AND a.attnum = d.adnum
WHERE c.relname = " . $connection->quote($table) . "
AND n.nspname = current_schema()
-AND a.attnum > 0
-ORDER BY a.attnum");
+AND NOT a.attisdropped
+" . ($hidden ? "" : "AND a.attnum > 0") . "
+ORDER BY a.attnum < 0, a.attnum"
+ );
if ($result) {
while ($row = $result->fetch_assoc()) {
//! collation, primary
return !$connection->result("SELECT sqlite_compileoption_used('OMIT_FOREIGN_KEY')");
}
- function fields($table) {
+ function fields($table, $hidden = false) {
global $connection;
$return = array();
$result = $connection->query("PRAGMA table_info(" . table($table) . ")");
$TABLE = $_GET["select"];
$table_status = table_status($TABLE);
$indexes = indexes($TABLE);
-$fields = fields($TABLE);
+$fields = fields($TABLE, 1); // 1 - hidden
$foreign_keys = column_foreign_keys($TABLE);
$rights = array(); // privilege => 0
$name = $adminer->fieldName($field);
if (isset($field["privileges"]["select"]) && $name != "") {
$columns[$key] = html_entity_decode(strip_tags($name));
- if (ereg('text|blob', $field["type"])) {
+ if (ereg('text|clob|blob', $field["type"])) {
$text_length = $adminer->selectLengthProcess();
}
}