• unknown's avatar
    Apply InnoDB snapshot ss923 · 2378f5d2
    unknown authored
    Fixes:
    - Bug #18077: InnoDB uses full explicit table locks in stored FUNCTION
    
    
    storage/innobase/btr/btr0btr.c:
      Apply InnoDB snapshot ss923
      
      Revision r919:
      btr_page_get_father_for_rec(): Remove bogus comment about removed dict_tree_t.
    storage/innobase/dict/dict0dict.c:
      Apply InnoDB snapshot ss923
      
      Revision r892:
      Merge changes from MySQL AB.
      
      dict_col_copy_type_noninline(): Remove the return statement.
      Some compilers do not allow return expressions of void type.
      
      innobase_start_or_create_for_mysql(): Do not cap srv_max_threads to 1000
      on Windows.
      
      Makefile.am (EXTRA_DIST): Add plug.in
      
      
      Revision r897:
      dict_index_get_if_in_cache(): Enclose in #ifdef UNIV_DEBUG.
      Replace the search loop with a call to dict_index_find_on_id_low().
    storage/innobase/handler/ha_innodb.cc:
      Apply InnoDB snapshot ss923
      
      Revision r887:
      storage/innobase/handler: Merge changes from MySQL AB:
      
      ChangeSet
        2006/09/30 18:44:42-07:00 brian@zim.(none) 
        Merge zim.(none):/home/brian/mysql/merge-5.1
        into  zim.(none):/home/brian/mysql/arch-5.1
      
      ChangeSet
        2006/09/30 12:49:46-07:00 brian@zim.(none) 
        This patch adds handlerton passing to functions. NDB and Innodb still require a global hanlderton in the main code due to the nature of the sql_cache call back function (should be solveable... another patch).
        Partitioning now has a flag to allow disabling of engines from being compatible with partitioning. Cleaned up heap naming convention on panic call. 
      
      ChangeSet
        2006/09/29 17:19:02-07:00 brian@zim.(none) 
        This removes the passing of global hton to engine instance. 
      
      ChangeSet
        2006/09/28 13:22:56+02:00 gbichot@dl145h.mysql.com 
        Merge gbichot@bk-internal:/home/bk/mysql-5.1-arch
        into  dl145h.mysql.com:/users/gbichot/mysql-5.1-arch
      
      ChangeSet
        2006/09/28 13:19:43+02:00 gbichot@dl145h.mysql.com 
        In the handlerton, cursor creation function don't have an argument
        and so the engine calls current_thd to derive transaction information;
        instead we now pass THD to those functions, it looks more logical
        (it makes the implicit current_thd parameter more visible).
        Approved by Brian and Monty.
      
      ChangeSet
        2006/09/26 22:51:53-07:00 brian@zim.(none) 
        Merge zim.(none):/home/brian/mysql/merge-5.1
        into  zim.(none):/home/brian/mysql/arch-5.1
      
      
      Revision r895:
      Merge changes from MySQL AB, and remove two compilation warnings.
      
      ha_innodb.cc: innodb_mutex_show_status(): Add (ulong) casts to
      ulonglong expressions being passed to fprintf %lu.  The warnings
      were apparently introduced by MySQL AB developers.
      
      mysql_declare_plugin(innobase): Add PLUGIN_LICENSE_GPL.
      
      have_innodb.inc: Merge changes from MySQL AB.
      
      
      Revision r923:
      ha_innobase::store_lock(): When downgrading table locks, do not
      check thd->in_lock_tables but test if
      thd->lex->sql_command == SQLCOM_LOCK_TABLES
      instead.  Otherwise, stored functions will use table locks.  (Bug #18077)
      
      This patch is from Heikki.
    storage/innobase/include/dict0dict.h:
      Apply InnoDB snapshot ss923
      
      Revision r897:
      dict_index_get_if_in_cache(): Enclose in #ifdef UNIV_DEBUG.
      Replace the search loop with a call to dict_index_find_on_id_low().
    storage/innobase/include/mem0dbg.h:
      Apply InnoDB snapshot ss923
      
      Revision r901:
      Enclose some mem debug functions in #ifdef UNIV_DEBUG or #ifdef UNIV_MEM_DEBUG.
    storage/innobase/include/mtr0mtr.h:
      Apply InnoDB snapshot ss923
      
      Revision r866:
      mtr_print(), mtr_memo_contains(): Disable unless #ifdef UNIV_DEBUG.
    storage/innobase/include/mtr0mtr.ic:
      Apply InnoDB snapshot ss923
      
      Revision r866:
      mtr_print(), mtr_memo_contains(): Disable unless #ifdef UNIV_DEBUG.
    storage/innobase/include/sync0rw.h:
      Apply InnoDB snapshot ss923
      
      Revision r907:
      Send all SHOW ENGINE INNODB STATUS information to the client also when
      UNIV_SYNC_DEBUG is defined.
      
      rw_lock_list_print_info(): Add parameter "file".
      
      mutex_list_print_info(): Add parameter "file".  Make the function static.
    storage/innobase/include/sync0sync.h:
      Apply InnoDB snapshot ss923
      
      Revision r907:
      Send all SHOW ENGINE INNODB STATUS information to the client also when
      UNIV_SYNC_DEBUG is defined.
      
      rw_lock_list_print_info(): Add parameter "file".
      
      mutex_list_print_info(): Add parameter "file".  Make the function static.
    storage/innobase/include/univ.i:
      Apply InnoDB snapshot ss923
      
      Revision r894:
      univ.i: Indent some of the directives, and remove conditions about Windows
      in the "#else" branch of "#if building on Windows".
    storage/innobase/mem/mem0dbg.c:
      Apply InnoDB snapshot ss923
      
      Revision r901:
      Enclose some mem debug functions in #ifdef UNIV_DEBUG or #ifdef UNIV_MEM_DEBUG.
      
      
      Revision r902:
      mem0dbg.c: Enclose some more function definitions in #ifdef UNIV_MEM_DEBUG.
      The declarations were already enclosed in #ifdef UNIV_MEM_DEBUG.
    storage/innobase/mem/mem0pool.c:
      Apply InnoDB snapshot ss923
      
      Revision r896:
      mem0pool.c: Remove obsolete comments about the dictionary cache being
      managed with an LRU algorithm.
    storage/innobase/mtr/mtr0mtr.c:
      Apply InnoDB snapshot ss923
      
      Revision r866:
      mtr_print(), mtr_memo_contains(): Disable unless #ifdef UNIV_DEBUG.
    storage/innobase/row/row0purge.c:
      Apply InnoDB snapshot ss923
      
      Revision r869:
      row_purge_parse_undo_rec(): Correct a faulty condition.  Luckily, this
      bug would only surface if the InnoDB SQL interpreter were used for
      updating fixed-length columns.  Currently (as the UPD_NODE_NO_SIZE_CHANGE
      flag is never set), cmpl_info can only be 0 or UPD_NODE_NO_ORD_CHANGE.
      Luckily, UPD_NODE_NO_ORD_CHANGE is 1, and the condition was simplified
      to !cmpl_info.
    storage/innobase/sync/sync0rw.c:
      Apply InnoDB snapshot ss923
      
      Revision r907:
      Send all SHOW ENGINE INNODB STATUS information to the client also when
      UNIV_SYNC_DEBUG is defined.
      
      rw_lock_list_print_info(): Add parameter "file".
      
      mutex_list_print_info(): Add parameter "file".  Make the function static.
    storage/innobase/sync/sync0sync.c:
      Apply InnoDB snapshot ss923
      
      Revision r907:
      Send all SHOW ENGINE INNODB STATUS information to the client also when
      UNIV_SYNC_DEBUG is defined.
      
      rw_lock_list_print_info(): Add parameter "file".
      
      mutex_list_print_info(): Add parameter "file".  Make the function static.
    2378f5d2
mem0dbg.h 4.16 KB
/******************************************************
The memory management: the debug code. This is not a compilation module,
but is included in mem0mem.* !

(c) 1994, 1995 Innobase Oy

Created 6/9/1994 Heikki Tuuri
*******************************************************/

/* In the debug version each allocated field is surrounded with
check fields whose sizes are given below */

#ifdef UNIV_MEM_DEBUG
#define MEM_FIELD_HEADER_SIZE	ut_calc_align(2 * sizeof(ulint),\
						UNIV_MEM_ALIGNMENT)
