List:Commits« Previous MessageNext Message »
From:eugene Date:November 26 2006 7:52pm
Subject:bk commit into 5.0 tree (evgen:1.2317)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of evgen. When evgen 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@stripped, 2006-11-26 22:52:47+03:00, evgen@stripped +15 -0
  Merge epotemkin@stripped:/home/bk/mysql-5.0
  into  moonbone.local:/home/evgen/bk-trees/mysql-5.0-opt
  MERGE: 1.2309.1.3

  libmysql/libmysql.c@stripped, 2006-11-26 22:52:43+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.247.2.1

  mysql-test/t/subselect.test@stripped, 2006-11-26 22:52:44+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.132.1.1

  mysql-test/t/type_newdecimal.test@stripped, 2006-11-26 22:52:44+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.39.1.1

  sql-common/client.c@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.102.1.2

  sql-common/my_time.c@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.24.1.1

  sql/filesort.cc@stripped, 2006-11-26 22:52:44+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.107.1.1

  sql/handler.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.220.1.5

  sql/item_cmpfunc.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.223.1.1

  sql/item_subselect.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.134.2.1

  sql/item_timefunc.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.132.1.1

  sql/sql_class.h@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.308.1.1

  sql/sql_parse.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.589.1.1

  sql/sql_select.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.473.1.1

  sql/table.cc@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.236.1.1

  strings/decimal.c@stripped, 2006-11-26 22:52:45+03:00, evgen@stripped +0 -0
    Auto merged
    MERGE: 1.70.1.1

# 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:	evgen
# Host:	moonbone.local
# Root:	/home/evgen/bk-trees/mysql-5.0-opt/RESYNC

--- 1.249/libmysql/libmysql.c	2006-11-17 09:26:07 +03:00
+++ 1.250/libmysql/libmysql.c	2006-11-26 22:52:43 +03:00
@@ -2100,7 +2100,7 @@
   }
   stmt->bind= stmt->params + stmt->param_count;
   stmt->state= MYSQL_STMT_PREPARE_DONE;
-  DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count));
+  DBUG_PRINT("info", ("Parameter count: %u", stmt->param_count));
   DBUG_RETURN(0);
 }
 
@@ -2443,10 +2443,10 @@
 {
   NET *net= &stmt->mysql->net;
   DBUG_ENTER("store_param");
-  DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu  is_null: %d",
+  DBUG_PRINT("enter",("type: %d  buffer: 0x%lx  length: %lu  is_null: %d",
 		      param->buffer_type,
-		      param->buffer ? param->buffer : "0", *param->length,
-		      *param->is_null));
+		      (long) (param->buffer ? param->buffer : NullS),
+                      *param->length, *param->is_null));
 
   if (*param->is_null)
     store_param_null(net, param);
@@ -3325,8 +3325,8 @@
   MYSQL_BIND *param;
   DBUG_ENTER("mysql_stmt_send_long_data");
   DBUG_ASSERT(stmt != 0);
-  DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld",
-		      param_number, data, length));
+  DBUG_PRINT("enter",("param no: %d  data: 0x%lx, length : %ld",
+		      param_number, (long) data, length));
 
   /*
     We only need to check for stmt->param_count, if it's not null
@@ -4409,7 +4409,7 @@
   ulong       bind_count= stmt->field_count;
   uint        param_count= 0;
   DBUG_ENTER("mysql_stmt_bind_result");
-  DBUG_PRINT("enter",("field_count: %d", bind_count));
+  DBUG_PRINT("enter",("field_count: %lu", bind_count));
 
   if (!bind_count)
   {

--- 1.109/sql/filesort.cc	2006-11-21 21:52:37 +03:00
+++ 1.110/sql/filesort.cc	2006-11-26 22:52:44 +03:00
@@ -309,7 +309,7 @@
   DBUG_POP();			/* Ok to DBUG */
 #endif
   memcpy(&table->sort, &table_sort, sizeof(FILESORT_INFO));
-  DBUG_PRINT("exit",("records: %ld",records));
+  DBUG_PRINT("exit",("records: %ld", (long) records));
   DBUG_RETURN(error ? HA_POS_ERROR : records);
 } /* filesort */
 

