List:Commits« Previous MessageNext Message »
From:monty Date:May 4 2006 3:28am
Subject:bk commit into 5.1 tree (monty:1.2395) BUG#16445
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of monty. When monty 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.2395 06/05/04 06:28:24 monty@stripped +15 -0
  After merge fixes
  Remove compiler warnings
  Fix some broken tests
  Workaround for syncronization bug in NDB (Bug #16445)

  sql/sql_table.cc
    1.329 06/05/04 06:28:20 monty@stripped +4 -3
    Fixed file-not-closed error

  mysys/my_open.c
    1.27 06/05/04 06:28:20 monty@stripped +21 -0
    Added function to print names of open files

  mysys/my_init.c
    1.49 06/05/04 06:28:20 monty@stripped +1 -0
    In case of EXTRA_DEBUG, print names of open files

  mysys/my_file.c
    1.4 06/05/04 06:28:20 monty@stripped +8 -1
    Ensure that structs are cleared and copyied properly so that my_print_open_files() works.

  mysys/errors.c
    1.21 06/05/04 06:28:20 monty@stripped +2 -0
    Print names of open files

  mysql-test/t/ndb_config.test
    1.12 06/05/04 06:28:20 monty@stripped +5 -0
    Remove not portable test

  mysql-test/t/ndb_basic.test
    1.41 06/05/04 06:28:20 monty@stripped +12 -0
    Workaround for syncronization bug in NDB

  mysql-test/r/ndb_config.result
    1.9 06/05/04 06:28:20 monty@stripped +0 -1
    Remove not portable test

  mysql-test/r/ndb_basic.result
    1.40 06/05/04 06:28:20 monty@stripped +7 -0
    Workaround for syncronization bug in NDB

  mysql-test/r/mysqldump.result
    1.104 06/05/04 06:28:20 monty@stripped +3 -2
    After merge fix

  mysql-test/lib/mtr_report.pl
    1.23 06/05/04 06:28:20 monty@stripped +5 -5
    Only print warning once

  mysql-test/include/have_ndb.inc
    1.9 06/05/04 06:28:20 monty@stripped +2 -0
    Added comment

  include/mysys_err.h
    1.15 06/05/04 06:28:20 monty@stripped +2 -1
    Print names of open files

  include/my_sys.h
    1.193 06/05/04 06:28:20 monty@stripped +7 -0
    Added function to print names of open files

  client/mysqltest.c
    1.208 06/05/04 06:28:20 monty@stripped +11 -8
    Added more information to output from abort_not_supported_test()
    Removed compiler warnings

# 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:	monty
# Host:	narttu.mysql.fi
# Root:	/home/my/mysql-5.1

--- 1.192/include/my_sys.h	2006-05-03 16:03:14 +03:00
+++ 1.193/include/my_sys.h	2006-05-04 06:28:20 +03:00
@@ -558,6 +558,7 @@
 extern File my_register_filename(File fd, const char *FileName,
 				 enum file_type type_of_file,
 				 uint error_message_number, myf MyFlags);
+extern void my_print_open_files(void);
 extern File my_create(const char *FileName,int CreateFlags,
 		      int AccessFlags, myf MyFlags);
 extern int my_close(File Filedes,myf MyFlags);
@@ -645,6 +646,12 @@
 #else
 #define dont_break()
 #define allow_break()
+#endif
+
+#ifdef EXTRA_DEBUG
+void my_print_open_files();
+#else
+#define my_print_open_files()
 #endif
 
 extern my_bool init_tmpdir(MY_TMPDIR *tmpdir, const char *pathlist);

--- 1.14/include/mysys_err.h	2005-02-24 23:33:37 +02:00
+++ 1.15/include/mysys_err.h	2006-05-04 06:28:20 +03:00
@@ -62,7 +62,8 @@
 #define EE_SYNC			27
 #define EE_UNKNOWN_COLLATION	28
 #define EE_FILENOTFOUND		29
-#define EE_ERROR_LAST           29 /*Copy last error nr.*/
+#define EE_FILE_NOT_CLOSED	30
+#define EE_ERROR_LAST           30 /* Copy last error nr */
 /* Add error numbers before EE_ERROR_LAST and change it accordingly. */
 
   /* exit codes for all MySQL programs */

--- 1.20/mysys/errors.c	2006-05-03 19:40:48 +03:00
+++ 1.21/mysys/errors.c	2006-05-04 06:28:20 +03:00
@@ -50,6 +50,7 @@
   "Can't sync file '%s' to disk (Errcode: %d)",
   "Collation '%s' is not a compiled collation and is not specified in the '%s' file",
   "File '%s' not found (Errcode: %d)",
+  "File '%s' (fileno: %d) was not closed"
 };
 
 void init_glob_errs(void)
