List:Internals« Previous MessageNext Message »
From:bar Date:August 30 2005 2:12pm
Subject:bk commit into 4.1 tree (bar:1.2394) BUG#12363
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bar. When bar 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.2394 05/08/30 17:11:59 bar@stripped +3 -0
  Bug#12363
  character_set_results is nullable, but value_ptr returns string "NULL"
  
  set_var.cc:
    Create Item_null instead of Item_string for NULL values
  
  variables.result, variables.test:
    adding test case

  mysql-test/r/variables.result
    1.62 05/08/30 17:11:16 bar@stripped +5 -0
    fixing tests accordingly

  mysql-test/t/variables.test
    1.50 05/08/30 17:11:07 bar@stripped +8 -0
    fixing tests accordingly

  sql/set_var.cc
    1.175 05/08/30 17:10:31 bar@stripped +10 -4
    Bug#12363
    character_set_results is nullable, but value_ptr returns string "NULL"
    Create Item_null instead of Item_string for NULL values

# 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:	bar
# Host:	bar.intranet.mysql.r18.ru
# Root:	/usr/home/bar/mysql-4.1

--- 1.61/mysql-test/r/variables.result	2005-07-25 23:25:23 +05:00
+++ 1.62/mysql-test/r/variables.result	2005-08-30 17:11:16 +05:00
@@ -491,3 +491,8 @@
 Variable_name	Value
 table_cache	1
 SET GLOBAL table_cache=DEFAULT;
+set character_set_results=NULL;
+select ifnull(@@character_set_results,"really null");
+ifnull(@@character_set_results,"really null")
+really null
+set names latin1;

--- 1.49/mysql-test/t/variables.test	2005-07-28 05:21:50 +05:00
+++ 1.50/mysql-test/t/variables.test	2005-08-30 17:11:07 +05:00
@@ -380,4 +380,12 @@
 SHOW VARIABLES LIKE 'table_cache';
 SET GLOBAL table_cache=DEFAULT;
 
+#
+# Bugs12363: character_set_results is nullable,
+# but value_ptr returns string "NULL"
+#
+set character_set_results=NULL;
+select ifnull(@@character_set_results,"really null");
+set names latin1;
+
 # End of 4.1 tests

--- 1.174/sql/set_var.cc	2005-08-28 07:52:10 +05:00
+++ 1.175/sql/set_var.cc	2005-08-30 17:10:31 +05:00
@@ -1598,11 +1598,17 @@
     return new Item_int((int32) *(my_bool*) value_ptr(thd, var_type, base),1);
   case SHOW_CHAR:
   {
-    Item_string *tmp;
+    Item *tmp;
     pthread_mutex_lock(&LOCK_global_system_variables);
     char *str= (char*) value_ptr(thd, var_type, base);
-    tmp= new Item_string(str, strlen(str),
-                         system_charset_info, DERIVATION_SYSCONST);
+    if (str)
+      tmp= new Item_string(str, strlen(str),
+                           system_charset_info, DERIVATION_SYSCONST);
+    else
+    {
+      tmp= new Item_null();
+      tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
+    }
     pthread_mutex_unlock(&LOCK_global_system_variables);
     return tmp;
   }
@@ -1892,7 +1898,7 @@
 				       LEX_STRING *base)
 {
   CHARSET_INFO *cs= ci_ptr(thd,type)[0];
-  return cs ? (byte*) cs->csname : (byte*) "NULL";
+  return cs ? (byte*) cs->csname : (byte*) NULL;
 }
 
 
Thread
bk commit into 4.1 tree (bar:1.2394) BUG#12363bar30 Aug