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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
4fba6793
Commit
4fba6793
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-5.0
into mysql.com:/home/alexi/innodb/mysql-5.0
parents
806564d7
364621ab
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
113 additions
and
17 deletions
+113
-17
innobase/dict/dict0dict.c
innobase/dict/dict0dict.c
+34
-4
innobase/dict/dict0load.c
innobase/dict/dict0load.c
+11
-6
innobase/dict/dict0mem.c
innobase/dict/dict0mem.c
+18
-0
innobase/ibuf/ibuf0ibuf.c
innobase/ibuf/ibuf0ibuf.c
+3
-3
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/log/log0recv.c
innobase/log/log0recv.c
+3
-3
innobase/row/row0mysql.c
innobase/row/row0mysql.c
+18
-0
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+2
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+5
-1
No files found.
innobase/dict/dict0dict.c
View file @
4fba6793
...
...
@@ -1249,15 +1249,13 @@ dict_table_remove_from_cache(
/* Remove table from LRU list of tables */
UT_LIST_REMOVE
(
table_LRU
,
dict_sys
->
table_LRU
,
table
);
mutex_free
(
&
(
table
->
autoinc_mutex
));
size
=
mem_heap_get_size
(
table
->
heap
);
ut_ad
(
dict_sys
->
size
>=
size
);
dict_sys
->
size
-=
size
;
mem_heap_free
(
table
->
heap
);
dict_mem_table_free
(
table
);
}
/**************************************************************************
...
...
@@ -1378,6 +1376,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. */
...
...
@@ -1551,7 +1581,7 @@ dict_index_remove_from_cache(
dict_sys
->
size
-=
size
;
mem_heap_free
(
index
->
heap
);
dict_mem_index_free
(
index
);
}
/***********************************************************************
...
...
innobase/dict/dict0load.c
View file @
4fba6793
...
...
@@ -767,7 +767,7 @@ dict_load_table(
if
(
!
btr_pcur_is_on_user_rec
(
&
pcur
,
&
mtr
)
||
rec_get_deleted_flag
(
rec
,
sys_tables
->
comp
))
{
/* Not found */
err_exit:
btr_pcur_close
(
&
pcur
);
mtr_commit
(
&
mtr
);
mem_heap_free
(
heap
);
...
...
@@ -779,11 +779,8 @@ dict_load_table(
/* Check if the table name in record is the searched one */
if
(
len
!=
ut_strlen
(
name
)
||
ut_memcmp
(
name
,
field
,
len
)
!=
0
)
{
btr_pcur_close
(
&
pcur
);
mtr_commit
(
&
mtr
);
mem_heap_free
(
heap
);
return
(
NULL
);
goto
err_exit
;
}
ut_a
(
0
==
ut_strcmp
(
"SPACE"
,
...
...
@@ -844,6 +841,14 @@ dict_load_table(
field
=
rec_get_nth_field_old
(
rec
,
5
,
&
len
);
table
->
type
=
mach_read_from_4
(
field
);
if
(
UNIV_UNLIKELY
(
table
->
type
!=
DICT_TABLE_ORDINARY
))
{
ut_print_timestamp
(
stderr
);
fprintf
(
stderr
,
" InnoDB: table %s: unknown table type %lu
\n
"
,
name
,
(
ulong
)
table
->
type
);
goto
err_exit
;
}
if
(
table
->
type
==
DICT_TABLE_CLUSTER_MEMBER
)
{
ut_error
;
#if 0 /* clustered tables have not been implemented yet */
...
...
innobase/dict/dict0mem.c
View file @
4fba6793
...
...
@@ -97,6 +97,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. */
...
...
@@ -290,5 +305,8 @@ dict_mem_index_free(
/*================*/
dict_index_t
*
index
)
/* in: index */
{
ut_ad
(
index
);
ut_ad
(
index
->
magic_n
==
DICT_INDEX_MAGIC_N
);
mem_heap_free
(
index
->
heap
);
}
innobase/ibuf/ibuf0ibuf.c
View file @
4fba6793
...
...
@@ -1160,9 +1160,9 @@ ibuf_dummy_index_free(
dict_index_t
*
index
)
/* in: dummy index */
{
dict_table_t
*
table
=
index
->
table
;
mem_heap_free
(
index
->
heap
);
mutex_free
(
&
(
table
->
autoinc_mutex
)
);
mem_heap_free
(
table
->
heap
);
dict_mem_index_free
(
index
);
dict_mem_table_free
(
table
);
}
/*************************************************************************
...
...
innobase/include/dict0dict.h
View file @
4fba6793
...
...
@@ -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 @
4fba6793
...
...
@@ -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. */
...
...
innobase/include/univ.i
View file @
4fba6793
...
...
@@ -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"
...
...
innobase/log/log0recv.c
View file @
4fba6793
...
...
@@ -890,9 +890,9 @@ recv_parse_or_apply_log_rec_body(
ut_ad
(
!
page
||
ptr
);
if
(
index
)
{
dict_table_t
*
table
=
index
->
table
;
mem_heap_free
(
index
->
heap
);
mutex_free
(
&
(
table
->
autoinc_mutex
)
);
mem_heap_free
(
table
->
heap
);
dict_mem_index_free
(
index
);
dict_mem_table_free
(
table
);
}
return
(
ptr
);
...
...
innobase/row/row0mysql.c
View file @
4fba6793
...
...
@@ -1673,7 +1673,9 @@ row_mysql_recover_tmp_table(
if
(
!
ptr
)
{
/* table name does not begin with "/rsql" */
dict_mem_table_free
(
table
);
trx_commit_for_mysql
(
trx
);
return
(
DB_ERROR
);
}
else
{
...
...
@@ -1785,6 +1787,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
...
...
@@ -1802,6 +1805,7 @@ row_create_table_for_mysql(
"InnoDB: with raw, and innodb_force_... is removed.
\n
"
,
stderr
);
dict_mem_table_free
(
table
);
trx_commit_for_mysql
(
trx
);
return
(
DB_ERROR
);
...
...
@@ -1816,11 +1820,25 @@ row_create_table_for_mysql(
"InnoDB: MySQL system tables must be of the MyISAM type!
\n
"
,
table
->
name
);
dict_mem_table_free
(
table
);
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
);
if
(
row_mysql_is_recovered_tmp_table
(
table
->
name
))
{
...
...
mysql-test/r/innodb.result
View file @
4fba6793
...
...
@@ -3241,6 +3241,8 @@ where t2.a between t1.a - interval 2 day and t1.a + interval 2 day;
a a
2005-10-01 2005-10-01
drop table t1, t2;
CREATE TABLE t1 (DB_ROW_ID int) engine=innodb;
ERROR HY000: Can't create table './test/t1.frm' (errno: -1)
CREATE TABLE t1 (
a BIGINT(20) NOT NULL,
PRIMARY KEY (a)
...
...
mysql-test/t/innodb.test
View file @
4fba6793
...
...
@@ -2133,13 +2133,17 @@ disconnect b;
#
create
table
t1
(
a
date
)
engine
=
innodb
;
create
table
t2
(
a
date
,
key
(
a
))
engine
=
innodb
;
create
table
t2
(
a
date
,
key
(
a
))
engine
=
innodb
;
insert
into
t1
values
(
'2005-10-01'
);
insert
into
t2
values
(
'2005-10-01'
);
select
*
from
t1
,
t2
where
t2
.
a
between
t1
.
a
-
interval
2
day
and
t1
.
a
+
interval
2
day
;
drop
table
t1
,
t2
;
# bug 18934, "InnoDB crashes when table uses column names like DB_ROW_ID"
--
error
1005
CREATE
TABLE
t1
(
DB_ROW_ID
int
)
engine
=
innodb
;
#
# Bug #17152: Wrong result with BINARY comparison on aliased column
#
...
...
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