@@ -89,5 +90,6 @@
   EE(EE_SYNC)=		"Can't sync file '%s' to disk (Errcode: %d)";
   EE(EE_UNKNOWN_COLLATION)= "Collation '%s' is not a compiled collation and is not specified in the %s file";
   EE(EE_FILENOTFOUND)	= "File '%s' not found (Errcode: %d)";
+  EE(EE_FILE_NOT_CLOSED) = "File '%s' (fileno: %d) was not closed";
 }
 #endif

--- 1.48/mysys/my_init.c	2006-04-17 23:05:14 +03:00
+++ 1.49/mysys/my_init.c	2006-05-04 06:28:20 +03:00
@@ -150,6 +150,7 @@
       sprintf(errbuff[0],EE(EE_OPEN_WARNING),my_file_opened,my_stream_opened);
       (void) my_message_no_curses(EE_OPEN_WARNING,errbuff[0],ME_BELL);
       DBUG_PRINT("error",("%s",errbuff[0]));
+      my_print_open_files();
     }
   }
   free_charsets();

--- 1.26/mysys/my_open.c	2006-04-15 18:48:54 +03:00
+++ 1.27/mysys/my_open.c	2006-05-04 06:28:20 +03:00
@@ -351,3 +351,24 @@
   return fh;                        /* return handle */
 }
 #endif /* __WIN__ */
+
+
+#ifdef EXTRA_DEBUG
+
+void my_print_open_files(void)
+{
+  if (my_file_opened | my_stream_opened)
+  {
+    uint i;
+    for (i= 0 ; i < my_file_limit ; i++)
+    {
+      if (my_file_info[i].type != UNOPEN)
+      {
+        fprintf(stderr, EE(EE_FILE_NOT_CLOSED), my_file_info[i].name, i);
+        fputc('\n', stderr);
+      }
+    }
+  }
+}
+
+#endif

--- 1.328/sql/sql_table.cc	2006-05-04 00:13:14 +03:00
+++ 1.329/sql/sql_table.cc	2006-05-04 06:28:20 +03:00
@@ -1073,7 +1073,7 @@
   global_ddl_log.inited= FALSE;
   global_ddl_log.recovery_phase= TRUE;
   global_ddl_log.io_size= IO_SIZE;
