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
7bb535bb
Commit
7bb535bb
authored
Sep 15, 2006
by
osku
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make dict_index_find_cols() always succeed.
parent
16951e43
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
54 deletions
+38
-54
dict/dict0boot.c
dict/dict0boot.c
+19
-22
dict/dict0crea.c
dict/dict0crea.c
+2
-5
dict/dict0dict.c
dict/dict0dict.c
+15
-24
include/dict0dict.h
include/dict0dict.h
+2
-3
No files found.
dict/dict0boot.c
View file @
7bb535bb
...
...
@@ -214,7 +214,6 @@ dict_boot(void)
dict_index_t
*
index
;
dict_hdr_t
*
dict_hdr
;
mtr_t
mtr
;
ibool
success
;
mtr_start
(
&
mtr
);
...
...
@@ -269,21 +268,20 @@ dict_boot(void)
index
->
id
=
DICT_TABLES_ID
;
success
=
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_TABLES
,
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_TABLES
,
MLOG_4BYTES
,
&
mtr
));
ut_a
(
success
);
/*-------------------------*/
index
=
dict_mem_index_create
(
"SYS_TABLES"
,
"ID_IND"
,
DICT_HDR_SPACE
,
DICT_UNIQUE
,
1
);
dict_mem_index_add_field
(
index
,
"ID"
,
0
);
index
->
id
=
DICT_TABLE_IDS_ID
;
success
=
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_TABLE_IDS
,
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_TABLE_IDS
,
MLOG_4BYTES
,
&
mtr
));
ut_a
(
success
);
/*-------------------------*/
table
=
dict_mem_table_create
(
"SYS_COLUMNS"
,
DICT_HDR_SPACE
,
7
,
0
);
...
...
@@ -308,10 +306,10 @@ dict_boot(void)
dict_mem_index_add_field
(
index
,
"POS"
,
0
);
index
->
id
=
DICT_COLUMNS_ID
;
success
=
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_COLUMNS
,
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_COLUMNS
,
MLOG_4BYTES
,
&
mtr
));
ut_a
(
success
);
/*-------------------------*/
table
=
dict_mem_table_create
(
"SYS_INDEXES"
,
DICT_HDR_SPACE
,
7
,
0
);
...
...
@@ -346,10 +344,10 @@ dict_boot(void)
dict_mem_index_add_field
(
index
,
"ID"
,
0
);
index
->
id
=
DICT_INDEXES_ID
;
success
=
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_INDEXES
,
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_INDEXES
,
MLOG_4BYTES
,
&
mtr
));
ut_a
(
success
);
/*-------------------------*/
table
=
dict_mem_table_create
(
"SYS_FIELDS"
,
DICT_HDR_SPACE
,
3
,
0
);
...
...
@@ -369,10 +367,9 @@ dict_boot(void)
dict_mem_index_add_field
(
index
,
"POS"
,
0
);
index
->
id
=
DICT_FIELDS_ID
;
success
=
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_FIELDS
,
dict_index_add_to_cache
(
table
,
index
,
mtr_read_ulint
(
dict_hdr
+
DICT_HDR_FIELDS
,
MLOG_4BYTES
,
&
mtr
));
ut_a
(
success
);
mtr_commit
(
&
mtr
);
/*-------------------------*/
...
...
dict/dict0crea.c
View file @
7bb535bb
...
...
@@ -1004,7 +1004,6 @@ dict_create_index_step(
que_thr_t
*
thr
)
/* in: query thread */
{
ind_node_t
*
node
;
ibool
success
;
ulint
err
=
DB_ERROR
;
trx_t
*
trx
;
...
...
@@ -1088,11 +1087,9 @@ dict_create_index_step(
if
(
node
->
state
==
INDEX_ADD_TO_CACHE
)
{
success
=
dict_index_add_to_cache
(
node
->
table
,
node
->
index
,
dict_index_add_to_cache
(
node
->
table
,
node
->
index
,
node
->
page_no
);
ut_a
(
success
);
err
=
DB_SUCCESS
;
}
...
...
dict/dict0dict.c
View file @
7bb535bb
...
...
@@ -146,13 +146,12 @@ dict_index_copy(
ulint
start
,
/* in: first position to copy */
ulint
end
);
/* in: last position to copy */
/***********************************************************************
Tries to find column names for the index and
sets the col field of the
index. */
Tries to find column names for the index and
sets the col field of the
index. */
static
ibool
void
dict_index_find_cols
(
/*=================*/
/* out: TRUE if success */
dict_table_t
*
table
,
/* in: table */
dict_index_t
*
index
);
/* in: index */
/***********************************************************************
...
...
@@ -1308,10 +1307,9 @@ dict_col_name_is_reserved(
/**************************************************************************
Adds an index to the dictionary cache. */
ibool
void
dict_index_add_to_cache
(
/*====================*/
/* out: TRUE if success */
dict_table_t
*
table
,
/* in: table on which the index is */
dict_index_t
*
index
,
/* in, own: index; NOTE! The index memory
object is freed in this function! */
...
...
@@ -1321,7 +1319,6 @@ dict_index_add_to_cache(
dict_tree_t
*
tree
;
dict_field_t
*
field
;
ulint
n_ord
;
ibool
success
;
ulint
i
;
ut_ad
(
index
);
...
...
@@ -1349,13 +1346,7 @@ dict_index_add_to_cache(
ut_a
(
!
(
index
->
type
&
DICT_CLUSTERED
)
||
UT_LIST_GET_LEN
(
table
->
indexes
)
==
0
);
success
=
dict_index_find_cols
(
table
,
index
);
if
(
!
success
)
{
dict_mem_index_free
(
index
);
return
(
FALSE
);
}
dict_index_find_cols
(
table
,
index
);
/* Build the cache internal representation of the index,
containing also the added system fields */
...
...
@@ -1421,8 +1412,6 @@ dict_index_add_to_cache(
dict_sys
->
size
+=
mem_heap_get_size
(
new_index
->
heap
);
dict_mem_index_free
(
index
);
return
(
TRUE
);
}
/**************************************************************************
...
...
@@ -1459,13 +1448,12 @@ dict_index_remove_from_cache(
}
/***********************************************************************
Tries to find column names for the index and
sets the col field of the
index. */
Tries to find column names for the index and
sets the col field of the
index. */
static
ibool
void
dict_index_find_cols
(
/*=================*/
/* out: TRUE if success */
dict_table_t
*
table
,
/* in: table */
dict_index_t
*
index
)
/* in: index */
{
...
...
@@ -1483,17 +1471,20 @@ dict_index_find_cols(
for
(
j
=
0
;
j
<
table
->
n_cols
;
j
++
)
{
dict_col_t
*
col
=
dict_table_get_nth_col
(
table
,
j
);
if
(
!
strcmp
(
col
->
name
,
field
->
name
))
{
field
->
col
=
col
;
goto
found
;
}
}
return
(
FALSE
);
found:
;
}
/* It is an error not to find a matching column. */
ut_error
;
return
(
TRUE
);
found:
;
}
}
/***********************************************************************
...
...
include/dict0dict.h
View file @
7bb535bb
...
...
@@ -550,12 +550,11 @@ dict_index_find_on_id_low(
/* out: index or NULL if not found from cache */
dulint
id
);
/* in: index id */
/**************************************************************************
Adds an index to dictionary cache. */
Adds an index to
the
dictionary cache. */
ibool
void
dict_index_add_to_cache
(
/*====================*/
/* out: TRUE if success */
dict_table_t
*
table
,
/* in: table on which the index is */
dict_index_t
*
index
,
/* in, own: index; NOTE! The index memory
object is freed in this function! */
...
...
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