--- 1.222/sql/handler.cc	2006-11-16 22:19:23 +03:00
+++ 1.223/sql/handler.cc	2006-11-26 22:52:45 +03:00
@@ -1533,7 +1533,7 @@
     */
     DBUG_PRINT("info",("auto_increment: nr: %lu cannot honour "
                        "auto_increment_offset: %lu",
-                       nr, variables->auto_increment_offset));
+                       (ulong) nr, variables->auto_increment_offset));
     return nr;
   }
   if (variables->auto_increment_increment == 1)

--- 1.224/sql/item_cmpfunc.cc	2006-10-31 20:42:45 +03:00
+++ 1.225/sql/item_cmpfunc.cc	2006-11-26 22:52:45 +03:00
@@ -2228,7 +2228,7 @@
 cmp_item_row::~cmp_item_row()
 {
   DBUG_ENTER("~cmp_item_row");
-  DBUG_PRINT("enter",("this: 0x%lx", this));
+  DBUG_PRINT("enter",("this: 0x%lx", (long) this));
   if (comparators)
   {
     for (uint i= 0; i < n; i++)
@@ -3003,7 +3003,7 @@
   if (!used_tables_cache)
   {
     owner->was_null|= (!cached_value);
-    DBUG_PRINT("info", ("cached :%d", cached_value));
+    DBUG_PRINT("info", ("cached :%ld", (long) cached_value));
     DBUG_RETURN(cached_value);
   }
   if (args[0]->is_null())

--- 1.133/sql/item_timefunc.cc	2006-11-16 22:19:24 +03:00
+++ 1.134/sql/item_timefunc.cc	2006-11-26 22:52:45 +03:00
@@ -2487,7 +2487,8 @@
     {                                           // Safe even if const arg
       char char_type[40];
       my_snprintf(char_type, sizeof(char_type), "%s(%lu)",
-                  cast_cs == &my_charset_bin ? "BINARY" : "CHAR", length);
+                  cast_cs == &my_charset_bin ? "BINARY" : "CHAR",
+                  (ulong) length);
 
       if (!res->alloced_length())
       {                                         // Don't change const str

--- 1.310/sql/sql_class.h	2006-11-16 22:19:25 +03:00
+++ 1.311/sql/sql_class.h	2006-11-26 22:52:45 +03:00
@@ -2090,7 +2090,7 @@
   inline bool unique_add(void *ptr)
   {
     DBUG_ENTER("unique_add");
-    DBUG_PRINT("info", ("tree %u - %u", tree.elements_in_tree, max_elements));
+    DBUG_PRINT("info", ("tree %u - %lu", tree.elements_in_tree, max_elements));
     if (tree.elements_in_tree > max_elements && flush())
       DBUG_RETURN(1);
     DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg));

--- 1.590/sql/sql_parse.cc	2006-11-16 22:19:26 +03:00
+++ 1.591/sql/sql_parse.cc	2006-11-26 22:52:45 +03:00
@@ -381,9 +381,9 @@
           NO_ACCESS)) // authentication is OK
     {
       DBUG_PRINT("info",
-                 ("Capabilities: %d  packet_length: %ld  Host: '%s'  "
+                 ("Capabilities: %lu  packet_length: %ld  Host: '%s'  "
                   "Login user: '%s' Priv_user: '%s'  Using password: %s "
-                  "Access: %u  db: '%s'",
+                  "Access: %lu  db: '%s'",
                   thd->client_capabilities,
                   thd->max_client_packet_length,
                   thd->main_security_ctx.host_or_ip,
@@ -956,7 +956,7 @@
   if (thd->client_capabilities & CLIENT_IGNORE_SPACE)
     thd->variables.sql_mode|= MODE_IGNORE_SPACE;
 #ifdef HAVE_OPENSSL
-  DBUG_PRINT("info", ("client capabilities: %d", thd->client_capabilities));
+  DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities));
   if (thd->client_capabilities & CLIENT_SSL)
   {
     /* Do the SSL layering. */
@@ -1112,7 +1112,7 @@
     of handle_one_connection, which is thd. We need to know the
     start of the stack so that we could check for stack overruns.
   */
-  DBUG_PRINT("info", ("handle_one_connection called by thread %d\n",
+  DBUG_PRINT("info", ("handle_one_connection called by thread %lu\n",
 		      thd->thread_id));
   /* now that we've called my_thread_init(), it is safe to call DBUG_* */
 
@@ -1764,7 +1764,9 @@
     if (alloc_query(thd, packet, packet_length))
       break;					// fatal error is set
     char *packet_end= thd->query + thd->query_length;
-    mysql_log.write(thd,command, "%.*b", thd->query_length, thd->query);
+    /* 'b' stands for 'buffer' parameter', special for 'my_snprintf' */
+    const char *format= "%.*b";
+    mysql_log.write(thd,command, format, thd->query_length, thd->query);
     DBUG_PRINT("query",("%-.4096s",thd->query));
 
     if (!(specialflag & SPECIAL_NO_PRIOR))

--- 1.475/sql/sql_select.cc	2006-11-21 12:44:56 +03:00
+++ 1.476/sql/sql_select.cc	2006-11-26 22:52:45 +03:00
@@ -10034,7 +10034,7 @@
       if (join->result->send_eof())
 	rc= 1;                                  // Don't send error
     }
-    DBUG_PRINT("info",("%ld records output",join->send_records));
+    DBUG_PRINT("info",("%ld records output", (long) join->send_records));
   }
   else
     rc= -1;

--- 1.237/sql/table.cc	2006-11-16 22:19:27 +03:00
+++ 1.238/sql/table.cc	2006-11-26 22:52:45 +03:00
@@ -88,7 +88,7 @@
   MEM_ROOT **root_ptr, *old_root;
   TABLE_SHARE *share;
   DBUG_ENTER("openfrm");
-  DBUG_PRINT("enter",("name: '%s'  form: 0x%lx",name,outparam));
+  DBUG_PRINT("enter",("name: '%s'  form: 0x%lx", name, (long) outparam));
 
   error= 1;
   disk_buff= NULL;

--- 1.134/mysql-test/t/subselect.test	2006-11-16 22:19:23 +03:00
+++ 1.135/mysql-test/t/subselect.test	2006-11-26 22:52:44 +03:00
@@ -108,7 +108,7 @@
 -- error 1241
 select * from t3 where a in (select * from t2);
 insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10);
--- empty set
+# empty set
 select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b);
 insert into t2 values (2,10);
 select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b);
