Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
50e8e58c
Commit
50e8e58c
authored
Apr 23, 2006
by
aivanov@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/alexi/innodb/mysql-4.1
parents
510ab813
b7583537
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
82 additions
and
1 deletion
+82
-1
innobase/dict/dict0dict.c
innobase/dict/dict0dict.c
+34
-1
innobase/dict/dict0mem.c
innobase/dict/dict0mem.c
+15
-0
innobase/include/dict0dict.h
innobase/include/dict0dict.h
+9
-0
innobase/include/dict0mem.h
innobase/include/dict0mem.h
+7
-0
innobase/include/univ.i
innobase/include/univ.i
+3
-0
innobase/row/row0mysql.c
innobase/row/row0mysql.c
+14
-0
No files found.
innobase/dict/dict0dict.c
View file @
50e8e58c
...
...
@@ -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
(
"
\n
The 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
(
"
\n
See http://dev.mysql.com/doc/mysql/en/InnoDB_foreign_key_constraints.html
\n
"
...
...
innobase/dict/dict0mem.c
View file @
50e8e58c
...
...
@@ -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. */
...
...
innobase/include/dict0dict.h
View file @
50e8e58c
...
...
@@ -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. */
...
...
innobase/include/dict0mem.h
View file @
50e8e58c
...
...
@@ -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. */
...
...
innobase/include/univ.i
View file @
50e8e58c
...
...
@@ -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"
...
...
innobase/row/row0mysql.c
View file @
50e8e58c
...
...
@@ -1474,6 +1474,7 @@ row_create_table_for_mysql(
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
...
...
@@ -1510,6 +1511,19 @@ row_create_table_for_mysql(
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
);
if
(
row_mysql_is_recovered_tmp_table
(
table
->
name
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment