MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Jim Winstead Date:April 21 2006 4:56am
Subject:bk commit into 5.0 tree (jimw:1.2087) BUG#15684
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of jimw. When jimw 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
  1.2087 06/04/20 21:56:53 jimw@stripped +4 -0
  Bug #12792: @@system_time_zone is not SELECTable
  Bug #15684: @@version_* are not all SELECTable
  
    Added the appropriate information as read-only system variables, and
    also removed some special-case handling of @@version along the way.
  
    @@version_bdb was added, but isn't included in the test because it
    depends on the presence of BDB.

  sql/set_var.cc
    1.154 06/04/20 21:56:50 jimw@stripped +26 -7
    Add system_time_zone and various version-related system variables

  sql/item_func.cc
    1.279 06/04/20 21:56:50 jimw@stripped +0 -6
    Remove special-case handling of VERSION, it's just a read-only server
    variable like the others now.

  mysql-test/t/variables.test
    1.56 06/04/20 21:56:50 jimw@stripped +19 -2
    Fix error from setting @@version, reset sql_select_limit to avoid confusion
    in later tests, and add new regression tests.

  mysql-test/r/variables.result
    1.80 06/04/20 21:56:49 jimw@stripped +10 -1
    Update results

# 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:	jimw
# Host:	rama.(none)
# Root:	/home/jimw/my/mysql-5.0-12792

--- 1.278/sql/item_func.cc	2006-04-13 16:02:23 -07:00
+++ 1.279/sql/item_func.cc	2006-04-20 21:56:50 -07:00
@@ -4558,12 +4558,6 @@
   sys_var *var;
   LEX_STRING *base_name, *component_name;
 
-  if (component.str == 0 &&
-      !my_strcasecmp(system_charset_info, name.str, "VERSION"))
-    return new Item_string(NULL, server_version,
-			   (uint) strlen(server_version),
-			   system_charset_info, DERIVATION_SYSCONST);
-
   if (component.str)
   {
     base_name= &component;

--- 1.79/mysql-test/r/variables.result	2006-02-13 20:23:44 -08:00
+++ 1.80/mysql-test/r/variables.result	2006-04-20 21:56:49 -07:00
@@ -275,7 +275,7 @@
 select @@global.timestamp;
 ERROR HY000: Variable 'timestamp' is a SESSION variable
 set @@version='';
-ERROR HY000: Unknown system variable 'version'
+ERROR HY000: Variable 'version' is a read only variable
 set @@concurrent_insert=1;
 ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL
 set @@global.sql_auto_is_null=1;
@@ -384,6 +384,7 @@
 set sql_quote_show_create=1;
 set sql_safe_updates=1;
 set sql_select_limit=1;
+set sql_select_limit=default;
 set sql_warnings=1;
 set global table_cache=100;
 set storage_engine=myisam;
@@ -584,3 +585,11 @@
 select @@global.character_set_filesystem;
 @@global.character_set_filesystem
 binary
+select @@system_time_zone;
+@@system_time_zone
+#
+select @@version, @@version_comment, @@version_compile_machine,
+@@version_compile_os;
+@@version	@@version_comment	@@version_compile_machine	@@version_compile_os
+#	#	#	#
+End of 5.0 tests

--- 1.55/mysql-test/t/variables.test	2006-03-22 07:47:41 -08:00
+++ 1.56/mysql-test/t/variables.test	2006-04-20 21:56:50 -07:00
@@ -169,7 +169,7 @@
 set global autocommit=1;
 --error 1238
 select @@global.timestamp;
---error 1193
+--error 1238 
 set @@version='';
 --error 1229
 set @@concurrent_insert=1;
@@ -258,6 +258,8 @@
 set sql_quote_show_create=1;
 set sql_safe_updates=1;
 set sql_select_limit=1;
+# reset it, so later tests don't get confused
+set sql_select_limit=default;
 set sql_warnings=1;
 set global table_cache=100;
 set storage_engine=myisam;
@@ -472,4 +474,19 @@
 set @@global.character_set_filesystem=default;
 select @@global.character_set_filesystem;
 
-# End of 5.0 tests
+#
+# Bug #12792: @@system_time_zone is not SELECTable.
+#
+# Don't actually output, since it depends on the system
+--replace_column 1 #
+select @@system_time_zone;
+
+#
+# Bug #15684: system variables cannot be SELECTed (e.g. @@version_comment)
+#
+# Don't actually output, since it depends on the system
+--replace_column 1 # 2 # 3 # 4 #
+select @@version, @@version_comment, @@version_compile_machine,
+       @@version_compile_os;
+
+--echo End of 5.0 tests

--- 1.153/sql/set_var.cc	2006-04-13 00:25:52 -07:00
+++ 1.154/sql/set_var.cc	2006-04-20 21:56:50 -07:00
@@ -377,6 +377,8 @@
 sys_var_thd_storage_engine sys_storage_engine("storage_engine",
 				       &SV::table_type);
 sys_var_bool_ptr	sys_sync_frm("sync_frm", &opt_sync_frm);
+sys_var_const_str	sys_system_time_zone("system_time_zone",
+                                             system_time_zone);
 sys_var_long_ptr	sys_table_cache_size("table_cache",
 					     &table_cache_size);
 sys_var_long_ptr	sys_table_lock_wait_timeout("table_lock_wait_timeout",
@@ -391,6 +393,16 @@
 					   &SV::tmp_table_size);
 sys_var_bool_ptr  sys_timed_mutexes("timed_mutexes",
                                     &timed_mutexes);
+sys_var_const_str	sys_version("version", server_version);
+#ifdef HAVE_BERKELEY_DB
+sys_var_const_str	sys_version_bdb("version_bdb", DB_VERSION_STRING);
+#endif
+sys_var_const_str	sys_version_comment("version_comment",
+                                            MYSQL_COMPILATION_COMMENT);
+sys_var_const_str	sys_version_compile_machine("version_compile_machine",
+                                                    MACHINE_TYPE);
+sys_var_const_str	sys_version_compile_os("version_compile_os",
+                                               SYSTEM_TYPE);
 sys_var_thd_ulong	sys_net_wait_timeout("wait_timeout",
 					     &SV::net_wait_timeout);
 
@@ -546,7 +558,6 @@
 
 /* Read only variables */
 
-sys_var_const_str		sys_os("version_compile_os", SYSTEM_TYPE);
 sys_var_readonly                sys_have_innodb("have_innodb", OPT_GLOBAL,
                                                 SHOW_CHAR, get_have_innodb);
 /* Global read-only variable describing server license */
@@ -698,6 +709,7 @@
   &sys_sql_notes,
   &sys_storage_engine,
   &sys_sync_frm,
+  &sys_system_time_zone,
   &sys_table_cache_size,
   &sys_table_lock_wait_timeout,
   &sys_table_type,
@@ -710,7 +722,13 @@
   &sys_trans_alloc_block_size,
   &sys_trans_prealloc_size,
   &sys_tx_isolation,
-  &sys_os,
+  &sys_version,
+#ifdef HAVE_BERKELEY_DB
+  &sys_version_bdb,
+#endif
+  &sys_version_comment,
+  &sys_version_compile_machine,
+  &sys_version_compile_os,
 #ifdef HAVE_INNOBASE_DB
   &sys_innodb_fast_shutdown,
   &sys_innodb_max_dirty_pages_pct,
@@ -1015,13 +1033,14 @@
   {sys_tx_isolation.name,     (char*) &sys_tx_isolation,	    SHOW_SYS},
   {sys_updatable_views_with_limit.name,
                               (char*) &sys_updatable_views_with_limit,SHOW_SYS},
-  {"version",                 server_version,                       SHOW_CHAR},
+  {sys_version.name,          (char*) &sys_version,                 SHOW_SYS},
 #ifdef HAVE_BERKELEY_DB
-  {"version_bdb",             (char*) DB_VERSION_STRING,            SHOW_CHAR},
+  {sys_version_bdb.name,      (char*) &sys_version_bdb,             SHOW_SYS},
 #endif
-  {"version_comment",         (char*) MYSQL_COMPILATION_COMMENT,    SHOW_CHAR},
-  {"version_compile_machine", (char*) MACHINE_TYPE,		    SHOW_CHAR},
-  {sys_os.name,		      (char*) &sys_os,			    SHOW_SYS},
+  {sys_version_comment.name,  (char*) &sys_version_comment,         SHOW_SYS},
+  {sys_version_compile_machine.name, (char*) &sys_version_compile_machine,
+   SHOW_SYS},
+  {sys_version_compile_os.name,	(char*) &sys_version_compile_os,    SHOW_SYS},
   {sys_net_wait_timeout.name, (char*) &sys_net_wait_timeout,	    SHOW_SYS},
   {NullS, NullS, SHOW_LONG}
 };
Thread
bk commit into 5.0 tree (jimw:1.2087) BUG#15684Jim Winstead21 Apr