List:Internals« Previous MessageNext Message »
From:konstantin Date:June 8 2005 3:54pm
Subject:bk commit into 5.0 tree (konstantin:1.1955)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of kostja. When kostja 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.1955 05/06/08 19:54:17 konstantin@stripped +1 -0
  Trim trailing spaces.

  sql/sql_prepare.cc
    1.119 05/06/08 19:54:11 konstantin@stripped +60 -60
    Trim trailing spaces.

# 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:	konstantin
# Host:	dragonfly.local
# Root:	/opt/local/work/mysql-5.0-10729

--- 1.118/sql/sql_prepare.cc	2005-06-08 19:31:28 +04:00
+++ 1.119/sql/sql_prepare.cc	2005-06-08 19:54:11 +04:00
@@ -15,18 +15,18 @@
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA */
 
 /**********************************************************************
-This file contains the implementation of prepare and executes. 
+This file contains the implementation of prepare and executes.
 
 Prepare:
 
-  - Server gets the query from client with command 'COM_PREPARE'; 
+  - Server gets the query from client with command 'COM_PREPARE';
     in the following format:
     [COM_PREPARE:1] [query]
-  - Parse the query and recognize any parameter markers '?' and 
+  - Parse the query and recognize any parameter markers '?' and
     store its information list in lex->param_list
-  - Allocate a new statement for this prepare; and keep this in 
+  - Allocate a new statement for this prepare; and keep this in
     'thd->prepared_statements' pool.
-  - Without executing the query, return back to client the total 
+  - Without executing the query, return back to client the total
     number of parameters along with result-set metadata information
     (if any) in the following format:
     [STMT_ID:4]
@@ -34,10 +34,10 @@
     [Param_count:2]
     [Columns meta info] (if Column_count > 0)
     [Params meta info]  (if Param_count > 0 ) (TODO : 4.1.1)
-     
+
 Prepare-execute:
 
-  - Server gets the command 'COM_EXECUTE' to execute the 
+  - Server gets the command 'COM_EXECUTE' to execute the
     previously prepared query. If there is any param markers; then client
     will send the data in the following format:
     [COM_EXECUTE:1]
@@ -45,12 +45,12 @@
     [NULL_BITS:(param_count+7)/8)]
     [TYPES_SUPPLIED_BY_CLIENT(0/1):1]
     [[length]data]
-    [[length]data] .. [[length]data]. 
-    (Note: Except for string/binary types; all other types will not be 
+    [[length]data] .. [[length]data].
+    (Note: Except for string/binary types; all other types will not be
     supplied with length field)
-  - Replace the param items with this new data. If it is a first execute 
+  - Replace the param items with this new data. If it is a first execute
     or types altered by client; then setup the conversion routines.
-  - Execute the query without re-parsing and send back the results 
+  - Execute the query without re-parsing and send back the results
     to client
 
 Long data handling:
@@ -61,8 +61,8 @@
   - data from the packet is appended to long data value buffer for this
     placeholder.
   - It's up to the client to check for read data ended. The server doesn't
-    care; and also server doesn't notify to the client that it got the 
-    data or not; if there is any error; then during execute; the error 
+    care; and also server doesn't notify to the client that it got the
+    data or not; if there is any error; then during execute; the error
     will be returned
 
 ***********************************************************************/
@@ -97,7 +97,7 @@
 #else
   bool (*set_params_data)(Prepared_statement *st, String *expanded_query);
 #endif
