← Back to team overview

maria-developers team mailing list archive

[Branch ~maria-captains/maria/5.1] Rev 2765: Safety change to ensure read/black trees (used with heap tables) works on 64 bit setups where ulo...

 

------------------------------------------------------------
revno: 2765
committer: Michael Widenius <monty@xxxxxxxxx>
branch nick: maria-5.1
timestamp: Mon 2009-11-16 17:34:08 +0200
message:
  Safety change to ensure read/black trees (used with heap tables) works on 64 bit setups where ulong <> size_t
  Don't retry test cases by default
  Fixed bug where we could (under unlikely error conditions) access not initialized variable
modified:
  include/my_tree.h
  mysql-test/mysql-test-run.pl
  mysys/tree.c
  sql/sql_delete.cc


--
lp:maria
https://code.launchpad.net/~maria-captains/maria/5.1

Your team Maria developers is subscribed to branch lp:maria.
To unsubscribe from this branch go to https://code.launchpad.net/~maria-captains/maria/5.1/+edit-subscription.
=== modified file 'include/my_tree.h'
--- include/my_tree.h	2008-05-29 15:33:33 +0000
+++ include/my_tree.h	2009-11-16 15:34:08 +0000
@@ -51,7 +51,7 @@
   TREE_ELEMENT *root,null_element;
   TREE_ELEMENT **parents[MAX_TREE_HEIGHT];
   uint offset_to_key,elements_in_tree,size_of_element;
-  ulong memory_limit, allocated;
+  size_t memory_limit, allocated;
   qsort_cmp2 compare;
   void *custom_arg;
   MEM_ROOT mem_root;
@@ -61,7 +61,7 @@
 } TREE;
 
 	/* Functions on whole tree */
-void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
+void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
                int size, qsort_cmp2 compare, my_bool with_delete,
 	       tree_element_free free_element, void *custom_arg);
 void delete_tree(TREE*);

=== modified file 'mysql-test/mysql-test-run.pl'
--- mysql-test/mysql-test-run.pl	2009-11-06 17:24:38 +0000
+++ mysql-test/mysql-test-run.pl	2009-11-16 15:34:08 +0000
@@ -218,7 +218,7 @@
 my $opt_start_dirty;
 my $opt_wait_all;
 my $opt_repeat= 1;
-my $opt_retry= 3;
+my $opt_retry= 1;
 my $opt_retry_failure= 2;
 
 my $opt_strace_client;

=== modified file 'mysys/tree.c'
--- mysys/tree.c	2007-05-10 09:59:39 +0000
+++ mysys/tree.c	2009-11-16 15:34:08 +0000
@@ -77,13 +77,13 @@
 static void rb_delete_fixup(TREE *tree,TREE_ELEMENT ***parent);
 
 
-	/* The actuall code for handling binary trees */
+/* The actual code for handling binary trees */
 
 #ifndef DBUG_OFF
 static int test_rb_tree(TREE_ELEMENT *element);
 #endif
 
-void init_tree(TREE *tree, ulong default_alloc_size, ulong memory_limit,
+void init_tree(TREE *tree, size_t default_alloc_size, size_t memory_limit,
                int size, qsort_cmp2 compare, my_bool with_delete,
 	       tree_element_free free_element, void *custom_arg)
 {
@@ -96,7 +96,7 @@
   bzero((uchar*) &tree->null_element,sizeof(tree->null_element));
   tree->root= &tree->null_element;
   tree->compare=compare;
-  tree->size_of_element=size > 0 ? (uint) size : 0;
+  tree->size_of_element= size > 0 ? (uint) size : 0;
   tree->memory_limit=memory_limit;
   tree->free=free_element;
   tree->allocated=0;
@@ -127,7 +127,7 @@
   }
   if (!(tree->with_delete=with_delete))
   {
-    init_alloc_root(&tree->mem_root, (uint) default_alloc_size, 0);
+    init_alloc_root(&tree->mem_root, default_alloc_size, 0);
     tree->mem_root.min_malloc=(sizeof(TREE_ELEMENT)+tree->size_of_element);
   }
   DBUG_VOID_RETURN;

=== modified file 'sql/sql_delete.cc'
--- sql/sql_delete.cc	2009-10-15 21:38:29 +0000
+++ sql/sql_delete.cc	2009-11-16 15:34:08 +0000
@@ -1073,8 +1073,8 @@
   /* If it is a temporary table, close and regenerate it */
   if (!dont_send_ok && (table= find_temporary_table(thd, table_list)))
   {
-    handlerton *table_type= table->s->db_type();
     TABLE_SHARE *share= table->s;
+    handlerton *table_type= share->db_type();
     if (!ha_check_storage_engine_flag(table_type, HTON_CAN_RECREATE))
       goto trunc_by_del;
 
@@ -1088,7 +1088,7 @@
     if ((error= (int) !(open_temporary_table(thd, share->path.str,
                                              share->db.str,
 					     share->table_name.str, 1))))
-      (void) rm_temporary_table(table_type, path);
+      (void) rm_temporary_table(table_type, share->path.str);
     else
       thd->thread_specific_used= TRUE;