#define MEM_FIELD_TRAILER_SIZE	sizeof(ulint)
#else
#define MEM_FIELD_HEADER_SIZE	0
#endif


/* Space needed when allocating for a user a field of
length N. The space is allocated only in multiples of
UNIV_MEM_ALIGNMENT. In the debug version there are also
check fields at the both ends of the field. */
#ifdef UNIV_MEM_DEBUG
#define MEM_SPACE_NEEDED(N) ut_calc_align((N) + MEM_FIELD_HEADER_SIZE\
		 + MEM_FIELD_TRAILER_SIZE, UNIV_MEM_ALIGNMENT)
#else
#define MEM_SPACE_NEEDED(N) ut_calc_align((N), UNIV_MEM_ALIGNMENT)
#endif

#if defined UNIV_MEM_DEBUG || defined UNIV_DEBUG
/*******************************************************************
Checks a memory heap for consistency and prints the contents if requested.
Outputs the sum of sizes of buffers given to the user (only in
the debug version), the physical size of the heap and the number of
blocks in the heap. In case of error returns 0 as sizes and number
of blocks. */

void
mem_heap_validate_or_print(
/*=======================*/
	mem_heap_t*	heap,	/* in: memory heap */
	byte*		top,	/* in: calculate and validate only until
				this top pointer in the heap is reached,
				if this pointer is NULL, ignored */
	ibool		 print,	 /* in: if TRUE, prints the contents
				of the heap; works only in
				the debug version */
	ibool*		 error,	 /* out: TRUE if error */
	ulint*		us_size,/* out: allocated memory
				(for the user) in the heap,
				if a NULL pointer is passed as this
				argument, it is ignored; in the
				non-debug version this is always -1 */
	ulint*		ph_size,/* out: physical size of the heap,
				if a NULL pointer is passed as this
				argument, it is ignored */
	ulint*		n_blocks); /* out: number of blocks in the heap,
				if a NULL pointer is passed as this
				argument, it is ignored */