@@ -2280,11 +2280,11 @@
 # Bug#19700: subselect returning BIGINT always returned it as SIGNED
 #
 CREATE TABLE t1 (i BIGINT UNSIGNED);
-INSERT INTO t1 VALUES (10000000000000000000); -- > MAX SIGNED BIGINT 9323372036854775807
+INSERT INTO t1 VALUES (10000000000000000000); # > MAX SIGNED BIGINT 9323372036854775807
 INSERT INTO t1 VALUES (1);
 
 CREATE TABLE t2 (i BIGINT UNSIGNED);
-INSERT INTO t2 VALUES (10000000000000000000); -- same as first table
+INSERT INTO t2 VALUES (10000000000000000000); # same as first table
 INSERT INTO t2 VALUES (1);
 
 /* simple test */

--- 1.142/sql/item_subselect.cc	2006-11-17 10:15:37 +03:00
+++ 1.143/sql/item_subselect.cc	2006-11-26 22:52:45 +03:00
@@ -54,7 +54,7 @@
 {
 
   DBUG_ENTER("Item_subselect::init");
-  DBUG_PRINT("enter", ("select_lex: 0x%x", (ulong) select_lex));
+  DBUG_PRINT("enter", ("select_lex: 0x%lx", (long) select_lex));
   unit= select_lex->master_unit();
 
   if (unit->item)

--- 1.40/mysql-test/t/type_newdecimal.test	2006-11-16 22:19:23 +03:00
+++ 1.41/mysql-test/t/type_newdecimal.test	2006-11-26 22:52:44 +03:00
@@ -613,7 +613,7 @@
 #-- should return 99.9999999999999999999999999999999
 #
 select truncate(99999999999999999999999999999999999999,-31);
--- should return 90000000000000000000000000000000
+# should return 90000000000000000000000000000000
 #
 #-- 6. Set functions (AVG, SUM, COUNT) should work.
 #
@@ -810,7 +810,7 @@
 #BUG#6048 Stored procedure causes operating system reboot
 #BUG#6053 DOUBLE PRECISION literal
 
--- Tests from 'traditional' mode tests
+# Tests from 'traditional' mode tests
 #
 set sql_mode='ansi,traditional';
 #

--- 1.104/sql-common/client.c	2006-11-16 22:19:28 +03:00
+++ 1.105/sql-common/client.c	2006-11-26 22:52:45 +03:00
@@ -598,7 +598,7 @@
 
   if (len == packet_error || len == 0)
   {
-    DBUG_PRINT("error",("Wrong connection or packet. fd: %s  len: %d",
+    DBUG_PRINT("error",("Wrong connection or packet. fd: %s  len: %lu",
 			vio_description(net->vio),len));
 #ifdef MYSQL_SERVER
     if (net->vio && vio_was_interrupted(net->vio))
@@ -753,6 +753,29 @@
   DBUG_VOID_RETURN;
 }
 
+
+static void set_mysql_extended_error(MYSQL *mysql, int errcode,
+                                     const char *sqlstate,
+                                     const char *format, ...)
+{
+  NET *net;
+  va_list args;
+  DBUG_ENTER("set_mysql_extended_error");
+  DBUG_PRINT("enter", ("error :%d '%s'", errcode, format));
+  DBUG_ASSERT(mysql != 0);
+
+  net= &mysql->net;
+  net->last_errno= errcode;
+  va_start(args, format);
+  my_vsnprintf(net->last_error, sizeof(net->last_error)-1,
+               format, args);
+  va_end(args);
+  strmov(net->sqlstate, sqlstate);
+
+  DBUG_VOID_RETURN;
+}
+
+
 /*
   Flush result set sent from server
 */
@@ -850,6 +873,7 @@
 
 void end_server(MYSQL *mysql)
 {
+  int save_errno= errno;
   DBUG_ENTER("end_server");
   if (mysql->net.vio != 0)
   {
@@ -862,6 +886,7 @@
   }
   net_end(&mysql->net);
   free_old_query(mysql);
+  errno= save_errno;
   DBUG_VOID_RETURN;
 }
 
@@ -870,7 +895,7 @@
 mysql_free_result(MYSQL_RES *result)
 {
   DBUG_ENTER("mysql_free_result");
-  DBUG_PRINT("enter",("mysql_res: %lx",result));
+  DBUG_PRINT("enter",("mysql_res: 0x%lx", (long) result));
   if (result)
   {
     MYSQL *mysql= result->handle;
@@ -1368,7 +1393,7 @@
     DBUG_PRINT("info",("status: %u  warning_count:  %u",
 		       mysql->server_status, mysql->warning_count));
   }
-  DBUG_PRINT("exit",("Got %d rows",result->rows));
+  DBUG_PRINT("exit", ("Got %lu rows", (ulong) result->rows));
   DBUG_RETURN(result);
 }
 
@@ -2033,7 +2058,10 @@
   if (mysql->options.connect_timeout &&
       vio_poll_read(net->vio, mysql->options.connect_timeout))
   {
-    set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+    set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                             ER(CR_SERVER_LOST_EXTENDED),
+                             "waiting for initial communication packet",
+                             errno);
     goto error;
   }
 
@@ -2042,8 +2070,14 @@
   */
 
   if ((pkt_length=cli_safe_read(mysql)) == packet_error)
+  {
+    if (mysql->net.last_errno == CR_SERVER_LOST)
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "reading initial communication packet",
+                               errno);
     goto error;
-
+  }
   /* Check if version of protocol matches current one */
 
   mysql->protocol_version= net->read_pos[0];
@@ -2177,7 +2211,10 @@
     */
     if (my_net_write(net,buff,(uint) (end-buff)) || net_flush(net))
     {
-      set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "sending connection information to server",
+                               errno);
       goto error;
     }
 
