Re: [Maria-developers] 59e1aaa: MDEV-7331 - information_schema.user_variables
Hi, Sergey! On Feb 24, Sergey Vojtovich wrote:
revision-id: 59e1aaa5f71cb725ce5242eb5abf2e00c6f5a793 (mariadb-10.1.8-124-g59e1aaa) parent(s): 0485328d030f4b742dac7b667e8ed099beb9e9f2 committer: Sergey Vojtovich timestamp: 2016-02-24 14:31:43 +0400 message:
+static ST_FIELD_INFO user_variables_fields_info[] = +{ + { "VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name", 0 }, + { "VARIABLE_VALUE", 2048, MYSQL_TYPE_STRING, 0, MY_I_S_MAYBE_NULL, "Value", 0 }, + { 0, 0, MYSQL_TYPE_NULL, 0, 0, 0, 0 } +};
1. As discussed on irc, let's show everything we know about variables. Hmm, let me see what's in user_var_entry structure... The type, the character set, signed/unsigned. I think, query_id would be not very useful, though. See COLUMNS and SYSTEM_VARIABLES for appropriate column names. 2. You have defined old_name's for columns - "Variable_name" and "Value". This automatically enables SHOW USER_VARIABLES statement. See https://mariadb.com/kb/en/mariadb/information-schema-plugins-show-and-flush-... You shouldn't enable SHOW if it displays exactly the same content as I_S.USER_VARIABLES. But if you'll add all the other metadata fields to the I_S table, then SHOW could be used to display a subset of the columns, e.g. only variable name and the value. Just as you have now :) 3. An interesting extension could be a FLUSH USER_VARIABLES statement that would empty the thd->user_vars hash. It's very easy to do, but I don't know if it'll be very useful :) See the url above for the API. Regards, Sergei Chief Architect MariaDB and security@mariadb.org
participants (1)
-
Sergei Golubchik