List:Internals« Previous MessageNext Message »
From:Jim Winstead Date:October 7 2005 12:37am
Subject:bk commit into 5.0 tree (jimw:1.2024) BUG#13650
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.2024 05/10/06 17:37:24 jimw@stripped +3 -0
  Fix use of "%*s" *printf() specifiers that were really meant to be
  "%.*s". (Bug #13650)

  sql/sp_head.cc
    1.189 05/10/06 17:37:20 jimw@stripped +2 -2
    Fix print specifiers for strings. %*s sets the minimum width of the
    string from a variable, %.*s sets the maximum width.

  sql/sp_cache.cc
    1.15 05/10/06 17:37:20 jimw@stripped +1 -1
    Fix print specifiers for strings. %*s sets the minimum width of the
    string from a variable, %.*s sets the maximum width.

  sql/sp.cc
    1.96 05/10/06 17:37:20 jimw@stripped +16 -15
    Fix print specifiers for strings. %*s sets the minimum width of the
    string from a variable, %.*s sets the maximum width.

# 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-13650

--- 1.95/sql/sp.cc	2005-09-15 12:29:01 -07:00
+++ 1.96/sql/sp.cc	2005-10-06 17:37:20 -07:00
@@ -208,7 +208,7 @@
 {
   byte key[MAX_KEY_LENGTH];	// db, name, optional key length type
   DBUG_ENTER("db_find_routine_aux");
-  DBUG_PRINT("enter", ("type: %d name: %*s",
+  DBUG_PRINT("enter", ("type: %d name: %.*s",
 		       type, name->m_name.length, name->m_name.str));
 
   /*
@@ -275,7 +275,7 @@
   ulong sql_mode;
   Open_tables_state open_tables_state_backup;
   DBUG_ENTER("db_find_routine");
-  DBUG_PRINT("enter", ("type: %d name: %*s",
+  DBUG_PRINT("enter", ("type: %d name: %.*s",
 		       type, name->m_name.length, name->m_name.str));
 
   *sphp= 0;                                     // In case of errors
@@ -479,7 +479,8 @@
   char olddb[128];
   bool dbchanged;
   DBUG_ENTER("db_create_routine");
-  DBUG_PRINT("enter", ("type: %d name: %*s",type,sp->m_name.length,sp->m_name.str));
+  DBUG_PRINT("enter", ("type: %d name: %.*s",type,sp->m_name.length,
+                       sp->m_name.str));
 
   dbchanged= FALSE;
   if ((ret= sp_use_new_db(thd, sp->m_db.str, olddb, sizeof(olddb),
@@ -606,7 +607,7 @@
   TABLE *table;
   int ret;
   DBUG_ENTER("db_drop_routine");
-  DBUG_PRINT("enter", ("type: %d name: %*s",
+  DBUG_PRINT("enter", ("type: %d name: %.*s",
 		       type, name->m_name.length, name->m_name.str));
 
   if (!(table= open_proc_table_for_update(thd)))
@@ -628,7 +629,7 @@
   int ret;
   bool opened;
   DBUG_ENTER("db_update_routine");
-  DBUG_PRINT("enter", ("type: %d name: %*s",
+  DBUG_PRINT("enter", ("type: %d name: %.*s",
 		       type, name->m_name.length, name->m_name.str));
 
   if (!(table= open_proc_table_for_update(thd)))
@@ -922,7 +923,7 @@
 {
   sp_head *sp;
   DBUG_ENTER("sp_find_procedure");
-  DBUG_PRINT("enter", ("name: %*s.%*s",
+  DBUG_PRINT("enter", ("name: %.*s.%.*s",
 		       name->m_db.length, name->m_db.str,
 		       name->m_name.length, name->m_name.str));
 
@@ -980,7 +981,7 @@
 {
   int ret;
   DBUG_ENTER("sp_create_procedure");
-  DBUG_PRINT("enter", ("name: %*s", sp->m_name.length, sp->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str));
 
   ret= db_create_routine(thd, TYPE_ENUM_PROCEDURE, sp);
   DBUG_RETURN(ret);
@@ -992,7 +993,7 @@
 {
   int ret;
   DBUG_ENTER("sp_drop_procedure");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   ret= db_drop_routine(thd, TYPE_ENUM_PROCEDURE, name);
   if (!ret)
@@ -1006,7 +1007,7 @@
 {
   int ret;
   DBUG_ENTER("sp_update_procedure");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   ret= db_update_routine(thd, TYPE_ENUM_PROCEDURE, name, chistics);
   if (!ret)
@@ -1020,7 +1021,7 @@
 {
   sp_head *sp;
   DBUG_ENTER("sp_show_create_procedure");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   if ((sp= sp_find_procedure(thd, name)))
   {
@@ -1072,7 +1073,7 @@
 {
   sp_head *sp;
   DBUG_ENTER("sp_find_function");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   if (!(sp= sp_cache_lookup(&thd->sp_func_cache, name)) &&
       !cache_only)
@@ -1089,7 +1090,7 @@
 {
   int ret;
   DBUG_ENTER("sp_create_function");
-  DBUG_PRINT("enter", ("name: %*s", sp->m_name.length, sp->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", sp->m_name.length, sp->m_name.str));
 
   ret= db_create_routine(thd, TYPE_ENUM_FUNCTION, sp);
   DBUG_RETURN(ret);
@@ -1101,7 +1102,7 @@
 {
   int ret;
   DBUG_ENTER("sp_drop_function");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   ret= db_drop_routine(thd, TYPE_ENUM_FUNCTION, name);
   if (!ret)
@@ -1115,7 +1116,7 @@
 {
   int ret;
   DBUG_ENTER("sp_update_procedure");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   ret= db_update_routine(thd, TYPE_ENUM_FUNCTION, name, chistics);
   if (!ret)
@@ -1129,7 +1130,7 @@
 {
   sp_head *sp;
   DBUG_ENTER("sp_show_create_function");
-  DBUG_PRINT("enter", ("name: %*s", name->m_name.length, name->m_name.str));
+  DBUG_PRINT("enter", ("name: %.*s", name->m_name.length, name->m_name.str));
 
   if ((sp= sp_find_function(thd, name)))
   {

--- 1.14/sql/sp_cache.cc	2005-08-11 06:43:18 -07:00
+++ 1.15/sql/sp_cache.cc	2005-10-06 17:37:20 -07:00
@@ -132,7 +132,7 @@
       return;                                   // End of memory error
     c->version= Cversion;      // No need to lock when reading long variable
   }
-  DBUG_PRINT("info",("sp_cache: inserting: %*s", sp->m_qname.length,
+  DBUG_PRINT("info",("sp_cache: inserting: %.*s", sp->m_qname.length,
                      sp->m_qname.str));
   c->insert(sp);
   *cp= c;                                       // Update *cp if it was NULL

--- 1.188/sql/sp_head.cc	2005-09-26 09:21:53 -07:00
+++ 1.189/sql/sp_head.cc	2005-10-06 17:37:20 -07:00
@@ -280,7 +280,7 @@
       DBUG_PRINT("info", ("STRING_RESULT: null"));
       goto return_null_item;
     }
-    DBUG_PRINT("info",("STRING_RESULT: %*s",
+    DBUG_PRINT("info",("STRING_RESULT: %.*s",
                        s->length(), s->c_ptr_quick()));
     /*
       Reuse mechanism in sp_eval_func_item() is only employed for assignments
@@ -354,7 +354,7 @@
     return;
   m_qname.length= m_sroutines_key.length - 1;
   m_qname.str= m_sroutines_key.str + 1;
-  sprintf(m_qname.str, "%*s.%*s",
+  sprintf(m_qname.str, "%.*s.%.*s",
 	  m_db.length, (m_db.length ? m_db.str : ""),
 	  m_name.length, m_name.str);
 }
Thread
bk commit into 5.0 tree (jimw:1.2024) BUG#13650Jim Winstead7 Oct