summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-04-09 14:28:07 +0200
committerSergei Golubchik <sergii@pisem.net>2014-04-09 14:28:07 +0200
commit32b3c9f35de3e52695d7d8d6dc0b34ff9c097733 (patch)
tree618eda633ab098b1a432ec29b4ac2243ef8e552a /sql
parentab157e4556ef2c46de6d4a1f29a024ae58e4d4aa (diff)
downloadmariadb-git-32b3c9f35de3e52695d7d8d6dc0b34ff9c097733.tar.gz
Make THDVAR_INT variables to be signed in SELECT in SHOW
Diffstat (limited to 'sql')
-rw-r--r--sql/sql_plugin.cc14
-rw-r--r--sql/sql_show.cc2
2 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc
index fa10699ca55..56f335c2359 100644
--- a/sql/sql_plugin.cc
+++ b/sql/sql_plugin.cc
@@ -3165,15 +3165,21 @@ static void plugin_vars_free_values(sys_var *vars)
static SHOW_TYPE pluginvar_show_type(st_mysql_sys_var *plugin_var)
{
- switch (plugin_var->flags & PLUGIN_VAR_TYPEMASK) {
+ switch (plugin_var->flags & (PLUGIN_VAR_TYPEMASK | PLUGIN_VAR_UNSIGNED)) {
case PLUGIN_VAR_BOOL:
return SHOW_MY_BOOL;
case PLUGIN_VAR_INT:
- return SHOW_INT;
+ return SHOW_SINT;
+ case PLUGIN_VAR_INT | PLUGIN_VAR_UNSIGNED:
+ return SHOW_UINT;
case PLUGIN_VAR_LONG:
- return SHOW_LONG;
+ return SHOW_SLONG;
+ case PLUGIN_VAR_LONG | PLUGIN_VAR_UNSIGNED:
+ return SHOW_ULONG;
case PLUGIN_VAR_LONGLONG:
- return SHOW_LONGLONG;
+ return SHOW_SLONGLONG;
+ case PLUGIN_VAR_LONGLONG | PLUGIN_VAR_UNSIGNED:
+ return SHOW_ULONGLONG;
case PLUGIN_VAR_STR:
return SHOW_CHAR_PTR;
case PLUGIN_VAR_ENUM:
diff --git a/sql/sql_show.cc b/sql/sql_show.cc
index 91e1693fb94..1890daa4215 100644
--- a/sql/sql_show.cc
+++ b/sql/sql_show.cc
@@ -2703,7 +2703,7 @@ static bool show_status_array(THD *thd, const char *wild,
end= int10_to_str((long) *(uint*) value, buff, 10);
break;
case SHOW_SINT:
- end= int10_to_str((long) *(uint*) value, buff, -10);
+ end= int10_to_str((long) *(int*) value, buff, -10);
break;
case SHOW_SLONG:
end= int10_to_str(*(long*) value, buff, -10);