List:Commits« Previous MessageNext Message »
From:gluh Date:May 10 2007 12:29pm
Subject:bk commit into 5.1 tree (gluh:1.2512)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of gluh. When gluh does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-10 17:29:12+05:00, gluh@stripped +7 -0
  WL#3823 Modify VARIABLE_VALUE columns to VARCHAR within INFORMATION_SCHEMA STATUS tables

  mysql-test/r/compress.result@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +2 -2
    result fix

  mysql-test/r/information_schema.result@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +0 -2
    result fix

  mysql-test/r/openssl_1.result@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +2 -2
    result fix

  mysql-test/r/rpl_packet.result@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +1 -1
    result fix

  mysql-test/r/status.result@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +9 -9
    result fix

  sql/sql_select.cc@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +1 -2
    WL#3823 Modify VARIABLE_VALUE columns to VARCHAR within INFORMATION_SCHEMA STATUS tables

  sql/sql_show.cc@stripped, 2007-05-10 17:29:10+05:00, gluh@stripped +46 -202
    WL#3823 Modify VARIABLE_VALUE columns to VARCHAR within INFORMATION_SCHEMA STATUS tables

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	gluh
# Host:	eagle.(none)
# Root:	/home/gluh/MySQL/WL/5.1.3823

--- 1.518/sql/sql_select.cc	2007-05-08 00:32:04 +05:00
+++ 1.519/sql/sql_select.cc	2007-05-10 17:29:10 +05:00
@@ -9133,8 +9133,7 @@ Field *create_tmp_field_for_schema(THD *
   if (item->field_type() == MYSQL_TYPE_VARCHAR)
   {
     Field *field;
-    if (item->max_length > MAX_FIELD_VARCHARLENGTH /
-        item->collation.collation->mbmaxlen)
+    if (item->max_length > MAX_FIELD_VARCHARLENGTH)
       field= new Field_blob(item->max_length, item->maybe_null,
                             item->name, item->collation.collation);
     else

--- 1.409/sql/sql_show.cc	2007-05-05 11:20:33 +05:00
+++ 1.410/sql/sql_show.cc	2007-05-10 17:29:10 +05:00
@@ -4516,9 +4516,19 @@ int fill_variables(THD *thd, TABLE_LIST 
   int res= 0;
   LEX *lex= thd->lex;
   const char *wild= lex->wild ? lex->wild->ptr() : NullS;
+  enum enum_schema_tables schema_table_idx=
+    get_schema_table_idx(tables->schema_table);
+  enum enum_var_type option_type= OPT_SESSION;
+  bool upper_case_names= (schema_table_idx != SCH_VARIABLES);
+  bool sorted_vars= (schema_table_idx == SCH_VARIABLES);
+
+  if (lex->option_type == OPT_GLOBAL ||
+      schema_table_idx == SCH_GLOBAL_VARIABLES)
+    option_type= OPT_GLOBAL;
+
   rw_rdlock(&LOCK_system_variables_hash);
-  res= show_status_array(thd, wild, enumerate_sys_vars(thd, TRUE),
-                         lex->option_type, 0, "", tables->table, 0);
+  res= show_status_array(thd, wild, enumerate_sys_vars(thd, sorted_vars),
+                         option_type, NULL, "", tables->table, upper_case_names);
   rw_unlock(&LOCK_system_variables_hash);
   DBUG_RETURN(res);
 }
@@ -4530,16 +4540,34 @@ int fill_status(THD *thd, TABLE_LIST *ta
   LEX *lex= thd->lex;
   const char *wild= lex->wild ? lex->wild->ptr() : NullS;
   int res= 0;
-  STATUS_VAR tmp;
+  STATUS_VAR *tmp1, tmp;
+  enum enum_schema_tables schema_table_idx=
+    get_schema_table_idx(tables->schema_table);
+  enum enum_var_type option_type;
+  bool upper_case_names= (schema_table_idx != SCH_STATUS);
+
+  if (lex->option_type == OPT_GLOBAL ||
+      schema_table_idx == SCH_GLOBAL_STATUS)
+  {
+    option_type= OPT_GLOBAL;
+    tmp1= &tmp;
+  }
+  else
+  {
+    option_type= OPT_SESSION;
+    if (schema_table_idx == SCH_SESSION_STATUS)
+      tmp1= &thd->status_var;
+    else
+      tmp1= thd->initial_status_var;
+  }
+
   pthread_mutex_lock(&LOCK_status);
-  if (lex->option_type == OPT_GLOBAL)
+  if (option_type == OPT_GLOBAL)
     calc_sum_of_all_status(&tmp);
   res= show_status_array(thd, wild,
                          (SHOW_VAR *)all_status_vars.buffer,
-                         OPT_GLOBAL,
-                         (lex->option_type == OPT_GLOBAL ?
-                          &tmp: thd->initial_status_var),
-                         "", tables->table, 0);
+                         option_type, tmp1, "", tables->table,
+                         upper_case_names);
   pthread_mutex_unlock(&LOCK_status);
   DBUG_RETURN(res);
 }
@@ -4782,12 +4810,10 @@ TABLE *create_schema_table(THD *thd, TAB
       /* Don't let unimplemented types pass through. Could be a grave error. */
       DBUG_ASSERT(fields_info->field_type == MYSQL_TYPE_STRING);
 
-      /* this should be changed when Item_empty_string is fixed(in 4.1) */
-      if (!(item= new Item_empty_string("", 0, cs)))
+      if (!(item= new Item_empty_string("", fields_info->field_length, cs)))
       {
         DBUG_RETURN(0);
       }
-      item->max_length= fields_info->field_length * cs->mbmaxlen;
       item->set_name(fields_info->field_name,
                      strlen(fields_info->field_name), cs);
       break;
@@ -5228,172 +5254,6 @@ int fill_schema_files(THD *thd, TABLE_LI
   DBUG_RETURN(0);
 }
 
-int fill_schema_status(THD *thd, SHOW_VAR *variables,
-                       struct system_status_var *status_var,
-                       const char *prefix, TABLE *table)
-{
-  SHOW_VAR tmp, *var;
-  SHOW_TYPE show_type;
-  LEX_STRING null_lex_str;
-  char buff[SHOW_VAR_FUNC_BUFF_SIZE];
-  char name_buf[64], *name_pos;
-  int name_len;
-  DBUG_ENTER("fill_schema_status");
-  
-  null_lex_str.str= 0;
-  null_lex_str.length= 0;
-  
-  name_pos= strnmov(name_buf, prefix, sizeof(name_buf) - 1);
-  if (*prefix)
-    *name_pos++= '_';
-  name_len= name_buf + sizeof(name_buf) - name_pos;
-  
-  for (; variables->name; variables++)
-  {
-    strnmov(name_pos, variables->name, name_len);
-    name_buf[sizeof(name_buf) - 1]= 0;
-    make_upper(name_buf);
-    
-    for (var= variables; var->type == SHOW_FUNC; var= &tmp)
-      ((mysql_show_var_func)(var->value))(thd, &tmp, buff);
-      
-    show_type= var->type;
-    
-    if (show_type == SHOW_ARRAY)
-    {
-      fill_schema_status(thd, (SHOW_VAR*) var->value,
-                         status_var, name_buf, table);
-    }
-    else
-    {
-      char *value= var->value;
-      
-      restore_record(table, s->default_values);
-      table->field[0]->store(name_buf, strlen(name_buf), system_charset_info);
-      
-      if (show_type == SHOW_SYS)
-      {
-        show_type= ((sys_var*) value)->show_type();
-        value= (char*) ((sys_var*) value)->value_ptr(thd, OPT_GLOBAL,
-                                                     &null_lex_str);
-      }
-                                                     
-      switch (show_type)
-      {
-      case SHOW_DOUBLE_STATUS:
-        value= (char*) status_var + (ulong) value;
-        table->field[1]->store(*(double*) value);
-        break;
-      case SHOW_LONG_STATUS:
-        value= (char*) status_var + (ulong) value;
-        /* fall through */
-      case SHOW_LONG:
-      case SHOW_LONG_NOFLUSH: /* the difference lies in refresh_status() */
-        table->field[1]->store((longlong) *(long*) value, false);
-        break;
-      case SHOW_LONGLONG:
-        table->field[1]->store(*(longlong*) value, false);
-        break;
-      case SHOW_HA_ROWS:
-        table->field[1]->store((longlong) *(ha_rows*) value, false);
-        break;
-      case SHOW_BOOL:
-        table->field[1]->store((longlong) *(bool*) value, false);
-        break;
-      case SHOW_MY_BOOL:
-        table->field[1]->store((longlong) *(my_bool*) value, false);
-        break;
-      case SHOW_INT:
-        table->field[1]->store((longlong) *(uint32*) value, false);
-        break;
-      case SHOW_HAVE: /* always displayed as 0 */
-        table->field[1]->store((longlong) 0, false);
-        break;
-      case SHOW_CHAR_PTR:
-        value= *(char**) value;
-        /* fall through */
-      case SHOW_CHAR: /* always displayed as 0 */
-        table->field[1]->store((longlong) 0, false);
-        break;
-      case SHOW_KEY_CACHE_LONG:
-        value= (char*) dflt_key_cache + (ulong) value;
-        table->field[1]->store((longlong) *(long*) value, false);
-        break;
-      case SHOW_KEY_CACHE_LONGLONG:
-        value= (char*) dflt_key_cache + (ulong) value;
-        table->field[1]->store(*(longlong*) value, false);
-        break;
-      case SHOW_UNDEF: /* always displayed as 0 */
-        table->field[1]->store((longlong) 0, false);
-        break;
-      case SHOW_SYS: /* cannot happen */
-      default:
-        DBUG_ASSERT(0);
-        break;
-      }
-      
-      table->field[1]->set_notnull();
-      if (schema_table_store_record(thd, table))
-        DBUG_RETURN(1);
-    }
-  }
-  
-  DBUG_RETURN(0);
-}
-
-int fill_schema_global_status(THD *thd, TABLE_LIST *tables, COND *cond)
-{
-  STATUS_VAR tmp;
-  int res= 0;
-  DBUG_ENTER("fill_schema_global_status");
-  
-  pthread_mutex_lock(&LOCK_status);
-  calc_sum_of_all_status(&tmp);
-  res= fill_schema_status(thd, (SHOW_VAR*) all_status_vars.buffer,
-                          &tmp, "", tables->table);
-  pthread_mutex_unlock(&LOCK_status);
-  
-  DBUG_RETURN(res);
-}
-
-int fill_schema_session_status(THD *thd, TABLE_LIST *tables, COND *cond)
-{
-  int res= 0;
-  DBUG_ENTER("fill_schema_session_status");
-  
-  pthread_mutex_lock(&LOCK_status);
-  res= fill_schema_status(thd, (SHOW_VAR*) all_status_vars.buffer,
-                          &thd->status_var, "", tables->table);
-  pthread_mutex_unlock(&LOCK_status);
-  
-  DBUG_RETURN(res);
-}
-
-int fill_schema_global_variables(THD *thd, TABLE_LIST *tables, COND *cond)
-{
-  int res= 0;
-  DBUG_ENTER("fill_schema_global_variables");
-  
-  rw_rdlock(&LOCK_system_variables_hash);
-  res= show_status_array(thd, "", enumerate_sys_vars(thd, FALSE), OPT_GLOBAL,
-                         NULL, "", tables->table, 1);
-  rw_unlock(&LOCK_system_variables_hash);
-  
-  DBUG_RETURN(res);
-}
-
-int fill_schema_session_variables(THD *thd, TABLE_LIST *tables, COND *cond)
-{
-  int res= 0;
-  DBUG_ENTER("fill_schema_session_variables");
-  
-  rw_rdlock(&LOCK_system_variables_hash);
-  res= show_status_array(thd, "", enumerate_sys_vars(thd, FALSE), OPT_SESSION,
-                         NULL, "", tables->table, 1);
-  rw_unlock(&LOCK_system_variables_hash);
-  
-  DBUG_RETURN(res);
-}
 
 ST_FIELD_INFO schema_fields_info[]=
 {
@@ -5763,24 +5623,8 @@ ST_FIELD_INFO partitions_fields_info[]=
 
 ST_FIELD_INFO variables_fields_info[]=
 {
-  {"Variable_name", 80, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
-  {"Value", FN_REFLEN, MYSQL_TYPE_STRING, 0, 0, "Value"},
-  {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
-};
-
-
-ST_FIELD_INFO status_fields_info[]=
-{
-  {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
-  {"VARIABLE_VALUE", 2207, MYSQL_TYPE_DECIMAL, 0, 0, "Value"},
-  {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
-};
-
-
-ST_FIELD_INFO system_variables_fields_info[]=
-{
   {"VARIABLE_NAME", 64, MYSQL_TYPE_STRING, 0, 0, "Variable_name"},
-  {"VARIABLE_VALUE", 65535, MYSQL_TYPE_STRING, 0, 1, "Value"},
+  {"VARIABLE_VALUE", 20480, MYSQL_TYPE_STRING, 0, 1, "Value"},
   {0, 0, MYSQL_TYPE_STRING, 0, 0, 0}
 };
 
@@ -5920,10 +5764,10 @@ ST_SCHEMA_TABLE schema_tables[]=
    Events::fill_schema_events, make_old_format, 0, -1, -1, 0},
   {"FILES", files_fields_info, create_schema_table,
    fill_schema_files, 0, 0, -1, -1, 0},
-  {"GLOBAL_STATUS", status_fields_info, create_schema_table,
-   fill_schema_global_status, make_old_format, 0, -1, -1, 0},
-  {"GLOBAL_VARIABLES", system_variables_fields_info, create_schema_table,
-   fill_schema_global_variables, make_old_format, 0, -1, -1, 0},
+  {"GLOBAL_STATUS", variables_fields_info, create_schema_table,
+   fill_status, make_old_format, 0, -1, -1, 0},
+  {"GLOBAL_VARIABLES", variables_fields_info, create_schema_table,
+   fill_variables, make_old_format, 0, -1, -1, 0},
   {"KEY_COLUMN_USAGE", key_column_usage_fields_info, create_schema_table,
     get_all_tables, 0, get_schema_key_column_usage_record, 4, 5, 0},
   {"OPEN_TABLES", open_tables_fields_info, create_schema_table,
@@ -5943,10 +5787,10 @@ ST_SCHEMA_TABLE schema_tables[]=
    fill_schema_shemata, make_schemata_old_format, 0, 1, -1, 0},
   {"SCHEMA_PRIVILEGES", schema_privileges_fields_info, create_schema_table,
     fill_schema_schema_privileges, 0, 0, -1, -1, 0},
-  {"SESSION_STATUS", status_fields_info, create_schema_table,
-    fill_schema_session_status, make_old_format, 0, -1, -1, 0},
-  {"SESSION_VARIABLES", system_variables_fields_info, create_schema_table,
-    fill_schema_session_variables, make_old_format, 0, -1, -1, 0},
+  {"SESSION_STATUS", variables_fields_info, create_schema_table,
+    fill_status, make_old_format, 0, -1, -1, 0},
+  {"SESSION_VARIABLES", variables_fields_info, create_schema_table,
+    fill_variables, make_old_format, 0, -1, -1, 0},
   {"STATISTICS", stat_fields_info, create_schema_table, 
     get_all_tables, make_old_format, get_schema_stat_record, 1, 2, 0},
   {"STATUS", variables_fields_info, create_schema_table, fill_status, 

--- 1.6/mysql-test/r/rpl_packet.result	2007-04-07 14:55:23 +05:00
+++ 1.7/mysql-test/r/rpl_packet.result	2007-05-10 17:29:10 +05:00
@@ -19,7 +19,7 @@ Variable_name	Value
 Slave_running	ON
 select * from information_schema.session_status where variable_name= 'SLAVE_RUNNING';
 VARIABLE_NAME	VARIABLE_VALUE
-SLAVE_RUNNING	1.0000000
+SLAVE_RUNNING	ON
 drop database DB_NAME_OF_MAX_LENGTH_AKA_NAME_LEN_64_BYTES_____________________;
 SET @@global.max_allowed_packet=4096;
 SET @@global.net_buffer_length=4096;

--- 1.152/mysql-test/r/information_schema.result	2007-05-04 20:06:04 +05:00
+++ 1.153/mysql-test/r/information_schema.result	2007-05-10 17:29:10 +05:00
@@ -761,7 +761,6 @@ information_schema	COLUMNS	COLUMN_DEFAUL
 information_schema	COLUMNS	COLUMN_TYPE
 information_schema	EVENTS	EVENT_DEFINITION
 information_schema	EVENTS	SQL_MODE
-information_schema	GLOBAL_VARIABLES	VARIABLE_VALUE
 information_schema	PARTITIONS	PARTITION_EXPRESSION
 information_schema	PARTITIONS	SUBPARTITION_EXPRESSION
 information_schema	PARTITIONS	PARTITION_DESCRIPTION
@@ -769,7 +768,6 @@ information_schema	PLUGINS	PLUGIN_DESCRI
 information_schema	PROCESSLIST	INFO
 information_schema	ROUTINES	ROUTINE_DEFINITION
 information_schema	ROUTINES	SQL_MODE
-information_schema	SESSION_VARIABLES	VARIABLE_VALUE
 information_schema	TRIGGERS	ACTION_CONDITION
 information_schema	TRIGGERS	ACTION_STATEMENT
 information_schema	TRIGGERS	SQL_MODE

--- 1.9/mysql-test/r/compress.result	2007-05-04 20:06:04 +05:00
+++ 1.10/mysql-test/r/compress.result	2007-05-10 17:29:10 +05:00
@@ -2,8 +2,8 @@ SHOW STATUS LIKE 'Compression';
 Variable_name	Value
 Compression	ON
 select * from information_schema.session_status where variable_name= 'COMPRESSION';
-VARIABLE_NAME	VARIABLE_VALUE
-COMPRESSION	1.0000000
+VARIABLE_NAME	VALUE
+COMPRESSION	ON
 drop table if exists t1,t2,t3,t4;
 CREATE TABLE t1 (
 Period smallint(4) unsigned zerofill DEFAULT '0000' NOT NULL,

--- 1.15/mysql-test/r/status.result	2006-09-21 05:44:54 +05:00
+++ 1.16/mysql-test/r/status.result	2007-05-10 17:29:10 +05:00
@@ -5,8 +5,8 @@ Table_locks_immediate	0
 Table_locks_waited	0
 select * from information_schema.session_status where variable_name like 'Table_lock%';
 VARIABLE_NAME	VARIABLE_VALUE
-TABLE_LOCKS_IMMEDIATE	0.0000000
-TABLE_LOCKS_WAITED	0.0000000
+TABLE_LOCKS_IMMEDIATE	0
+TABLE_LOCKS_WAITED	0
 SET SQL_LOG_BIN=0;
 drop table if exists t1;
 create table t1(n int) engine=myisam;
@@ -22,8 +22,8 @@ Table_locks_immediate	3
 Table_locks_waited	1
 select * from information_schema.session_status where variable_name like 'Table_lock%';
 VARIABLE_NAME	VARIABLE_VALUE
-TABLE_LOCKS_IMMEDIATE	3.0000000
-TABLE_LOCKS_WAITED	1.0000000
+TABLE_LOCKS_IMMEDIATE	3
+TABLE_LOCKS_WAITED	1
 drop table t1;
 select 1;
 1
@@ -63,7 +63,7 @@ Variable_name	Value
 Max_used_connections	1
 SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 VARIABLE_NAME	VARIABLE_VALUE
-MAX_USED_CONNECTIONS	1.0000000
+MAX_USED_CONNECTIONS	1
 SET @save_thread_cache_size=@@thread_cache_size;
 SET GLOBAL thread_cache_size=3;
 SHOW STATUS LIKE 'max_used_connections';
@@ -71,26 +71,26 @@ Variable_name	Value
 Max_used_connections	3
 SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 VARIABLE_NAME	VARIABLE_VALUE
-MAX_USED_CONNECTIONS	3.0000000
+MAX_USED_CONNECTIONS	3
 FLUSH STATUS;
 SHOW STATUS LIKE 'max_used_connections';
 Variable_name	Value
 Max_used_connections	2
 SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 VARIABLE_NAME	VARIABLE_VALUE
-MAX_USED_CONNECTIONS	2.0000000
+MAX_USED_CONNECTIONS	2
 SHOW STATUS LIKE 'max_used_connections';
 Variable_name	Value
 Max_used_connections	3
 SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 VARIABLE_NAME	VARIABLE_VALUE
-MAX_USED_CONNECTIONS	3.0000000
+MAX_USED_CONNECTIONS	3
 SHOW STATUS LIKE 'max_used_connections';
 Variable_name	Value
 Max_used_connections	4
 SELECT * FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME LIKE 'max_used_connections';
 VARIABLE_NAME	VARIABLE_VALUE
-MAX_USED_CONNECTIONS	4.0000000
+MAX_USED_CONNECTIONS	4
 SET GLOBAL thread_cache_size=@save_thread_cache_size;
 show status like 'com_show_status';
 Variable_name	Value

--- 1.22/mysql-test/r/openssl_1.result	2007-04-12 17:29:08 +05:00
+++ 1.23/mysql-test/r/openssl_1.result	2007-05-10 17:29:10 +05:00
@@ -73,8 +73,8 @@ variable_name LIKE 'SSL_CALLBACK_CACHE_H
 END$$
 SELECT variable_name, variable_value FROM thread_status;
 variable_name	variable_value
-SSL_ACCEPTS	0.0000000
-SSL_CALLBACK_CACHE_HITS	0.0000000
+SSL_ACCEPTS	0
+SSL_CALLBACK_CACHE_HITS	0
 DROP TABLE thread_status;
 SET GLOBAL event_scheduler=0;
 End of 5.1 tests
Thread
bk commit into 5.1 tree (gluh:1.2512)gluh10 May