-  bool (*set_params_from_vars)(Prepared_statement *stmt, 
+  bool (*set_params_from_vars)(Prepared_statement *stmt,
                                List<LEX_STRING>& varnames,
                                String *expanded_query);
 public:
@@ -167,7 +167,7 @@
     Send types and names of placeholders to the client
     XXX: fix this nasty upcast from List<Item_param> to List<Item>
   */
-  DBUG_RETURN(my_net_write(net, buff, sizeof(buff)) || 
+  DBUG_RETURN(my_net_write(net, buff, sizeof(buff)) ||
               (stmt->param_count &&
                stmt->thd->protocol_simple.send_fields((List<Item> *)
                                                       &stmt->lex->param_list,
@@ -220,7 +220,7 @@
   }
   if (len < 5)
     return 0;
-  (*packet)+=9; // Must be 254 when here 
+  (*packet)+=9; // Must be 254 when here
   /*
     In our client-server protocol all numbers bigger than 2^24
     stored as 8 bytes with uint8korr. Here we always know that
@@ -242,7 +242,7 @@
     pos     input data buffer
     len     length of data in the buffer
 
-  All these functions read the data from pos, convert it to requested type 
+  All these functions read the data from pos, convert it to requested type
   and assign to param; pos is advanced to predefined length.
 
   Make a note that the NULL handling is examined at first execution
@@ -260,7 +260,7 @@
     return;
 #endif
   int8 value= (int8) **pos;
-  param->set_int(param->unsigned_flag ? (longlong) ((uint8) value) : 
+  param->set_int(param->unsigned_flag ? (longlong) ((uint8) value) :
                                         (longlong) value, 4);
   *pos+= 1;
 }
@@ -480,7 +480,7 @@
 }
 
 
-#undef get_param_length 
+#undef get_param_length
 
 static void setup_one_conversion_function(THD *thd, Item_param *param,
                                           uchar param_type)
@@ -583,12 +583,12 @@
 
 #ifndef EMBEDDED_LIBRARY
 /*
-  Update the parameter markers by reading data from client packet 
+  Update the parameter markers by reading data from client packet
   and if binary/update log is set, generate the valid query.
 */
 
 static bool insert_params_withlog(Prepared_statement *stmt, uchar *null_array,
-                                  uchar *read_pos, uchar *data_end, 
+                                  uchar *read_pos, uchar *data_end,
                                   String *query)
 {
   THD  *thd= stmt->thd;
@@ -596,14 +596,14 @@
   Item_param **end= begin + stmt->param_count;
   uint32 length= 0;
 
-  String str; 
+  String str;
   const String *res;
 
-  DBUG_ENTER("insert_params_withlog"); 
+  DBUG_ENTER("insert_params_withlog");
 
   if (query->copy(stmt->query, stmt->query_length, default_charset_info))
     DBUG_RETURN(1);
-  
+
   for (Item_param **it= begin; it < end; ++it)
   {
     Item_param *param= *it;
@@ -624,7 +624,7 @@
 
     if (query->replace(param->pos_in_query+length, 1, *res))
       DBUG_RETURN(1);
-    
+
     length+= res->length()-1;
   }
   DBUG_RETURN(0);
@@ -632,13 +632,13 @@
 
 
 static bool insert_params(Prepared_statement *stmt, uchar *null_array,
-                          uchar *read_pos, uchar *data_end, 
+                          uchar *read_pos, uchar *data_end,
                           String *expanded_query)
 {
   Item_param **begin= stmt->param_array;
   Item_param **end= begin + stmt->param_count;
 
-  DBUG_ENTER("insert_params"); 
+  DBUG_ENTER("insert_params");
 
   for (Item_param **it= begin; it < end; ++it)
   {
@@ -672,7 +672,7 @@
   if (*read_pos++) //types supplied / first execute
   {
     /*
-      First execute or types altered by the client, setup the 
+      First execute or types altered by the client, setup the
       conversion routines for all parameters (one time)
     */
     Item_param **it= stmt->param_array;
@@ -720,8 +720,8 @@
         uchar *buff= (uchar*) client_param->buffer;
         param->unsigned_flag= client_param->is_unsigned;
         param->set_param_func(param, &buff,
-                              client_param->length ? 
-                              *client_param->length : 
+                              client_param->length ?
+                              *client_param->length :
                               client_param->buffer_length);
       }
     }
@@ -747,7 +747,7 @@
 
   if (query->copy(stmt->query, stmt->query_length, default_charset_info))
     DBUG_RETURN(1);
-  
+
   for (; it < end; ++it, ++client_param)
   {
     Item_param *param= *it;
@@ -761,8 +761,8 @@
         uchar *buff= (uchar*)client_param->buffer;
 	param->unsigned_flag= client_param->is_unsigned;
         param->set_param_func(param, &buff,
-                              client_param->length ? 
-                              *client_param->length : 
+                              client_param->length ?
+                              *client_param->length :
                               client_param->buffer_length);
       }
     }
@@ -881,12 +881,12 @@
 }
 
 /*
-  Validate INSERT statement: 
+  Validate INSERT statement:
 
   SYNOPSIS
     mysql_test_insert()
     stmt	prepared statemen handler
-    tables	global/local table list  
+    tables	global/local table list
 
   RETURN VALUE
     FALSE  success
@@ -895,7 +895,7 @@
 
 static bool mysql_test_insert(Prepared_statement *stmt,
                               TABLE_LIST *table_list,
-                              List<Item> &fields, 
+                              List<Item> &fields,
                               List<List_item> &values_list,
                               List<Item> &update_fields,
                               List<Item> &update_values,
@@ -1046,7 +1046,7 @@
 #endif
   if (setup_fields(thd, 0, table_list, stmt->lex->value_list, 0, 0, 0))
     goto error;
-  /* TODO: here we should send types of placeholders to the client. */ 
+  /* TODO: here we should send types of placeholders to the client. */
   DBUG_RETURN(0);
 error:
   DBUG_RETURN(1);
@@ -1093,7 +1093,7 @@
 /*
   Validate SELECT statement.
   In case of success, if this query is not EXPLAIN, send column list info
-  back to client. 
+  back to client.
 
   SYNOPSIS
     mysql_test_select()
@@ -1566,7 +1566,7 @@
   case SQLCOM_CREATE_TABLE:
     res= mysql_test_create_table(stmt);
     break;
-  
+
   case SQLCOM_DO:
     res= mysql_test_do_fields(stmt, tables, lex->insert_list);
     break;
@@ -1661,30 +1661,30 @@
 /*
   Given a query string with parameter markers, create a Prepared Statement
   from it and send PS info back to the client.
-  
+
   SYNOPSIS
     mysql_stmt_prepare()
-      packet         query to be prepared 
-      packet_length  query string length, including ignored trailing NULL or 
+      packet         query to be prepared
+      packet_length  query string length, including ignored trailing NULL or
                      quote char.
       name           NULL or statement name. For unnamed statements binary PS
-                     protocol is used, for named statements text protocol is 
+                     protocol is used, for named statements text protocol is
                      used.
   RETURN
     FALSE  OK, statement prepared successfully
     TRUE  Error
 
   NOTES
-    This function parses the query and sends the total number of parameters 
-    and resultset metadata information back to client (if any), without 
-    executing the query i.e. without any log/disk writes. This allows the 
-    queries to be re-executed without re-parsing during execute. 
+    This function parses the query and sends the total number of parameters
+    and resultset metadata information back to client (if any), without
+    executing the query i.e. without any log/disk writes. This allows the
+    queries to be re-executed without re-parsing during execute.
 
     If parameter markers are found in the query, then store the information
-    using Item_param along with maintaining a list in lex->param_array, so 
-    that a fast and direct retrieval can be made without going through all 
+    using Item_param along with maintaining a list in lex->param_array, so
+    that a fast and direct retrieval can be made without going through all
     field items.
-   
+
 */
 
 bool mysql_stmt_prepare(THD *thd, char *packet, uint packet_length,
@@ -1857,8 +1857,8 @@
   }
 
   /*
-    TODO: When the new table structure is ready, then have a status bit 
-    to indicate the table is altered, and re-do the setup_* 
+    TODO: When the new table structure is ready, then have a status bit
+    to indicate the table is altered, and re-do the setup_*
     and open the tables back.
   */
   /*
@@ -1899,7 +1899,7 @@
 
 /*
   Clears parameters from data left from previous execution or long data
-    
+
   SYNOPSIS
     reset_stmt_params()
     stmt	prepared statement for which parameters should be reset
@@ -1999,8 +1999,8 @@
   }
 #else
   /*
-    In embedded library we re-install conversion routines each time 
-    we set params, and also we don't need to parse packet. 
+    In embedded library we re-install conversion routines each time
+    we set params, and also we don't need to parse packet.
     So we do it in one function.
   */
   if (stmt->param_count && stmt->set_params_data(stmt, &expanded_query))
@@ -2240,22 +2240,22 @@
 
   stmt->state= Item_arena::PREPARED;
 
-  /* 
-    Clear parameters from data which could be set by 
+  /*
+    Clear parameters from data which could be set by
     mysql_stmt_send_long_data() call.
   */
   reset_stmt_params(stmt);
 
   mysql_reset_thd_for_next_command(thd);
   send_ok(thd);
-  
+
   DBUG_VOID_RETURN;
 }
 
 
 /*
   Delete a prepared statement from memory.
-  Note: we don't send any reply to that command. 
+  Note: we don't send any reply to that command.
 */
 
 void mysql_stmt_free(THD *thd, char *packet)
@@ -2301,7 +2301,7 @@
   Prepared_statement *stmt;
   Item_param *param;
   char *packet_end= packet + packet_length - 1;
-  
+
   DBUG_ENTER("mysql_stmt_get_longdata");
 
 #ifndef EMBEDDED_LIBRARY
Thread
bk commit into 5.0 tree (konstantin:1.1955)konstantin8 Jun