List:Internals« Previous MessageNext Message »
From:msvensson Date:April 13 2005 10:22am
Subject:bk commit into 5.0 tree (msvensson:1.1820) BUG#9391
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson 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.1820 05/04/13 12:22:20 msvensson@neptunus.(none) +7 -0
  BUG#9391 mysqlshow prints incorrect "rows" information
   - Removed use of mysql->extra_info
   - Removed unused function send_records_num

  sql/protocol.h
    1.26 05/04/13 12:22:15 msvensson@neptunus.(none) +0 -1
    Removed unused function send_records_num

  sql/protocol.cc
    1.98 05/04/13 12:22:15 msvensson@neptunus.(none) +0 -10
    Removed unused function send_records_num

  sql-common/client.c
    1.71 05/04/13 12:22:15 msvensson@neptunus.(none) +0 -2
    Remove use of extra_info since number of records is not sent in the protocol anymore

  libmysqld/lib_sql.cc
    1.98 05/04/13 12:22:15 msvensson@neptunus.(none) +0 -5
    Removed unused function send_records_num

  include/mysql.h
    1.148 05/04/13 12:22:15 msvensson@neptunus.(none) +1 -1
    Comment extra_info as not used anymore

  client/mysqlshow.c
    1.41 05/04/13 12:22:15 msvensson@neptunus.(none) +14 -2
    Remove use of extra info. Instead read number of records in table using SELECT COUNT(*)
     

  VC++Files/winmysqladmin/mysql.h
    1.3 05/04/13 12:22:15 msvensson@neptunus.(none) +1 -1
    Comment extra_info as not used anymore

# 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:	msvensson
# Host:	neptunus.(none)
# Root:	/home/msvensson/mysql/bug9391

--- 1.40/client/mysqlshow.c	2005-03-15 19:46:40 +01:00
+++ 1.41/client/mysqlshow.c	2005-04-13 12:22:15 +02:00
@@ -611,6 +611,7 @@
   char query[1024],*end;
   MYSQL_RES *result;
   MYSQL_ROW row;
+  ulong rows;
 
   if (mysql_select_db(mysql,db))
   {
@@ -618,6 +619,17 @@
 	    mysql_error(mysql));
     return 1;
   }
+  sprintf(query,"select count(*) from `%s`", table);
+  if (mysql_query(mysql,query) || !(result=mysql_store_result(mysql)))
+  {
+    fprintf(stderr,"%s: Cannot get record count for db: %s, table: %s: %s\n",
+	    my_progname,db,table,mysql_error(mysql));
+    return 1;
+  }
+  row = mysql_fetch_row(result);
+  rows = (ulong) strtoull(row[0], (char**) 0, 10);
+  mysql_free_result(result);
+
   end=strmov(strmov(strmov(query,"show /*!32332 FULL */ columns from `"),table),"`");
   if (wild && wild[0])
     strxmov(end," like '",wild,"'",NullS);
@@ -628,8 +640,8 @@
     return 1;
   }
 
-  printf("Database: %s  Table: %s  Rows: %lu", db,table,
-	 (ulong) mysql->extra_info);
+  printf("Database: %s  Table: %s Rows: %lu", db, table, rows);
+
   if (wild && wild[0])
     printf("  Wildcard: %s",wild);
   putchar('\n');

--- 1.147/include/mysql.h	2005-02-23 09:29:50 +01:00
+++ 1.148/include/mysql.h	2005-04-13 12:22:15 +02:00
@@ -231,7 +231,7 @@
   MEM_ROOT	field_alloc;
   my_ulonglong affected_rows;
   my_ulonglong insert_id;		/* id if insert on table with NEXTNR */
-  my_ulonglong extra_info;		/* Used by mysqlshow */
+  my_ulonglong extra_info;		/* Not used */
   unsigned long thread_id;		/* Id for connection in server */
   unsigned long packet_length;
   unsigned int	port;

--- 1.97/sql/protocol.cc	2005-03-09 19:22:21 +01:00
+++ 1.98/sql/protocol.cc	2005-04-13 12:22:15 +02:00
@@ -645,16 +645,6 @@
 }
 
 
-bool Protocol::send_records_num(List<Item> *list, ulonglong records)
-{
-  char *pos;
-  char buff[20];
-  pos=net_store_length(buff, (uint) list->elements);
-  pos=net_store_length(pos, records);
-  return my_net_write(&thd->net, buff,(uint) (pos-buff));
-}
-
-
 bool Protocol::write()
 {
   DBUG_ENTER("Protocol::write");

--- 1.70/sql-common/client.c	2005-04-05 08:00:49 +02:00
+++ 1.71/sql-common/client.c	2005-04-13 12:22:15 +02:00
@@ -2446,8 +2446,6 @@
   if (!(mysql->server_status & SERVER_STATUS_AUTOCOMMIT))
     mysql->server_status|= SERVER_STATUS_IN_TRANS;
 
-  mysql->extra_info= net_field_length_ll(&pos); /* Maybe number of rec */
-
   if (!(fields=(*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,
 					    protocol_41(mysql) ? 7 : 5)))
     DBUG_RETURN(1);

--- 1.2/VC++Files/winmysqladmin/mysql.h	2004-06-18 23:49:58 +02:00
+++ 1.3/VC++Files/winmysqladmin/mysql.h	2005-04-13 12:22:15 +02:00
@@ -145,7 +145,7 @@
   unsigned long thread_id;		/* Id for connection in server */
   my_ulonglong affected_rows;
   my_ulonglong insert_id;		/* id if insert on table with NEXTNR */
-  my_ulonglong extra_info;		/* Used by mysqlshow */
+  my_ulonglong extra_info;		/* Not used */
   unsigned long packet_length;
   enum mysql_status status;
   MYSQL_FIELD	*fields;

--- 1.25/sql/protocol.h	2005-02-08 23:49:34 +01:00
+++ 1.26/sql/protocol.h	2005-04-13 12:22:15 +02:00
@@ -54,7 +54,6 @@
   enum { SEND_NUM_ROWS= 1, SEND_DEFAULTS= 2, SEND_EOF= 4 };
   virtual bool send_fields(List<Item> *list, uint flags);
 
-  bool send_records_num(List<Item> *list, ulonglong records);
   bool store(I_List<i_string> *str_list);
   bool store(const char *from, CHARSET_INFO *cs);
   String *storage_packet() { return packet; }

--- 1.97/libmysqld/lib_sql.cc	2005-02-25 15:53:15 +01:00
+++ 1.98/libmysqld/lib_sql.cc	2005-04-13 12:22:15 +02:00
@@ -709,11 +709,6 @@
   DBUG_RETURN(1);				/* purecov: inspected */
 }
 
-bool Protocol::send_records_num(List<Item> *list, ulonglong records)
-{
-  return false;
-}
-
 bool Protocol::write()
 {
   if (!thd->mysql)            // bootstrap file handling
Thread
bk commit into 5.0 tree (msvensson:1.1820) BUG#9391msvensson13 Apr