@@ -2256,7 +2293,10 @@
   /* Write authentication package */
   if (my_net_write(net,buff,(ulong) (end-buff)) || net_flush(net))
   {
-    set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+    set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                             ER(CR_SERVER_LOST_EXTENDED),
+                             "sending authentication information",
+                             errno);
     goto error;
   }
   
@@ -2266,7 +2306,14 @@
   */
 
   if ((pkt_length=cli_safe_read(mysql)) == packet_error)
+  {
+    if (mysql->net.last_errno == CR_SERVER_LOST)
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "reading authorization packet",
+                               errno);
     goto error;
+  }
 
   if (pkt_length == 1 && net->read_pos[0] == 254 && 
       mysql->server_capabilities & CLIENT_SECURE_CONNECTION)
@@ -2278,12 +2325,22 @@
     scramble_323(buff, mysql->scramble, passwd);
     if (my_net_write(net, buff, SCRAMBLE_LENGTH_323 + 1) || net_flush(net))
     {
-      set_mysql_error(mysql, CR_SERVER_LOST, unknown_sqlstate);
+      set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                               ER(CR_SERVER_LOST_EXTENDED),
+                               "sending password information",
+                               errno);
       goto error;
     }
     /* Read what server thinks about out new auth message report */
     if (cli_safe_read(mysql) == packet_error)
