Below is the list of changes that have just been committed into a local
4.1 repository of alexi. When alexi 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
1.2504 06/04/20 23:09:49 aivanov@stripped +6 -0
Applied innodb-4.1-ss22 snapshot.
Fix BUG#16814: "SHOW INNODB STATUS format error in LATEST FOREIGN KEY ERROR section"
Add a missing newline to the LAST FOREIGN KEY ERROR section in SHOW INNODB STATUS
output.
Fix BUG#18934: "InnoDB crashes when table uses column names like DB_ROW_ID".
Refuse tables that use reserved column names.
innobase/row/row0mysql.c
1.94 06/04/20 23:09:46 aivanov@stripped +14 -0
Applied innodb-4.1-ss22 snapshot.
Refuse tables that use reserved column names (Bug#18934).
innobase/include/univ.i
1.39 06/04/20 23:09:46 aivanov@stripped +3 -0
Applied innodb-4.1-ss22 snapshot.
innobase/include/dict0mem.h
1.23 06/04/20 23:09:46 aivanov@stripped +7 -0
Applied innodb-4.1-ss22 snapshot.
Refuse tables that use reserved column names (Bug#18934).
innobase/include/dict0dict.h
1.34 06/04/20 23:09:46 aivanov@stripped +9 -0
Applied innodb-4.1-ss22 snapshot.
Refuse tables that use reserved column names (Bug#18934).
innobase/dict/dict0mem.c
1.16 06/04/20 23:09:46 aivanov@stripped +15 -0
Applied innodb-4.1-ss22 snapshot.
Refuse tables that use reserved column names (Bug#18934).
innobase/dict/dict0dict.c
1.67 06/04/20 23:09:46 aivanov@stripped +34 -1
Applied innodb-4.1-ss22 snapshot.
dict_foreign_error_report(): Always print a newline after invoking
dict_print_info_on_foreign_key_in_create_format() (Bug#16814).
Refuse tables that use reserved column names (Bug#18934).
# 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: aivanov
# Host: mysqld.localdomain
# Root: /home/alexi/innodb/mysql-4.1-work
--- 1.66/innobase/dict/dict0dict.c 2006-01-30 15:17:30 +03:00
+++ 1.67/innobase/dict/dict0dict.c 2006-04-20 23:09:46 +04:00
@@ -1377,6 +1377,38 @@
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 @@
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"
--- 1.15/innobase/dict/dict0mem.c 2004-10-07 21:50:05 +04:00
+++ 1.16/innobase/dict/dict0mem.c 2006-04-20 23:09:46 +04:00
@@ -94,6 +94,21 @@
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. */
--- 1.33/innobase/include/dict0dict.h 2005-12-12 21:06:51 +03:00
+++ 1.34/innobase/include/dict0dict.h 2006-04-20 23:09:46 +04:00
@@ -98,6 +98,15 @@
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. */
--- 1.22/innobase/include/dict0mem.h 2004-10-07 21:50:34 +04:00
+++ 1.23/innobase/include/dict0mem.h 2006-04-20 23:09:46 +04:00
@@ -55,6 +55,13 @@
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. */
--- 1.38/innobase/include/univ.i 2005-02-01 17:27:00 +03:00
+++ 1.39/innobase/include/univ.i 2006-04-20 23:09:46 +04:00
@@ -242,6 +242,9 @@
#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"
--- 1.93/innobase/row/row0mysql.c 2005-12-12 21:06:52 +03:00
+++ 1.94/innobase/row/row0mysql.c 2006-04-20 23:09:46 +04:00
@@ -1474,6 +1474,7 @@
const char* table_name;
ulint table_name_len;
ulint err;
+ ulint i;
ut_ad(trx->mysql_thread_id == os_thread_get_curr_id());
#ifdef UNIV_SYNC_DEBUG
@@ -1508,6 +1509,19 @@
trx_commit_for_mysql(trx);
return(DB_ERROR);
+ }
+
+ /* Check that no reserved column names are used. */
+ for (i = 0; i < dict_table_get_n_user_cols(table); i++) {
+ dict_col_t* col = dict_table_get_nth_col(table, i);
+
+ if (dict_col_name_is_reserved(col->name)) {
+
+ dict_mem_table_free(table);
+ trx_commit_for_mysql(trx);
+
+ return(DB_ERROR);
+ }
}
trx_start_if_not_started(trx);
| Thread |
|---|
| • bk commit into 4.1 tree (aivanov:1.2504) BUG#18934 | Alex Ivanov Notebook | 20 Apr |