summaryrefslogtreecommitdiff
path: root/innobase/include
diff options
context:
space:
mode:
authorunknown <aivanov@mysql.com>2006-04-21 01:07:37 +0400
committerunknown <aivanov@mysql.com>2006-04-21 01:07:37 +0400
commit7ee05d7c713c0958cd56248b7b7397d72fea3941 (patch)
tree31ecaf555285cc75ca6c78a278663dcc1fc1c253 /innobase/include
parent6b63f270c6c9d31c72bb2ca5131c490e367be515 (diff)
downloadmariadb-git-7ee05d7c713c0958cd56248b7b7397d72fea3941.tar.gz
Applied innodb-5.0-ss476 snapshot.
Fix BUG#18934: "InnoDB crashes when table uses column like DB_ROW_ID". Also, fix memory leaks in row_create_table_for_mysql() in rare corner cases. innobase/dict/dict0dict.c: Applied innodb-5.0-ss476 snapshot. Refuse tables that use reserved column names (Bug#18934). innobase/dict/dict0load.c: Applied innodb-5.0-ss476 snapshot. dict_load_table(): Refuse to load tables with other TYPE than DICT_TABLE_ORDINARY. innobase/dict/dict0mem.c: Applied innodb-5.0-ss476 snapshot. Add dict_mem_table_free(), use it instead of duplicating the code everywhere. innobase/ibuf/ibuf0ibuf.c: Applied innodb-5.0-ss476 snapshot. innobase/include/dict0dict.h: Applied innodb-5.0-ss476 snapshot. Refuse tables that use reserved column name (Bug#18934). innobase/include/dict0mem.h: Applied innodb-5.0-ss476 snapshot. Add dict_mem_table_free(), use it instead of duplicating the code everywhere. innobase/include/univ.i: Applied innodb-5.0-ss476 snapshot. innobase/log/log0recv.c: Applied innodb-5.0-ss476 snapshot. innobase/row/row0mysql.c: Applied innodb-5.0-ss476 snapshot. Refuse tables that use reserved column names (Bug#18934). mysql-test/r/innodb.result: Applied innodb-5.0-ss476 snapshot. Fix result for test case for Bug#18934. (Other changes are to be restored by the next cset). mysql-test/t/innodb.test: Applied innodb-5.0-ss476 snapshot. Fix result for test case for Bug#18934. (Removed test case for Bug#14360 is to be restored by the next cset).
Diffstat (limited to 'innobase/include')
-rw-r--r--innobase/include/dict0dict.h9
-rw-r--r--innobase/include/dict0mem.h7
-rw-r--r--innobase/include/univ.i3
3 files changed, 19 insertions, 0 deletions
diff --git a/innobase/include/dict0dict.h b/innobase/include/dict0dict.h
index 4396611e529..642037494b5 100644
--- a/innobase/include/dict0dict.h
+++ b/innobase/include/dict0dict.h
@@ -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. */
diff --git a/innobase/include/dict0mem.h b/innobase/include/dict0mem.h
index 7eec86d0bcb..3c10e82342b 100644
--- a/innobase/include/dict0mem.h
+++ b/innobase/include/dict0mem.h
@@ -56,6 +56,13 @@ dict_mem_table_create(
a member of a cluster */
ulint n_cols, /* in: number of columns */
ibool comp); /* in: TRUE=compact page format */
+/********************************************************************
+Free a table memory object. */
+
+void
+dict_mem_table_free(
+/*================*/
+ dict_table_t* table); /* in: table */
/**************************************************************************
Creates a cluster memory object. */
diff --git a/innobase/include/univ.i b/innobase/include/univ.i
index 04b254a8221..bc3bd031f0c 100644
--- a/innobase/include/univ.i
+++ b/innobase/include/univ.i
@@ -261,6 +261,9 @@ it is read or written. */
/* Tell the compiler that cond is unlikely to hold */
#define UNIV_UNLIKELY(cond) UNIV_EXPECT(cond, FALSE)
+/* 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"