List:Commits« Previous MessageNext Message »
From:kroki Date:July 29 2006 9:50am
Subject:bk commit into 5.0 tree (kroki:1.2224)
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of tomash. When tomash 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-07-29 13:50:08+04:00, kroki@stripped +2 -0
  Fix after manual merge.

  mysys/my_bitmap.c@stripped, 2006-07-29 13:50:05+04:00, kroki@stripped +1 -1
    Fix after manual merge.

  tests/mysql_client_test.c@stripped, 2006-07-29 13:50:05+04:00, kroki@stripped +44 -0
    Fix after manual merge: add test for bug#21206.

# 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:	kroki
# Host:	moonlight.intranet
# Root:	/home/tomash/src/mysql_ab/mysql-5.0-merge

--- 1.33/mysys/my_bitmap.c	2006-07-29 13:50:17 +04:00
+++ 1.34/mysys/my_bitmap.c	2006-07-29 13:50:17 +04:00
@@ -445,7 +445,7 @@ uint bitmap_get_first(const MY_BITMAP *m
 {
   uchar *bitmap=map->bitmap;
   uint bit_found = MY_BIT_NONE;
-  uint bitmap_size=map->bitmap_size*8;
+  uint bitmap_size=map->bitmap_size;
   uint i;
 
   DBUG_ASSERT(map->bitmap);

--- 1.193/tests/mysql_client_test.c	2006-07-29 13:50:17 +04:00
+++ 1.194/tests/mysql_client_test.c	2006-07-29 13:50:17 +04:00
@@ -15029,6 +15029,49 @@ static void test_bug20152()
 
 
 /*
+  Bug#21206: memory corruption when too many cursors are opened at once
+
+  Memory corruption happens when more than 1024 cursors are open
+  simultaneously.
+*/
+static void test_bug21206()
+{
+  const size_t cursor_count= 1025;
+
+  const char *create_table[]=
+  {
+    "DROP TABLE IF EXISTS t1",
+    "CREATE TABLE t1 (i INT)",
+    "INSERT INTO t1 VALUES (1), (2), (3)"
+  };
+  const char *query= "SELECT * FROM t1";
+
+  Stmt_fetch *fetch_array=
+    (Stmt_fetch*) calloc(cursor_count, sizeof(Stmt_fetch));
+
+  Stmt_fetch *fetch;
+
+  DBUG_ENTER("test_bug21206");
+  myheader("test_bug21206");
+
+  fill_tables(create_table, sizeof(create_table) / sizeof(*create_table));
+
+  for (fetch= fetch_array; fetch < fetch_array + cursor_count; ++fetch)
+  {
+    /* Init will exit(1) in case of error */
+    stmt_fetch_init(fetch, fetch - fetch_array, query);
+  }
+
+  for (fetch= fetch_array; fetch < fetch_array + cursor_count; ++fetch)
+    stmt_fetch_close(fetch);
+
+  free(fetch_array);
+
+  DBUG_VOID_RETURN;
+}
+
+
+/*
   Read and parse arguments and MySQL options from my.cnf
 */
 
@@ -15300,6 +15343,7 @@ static struct my_tests_st my_tests[]= {
   { "test_bug14169", test_bug14169 },
   { "test_bug17667", test_bug17667 },
   { "test_bug19671", test_bug19671},
+  { "test_bug21206", test_bug21206},
   { 0, 0 }
 };
 
Thread
bk commit into 5.0 tree (kroki:1.2224)kroki29 Jul