#endif /* UNIV_MEM_DEBUG || UNIV_DEBUG */
#ifdef UNIV_DEBUG
/******************************************************************
Checks that an object is a memory heap (or a block of it) */

ibool
mem_heap_check(
/*===========*/
				/* out: TRUE if ok */
	mem_heap_t*   heap);	/* in: memory heap */
#endif /* UNIV_DEBUG */
/******************************************************************
Validates the contents of a memory heap. */

ibool
mem_heap_validate(
/*==============*/
				/* out: TRUE if ok */
	mem_heap_t*   heap);	/* in: memory heap */
#ifdef UNIV_MEM_DEBUG
/*********************************************************************
TRUE if no memory is currently allocated. */

ibool
mem_all_freed(void);
/*===============*/
			/* out: TRUE if no heaps exist */
/*********************************************************************
Validates the dynamic memory */

ibool
mem_validate_no_assert(void);
/*=========================*/
			/* out: TRUE if error */
/****************************************************************
Validates the dynamic memory */

ibool
mem_validate(void);
/*===============*/
			/* out: TRUE if ok */
#endif /* UNIV_MEM_DEBUG */
/****************************************************************
Tries to find neigboring memory allocation blocks and dumps to stderr
the neighborhood of a given pointer. */

void
mem_analyze_corruption(
/*===================*/
	void*	ptr);	/* in: pointer to place of possible corruption */
/*********************************************************************
Prints information of dynamic memory usage and currently allocated memory
heaps or buffers. Can only be used in the debug version. */

void
mem_print_info(void);
/*================*/
/*********************************************************************
Prints information of dynamic memory usage and currently allocated memory
heaps or buffers since the last ..._print_info or..._print_new_info. */

void
mem_print_new_info(void);
/*====================*/