-  global_ddl_log.file_id=(File)-1;
+  global_ddl_log.file_id= (File) -1;
 
   /*
     To be able to run this from boot, we allocate a temporary THD
@@ -1138,11 +1138,12 @@
     my_free((char*)free_list, MYF(0));
     free_list= tmp;
   }
-  if (global_ddl_log.inited)
+  if (global_ddl_log.file_id >= 0)
   {
-    global_ddl_log.inited= 0;
     VOID(my_close(global_ddl_log.file_id, MYF(MY_WME)));
+    global_ddl_log.file_id= (File) -1;
   }
+  global_ddl_log.inited= 0;
   pthread_mutex_unlock(&LOCK_gdl);
   VOID(pthread_mutex_destroy(&LOCK_gdl));
   DBUG_VOID_RETURN;

--- 1.8/mysql-test/r/ndb_config.result	2006-01-19 20:32:52 +02:00
+++ 1.9/mysql-test/r/ndb_config.result	2006-05-04 06:28:20 +03:00
@@ -8,4 +8,3 @@
 ndbd,1,localhost ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndb_mgmd,5,localhost mysqld,6, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
 ndbd,2,localhost ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndb_mgmd,6,localhost mysqld,1, mysqld,7, mysqld,8, mysqld,9, mysqld,10,
 ndbd,3,localhost ndbd,4,localhost ndbd,5,localhost ndbd,6,localhost ndb_mgmd,1,localhost ndb_mgmd,2,localhost mysqld,11, mysqld,12, mysqld,13, mysqld,14, mysqld,15,
-shm,3,4,35,3 shm,3,5,35,3 shm,3,6,35,3 shm,4,5,35,4 shm,4,6,35,4 shm,5,6,35,5 tcp,11,3,55,3 tcp,11,4,55,4 tcp,11,5,55,5 tcp,11,6,55,6 tcp,12,3,55,3 tcp,12,4,55,4 tcp,12,5,55,5 tcp,12,6,55,6 tcp,13,3,55,3 tcp,13,4,55,4 tcp,13,5,55,5 tcp,13,6,55,6 tcp,14,3,55,3 tcp,14,4,55,4 tcp,14,5,55,5 tcp,14,6,55,6 tcp,15,3,55,3 tcp,15,4,55,4 tcp,15,5,55,5 tcp,15,6,55,6 tcp,1,3,55,1 tcp,1,4,55,1 tcp,1,5,55,1 tcp,1,6,55,1 tcp,2,3,55,2 tcp,2,4,55,2 tcp,2,5,55,2 tcp,2,6,55,2

--- 1.11/mysql-test/t/ndb_config.test	2006-02-20 16:03:12 +02:00
+++ 1.12/mysql-test/t/ndb_config.test	2006-05-04 06:28:20 +03:00
@@ -15,4 +15,9 @@
 --exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster0 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
 --exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster1 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
 --exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --query=type,nodeid,host --mycnf 2> /dev/null
+
+# Following doesn't work in all configurations
+
+--disable_parsing
 --exec $NDB_TOOLS_DIR/ndb_config --defaults-group-suffix=.cluster2 --defaults-file=$MYSQL_TEST_DIR/std_data/ndb_config_mycnf2.cnf --ndb-shm --connections --query=type,nodeid1,nodeid2,group,nodeidserver --mycnf 2> /dev/null
+--enable_parsing

--- 1.22/mysql-test/lib/mtr_report.pl	2006-05-03 19:40:48 +03:00
+++ 1.23/mysql-test/lib/mtr_report.pl	2006-05-04 06:28:20 +03:00
@@ -244,11 +244,11 @@
             }
           }
         }
-        if ( $found_problems )
-        {
-          mtr_warning("Got errors/warnings while running tests, please examine",
-                      "\"$warnlog\" for details.");
-        }
+      }
+      if ( $found_problems )
+      {
+	mtr_warning("Got errors/warnings while running tests, please examine",
+		    "\"$warnlog\" for details.");
       }
     }
   }

--- 1.8/mysql-test/include/have_ndb.inc	2006-04-24 13:00:07 +03:00
+++ 1.9/mysql-test/include/have_ndb.inc	2006-05-04 06:28:20 +03:00
@@ -5,6 +5,8 @@
 enable_query_log;
 
 # Check that NDB is installed and known to be working
+# This will disable ndb from the shell script 'mysql-test-run'
+
 -- require r/have_ndb_status_ok.require
 disable_query_log;
 eval select "$NDB_STATUS_OK" as ndb_status_ok;

--- 1.39/mysql-test/r/ndb_basic.result	2006-04-18 13:16:03 +03:00
+++ 1.40/mysql-test/r/ndb_basic.result	2006-05-04 06:28:20 +03:00
@@ -6,6 +6,13 @@
 attr2 INT,
 attr3 VARCHAR(10)
 ) ENGINE=ndbcluster;
+drop table t1;
+CREATE TABLE t1 (
+pk1 INT NOT NULL PRIMARY KEY,
+attr1 INT NOT NULL,
+attr2 INT,
+attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
 SHOW INDEX FROM t1;
 Table	Non_unique	Key_name	Seq_in_index	Column_name	Collation	Cardinality	Sub_part	Packed	Null	Index_type	Comment
 t1	0	PRIMARY	1	pk1	A	0	NULL	NULL		BTREE	

--- 1.40/mysql-test/t/ndb_basic.test	2006-04-06 11:47:30 +03:00
+++ 1.41/mysql-test/t/ndb_basic.test	2006-05-04 06:28:20 +03:00
@@ -6,6 +6,18 @@
 drop database if exists mysqltest;
 --enable_warnings
 
+# workaround for bug#16445
+# remove to reproduce bug and run tests from ndb start
+# and with ndb_autodiscover disabled. Fails on Linux 50 % of the times
+
+CREATE TABLE t1 (
+  pk1 INT NOT NULL PRIMARY KEY,
+  attr1 INT NOT NULL,
+  attr2 INT,
+  attr3 VARCHAR(10)
+) ENGINE=ndbcluster;
+drop table t1;
+
 #
 # Basic test to show that the NDB 
 # table handler is working

--- 1.3/mysys/my_file.c	2006-04-16 11:50:20 +03:00
+++ 1.4/mysys/my_file.c	2006-05-04 06:28:20 +03:00
@@ -107,7 +107,10 @@
     DBUG_RETURN(MY_NFILE);
 
   /* Copy any initialized files */
-  memcpy((char*) tmp, (char*) my_file_info, sizeof(*tmp) * my_file_limit);
+  memcpy((char*) tmp, (char*) my_file_info,
+         sizeof(*tmp) * min(my_file_limit, files));
+  bzero((char*) (tmp + my_file_limit),
+        max((int) (files- my_file_limit), 0)*sizeof(*tmp));
   my_free_open_file_info();			/* Free if already allocated */
   my_file_info= tmp;
   my_file_limit= files;
