Bug #69022 add one column in "show variables" to show the read-only attribute
Submitted: 21 Apr 2013 11:56 Modified: 21 Apr 2013 12:04
Reporter: xiaobin lin (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Options Severity:S4 (Feature request)
Version:5.5+ OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution, read-only, show variables

[21 Apr 2013 11:56] xiaobin lin
Description:
A new column in the result of "show variables" to show whether the variable is read-only.

How to repeat:
as above

Suggested fix:
simple patch based on 5.6.10

--- sql/sql_show.cc     (revision 1)
+++ sql/sql_show.cc     (working copy)
@@ -2589,6 +2589,8 @@
         thd->count_cuted_fields= CHECK_FIELD_IGNORE;
         table->field[1]->set_notnull();

+        table->field[2]->store(((sys_var *)(var->value))->is_readonly() ? "Y" : "N", 1, charset);
+
         mysql_mutex_unlock(&LOCK_global_system_variables);

         if (schema_table_store_record(thd, table))
@@ -7768,6 +7770,7 @@
   {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name",
    SKIP_OPEN_TABLE},
   {"VARIABLE_VALUE", 1024, MYSQL_TYPE_STRING, 0, 1, "Value", SKIP_OPEN_TABLE},
+  {"READ-ONLY", 64, MYSQL_TYPE_STRING, 0, 0, "Read_only", SKIP_OPEN_TABLE},
   {0, 0, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}
 };
[21 Apr 2013 12:04] MySQL Verification Team
Thank you for a feature request and contribution!