Commit 73f5ae21 authored by unknown's avatar unknown
Browse files

Merge knielsen@10.100.52.19:/usr/local/mysql/mysql-4.1-mtr-fix

into  mysql.com:/data0/knielsen/mysql-4.1-mtr-fix

parents ab72618b 9a7a78f7
Loading
Loading
Loading
Loading
+34 −1
Original line number Diff line number Diff line
@@ -1377,6 +1377,38 @@ dict_col_reposition_in_cache(
	HASH_INSERT(dict_col_t, hash, dict_sys->col_hash, fold, col);
}

/********************************************************************
If the given column name is reserved for InnoDB system columns, return
TRUE.*/

ibool
dict_col_name_is_reserved(
/*======================*/
				/* out: TRUE if name is reserved */
	const char*	name)	/* in: column name */
{
	/* This check reminds that if a new system column is added to
	the program, it should be dealt with here. */
#if DATA_N_SYS_COLS != 4
#error "DATA_N_SYS_COLS != 4"
#endif

	static const char*	reserved_names[] = {
		"DB_ROW_ID", "DB_TRX_ID", "DB_ROLL_PTR", "DB_MIX_ID"
	};

	ulint			i;

	for (i = 0; i < UT_ARR_SIZE(reserved_names); i++) {
		if (strcmp(name, reserved_names[i]) == 0) {

			return(TRUE);
		}
	}

	return(FALSE);
}

/**************************************************************************
Adds an index to the dictionary cache. */

@@ -2160,8 +2192,9 @@ dict_foreign_error_report(
	fputs(msg, file);
	fputs(" Constraint:\n", file);
	dict_print_info_on_foreign_key_in_create_format(file, NULL, fk);
	putc('\n', file);
	if (fk->foreign_index) {
		fputs("\nThe index in the foreign key in table is ", file);
		fputs("The index in the foreign key in table is ", file);
		ut_print_name(file, NULL, fk->foreign_index->name);
		fputs(
"\nSee http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html\n"
+15 −0
Original line number Diff line number Diff line
@@ -94,6 +94,21 @@ dict_mem_table_create(
	return(table);
}

/********************************************************************
Free a table memory object. */

void
dict_mem_table_free(
/*================*/
	dict_table_t*	table)		/* in: table */
{
	ut_ad(table);
	ut_ad(table->magic_n == DICT_TABLE_MAGIC_N);

	mutex_free(&(table->autoinc_mutex));
	mem_heap_free(table->heap);
}

/**************************************************************************
Creates a cluster memory object. */

+9 −0
Original line number Diff line number Diff line
@@ -98,6 +98,15 @@ ulint
dict_col_get_clust_pos(
/*===================*/
	dict_col_t*	col);
/********************************************************************
If the given column name is reserved for InnoDB system columns, return
TRUE. */

ibool
dict_col_name_is_reserved(
/*======================*/
				/* out: TRUE if name is reserved */
	const char*	name);	/* in: column name */
/************************************************************************
Initializes the autoinc counter. It is not an error to initialize an already
initialized counter. */
+7 −0
Original line number Diff line number Diff line
@@ -55,6 +55,13 @@ dict_mem_table_create(
					is ignored if the table is made
					a member of a cluster */
	ulint		n_cols);	/* in: number of columns */
/********************************************************************
Free a table memory object. */

void
dict_mem_table_free(
/*================*/
	dict_table_t*	table);		/* in: table */
/**************************************************************************
Creates a cluster memory object. */

+3 −0
Original line number Diff line number Diff line
@@ -242,6 +242,9 @@ contains the sum of the following flag and the locally stored len. */

#define UNIV_EXTERN_STORAGE_FIELD (UNIV_SQL_NULL - UNIV_PAGE_SIZE)

/* Compile-time constant of the given array's size. */
#define UT_ARR_SIZE(a) (sizeof(a) / sizeof((a)[0]))

#include <stdio.h>
#include "ut0dbg.h"
#include "ut0ut.h"
Loading