@@ -121,8 +124,12 @@
   DBUG_ENTER("my_free_file_info");
   if (my_file_info != my_file_info_default)
   {
+    /* Copy data back for my_print_open_files */
+    memcpy((char*) my_file_info_default, my_file_info,
+           sizeof(*my_file_info_default)* MY_NFILE);
     my_free((char*) my_file_info, MYF(0));
     my_file_info= my_file_info_default;
+    my_file_limit= MY_NFILE;
   }
   DBUG_VOID_RETURN;
 }

--- 1.207/client/mysqltest.c	2006-05-01 21:38:11 +03:00
+++ 1.208/client/mysqltest.c	2006-05-04 06:28:20 +03:00
@@ -688,10 +688,11 @@
 
 /* Note that we will get some memory leaks when calling this! */
 
-static void abort_not_supported_test()
+static void abort_not_supported_test(const char *fname)
 {
   DBUG_ENTER("abort_not_supported_test");
-  fprintf(stderr, "This test is not supported by this installation\n");
+  fprintf(stderr, "The test '%s' is not supported by this installation\n",
+          fname);
   if (!silent)
     printf("skipped\n");
   free_used_memory();
@@ -814,7 +815,7 @@
   DBUG_ENTER("check_result");
 
   if (res && require_option)
-    abort_not_supported_test();
+    abort_not_supported_test(fname);
   switch (res) {
   case RESULT_OK:
     break; /* ok */
@@ -1036,7 +1037,7 @@
 int do_require_manager(struct st_query *query __attribute__((unused)) )
 {
   if (!manager)
-    abort_not_supported_test();
+    abort_not_supported_test("manager");
   return 0;
 }
 
@@ -1305,7 +1306,9 @@
     uint i;
     ulong *lengths;
     char *end;
+#ifdef NOT_YET
     MYSQL_FIELD *fields= mysql_fetch_fields(res);
+#endif
 
     init_dynamic_string(&result, "", 16384, 65536);
     lengths= mysql_fetch_lengths(res);
@@ -1920,7 +1923,7 @@
   q->last_argument= p;
   charset_info= get_charset_by_csname(charset_name,MY_CS_PRIMARY,MYF(MY_WME));
   if (!charset_info)
-    abort_not_supported_test();
+    abort_not_supported_test(charset_name);
 }
 
 static uint get_errcodes(match_err *to,struct st_query *q)
@@ -1963,7 +1966,7 @@
           (as in ER_WRONG_VALUE vs. ER_WRONG_VALUE_COUNT).
         */
 	if (!strncmp(start, e->name, (int) (p - start)) &&
-            strlen(e->name) == (p - start))
+            (uint) strlen(e->name) == (uint) (p - start))
 	{
 	  to[count].code.errnum= (uint) e->code;
 	  to[count].type= ERR_ERRNO;
@@ -4329,7 +4332,7 @@
     if (err_errno == CR_SERVER_LOST ||
         err_errno == CR_SERVER_GONE_ERROR)
       die("require query '%s' failed: %d: %s", query, err_errno, err_error);
-    abort_not_supported_test();
+    abort_not_supported_test("failed_query");
   }
 
   if (q->abort_on_error)
@@ -5101,7 +5104,7 @@
   DBUG_VOID_RETURN;
 }
 
-static void mark_progress(int line)
+static void mark_progress(int line __attribute__((unused)))
 {
 #ifdef NOT_YET
   static FILE* fp = NULL;

--- 1.103/mysql-test/r/mysqldump.result	2006-03-10 21:37:32 +02:00
+++ 1.104/mysql-test/r/mysqldump.result	2006-05-04 06:28:20 +03:00
@@ -3,13 +3,14 @@
 drop database if exists db1;
 drop database if exists db2;
 drop view if exists v1, v2, v3;
-CREATE TABLE t1(a int);
+CREATE TABLE t1(a int, key (a)) key_block_size=1024;
 INSERT INTO t1 VALUES (1), (2);
 <?xml version="1.0"?>
 <mysqldump xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <database name="test">
 	<table_structure name="t1">
-		<field Field="a" Type="int(11)" Null="YES" Key="" Extra="" />
+		<field Field="a" Type="int(11)" Null="YES" Key="MUL" Extra="" />
+		<key Table="t1" Non_unique="1" Key_name="a" Seq_in_index="1" Column_name="a" Collation="A" Null="YES" Index_type="BTREE" Comment="" />
 	</table_structure>
 	<table_data name="t1">
 	<row>
Thread
bk commit into 5.1 tree (monty:1.2395) BUG#16445monty4 May