+    {
+      if (mysql->net.last_errno == CR_SERVER_LOST)
+        set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                                 ER(CR_SERVER_LOST_EXTENDED),
+                                 "reading final connect information",
+                                 errno);
       goto error;
+    }
   }
 
   if (client_flag & CLIENT_COMPRESS)		/* We will use compression */
@@ -2294,8 +2351,15 @@
     goto error;
 #endif
 
-  if (db && mysql_select_db(mysql,db))
+  if (db && mysql_select_db(mysql, db))
+  {
+    if (mysql->net.last_errno == CR_SERVER_LOST)
+        set_mysql_extended_error(mysql, CR_SERVER_LOST, unknown_sqlstate,
+                                 ER(CR_SERVER_LOST_EXTENDED),
+                                 "Setting intital database",
+                                 errno);
     goto error;
+  }
 
   if (mysql->options.init_commands)
   {
@@ -2326,7 +2390,7 @@
     goto error;
 #endif
 
-  DBUG_PRINT("exit",("Mysql handler: %lx",mysql));
+  DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql));
   reset_sigpipe(mysql);
   DBUG_RETURN(mysql);
 
@@ -2699,7 +2763,7 @@
 mysql_real_query(MYSQL *mysql, const char *query, ulong length)
 {
   DBUG_ENTER("mysql_real_query");
-  DBUG_PRINT("enter",("handle: %lx",mysql));
+  DBUG_PRINT("enter",("handle: 0x%lx", (long) mysql));
   DBUG_PRINT("query",("Query = '%-.4096s'",query));
 
   if (mysql_send_query(mysql,query,length))

--- 1.25/sql-common/my_time.c	2006-11-16 22:19:28 +03:00
+++ 1.26/sql-common/my_time.c	2006-11-26 22:52:45 +03:00
@@ -963,7 +963,7 @@
   */
   if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE))
     tmp= 0;
-end:
+
   return (my_time_t) tmp;
 } /* my_system_gmt_sec */
 

--- 1.71/strings/decimal.c	2006-10-30 08:52:47 +03:00
+++ 1.72/strings/decimal.c	2006-11-26 22:52:45 +03:00
@@ -1348,7 +1348,7 @@
     }
     from+=i;
     *buf=x ^ mask;
-    if (((uint32)*buf) >=  powers10[intg0x+1])
+    if (((ulonglong)*buf) >= (ulonglong) powers10[intg0x+1])
       goto err;
     if (buf > to->buf || *buf != 0)
       buf++;
Thread
bk commit into 5.0 tree (evgen:1.2317)eugene27 Nov