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
7fc2434c
Commit
7fc2434c
authored
Dec 12, 2006
by
osku
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify dict_table_get_and_increment_handle_count() with dict_table_get() by
adding a second parameter, adjust callers.
parent
ccd40036
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
53 deletions
+28
-53
dict/dict0dict.c
dict/dict0dict.c
+13
-34
handler/ha_innodb.cc
handler/ha_innodb.cc
+2
-2
include/dict0dict.h
include/dict0dict.h
+8
-14
row/row0ins.c
row/row0ins.c
+2
-1
row/row0sel.c
row/row0sel.c
+1
-1
row/row0upd.c
row/row0upd.c
+2
-1
No files found.
dict/dict0dict.c
View file @
7fc2434c
...
@@ -801,43 +801,20 @@ dict_init(void)
...
@@ -801,43 +801,20 @@ dict_init(void)
}
}
/**************************************************************************
/**************************************************************************
Returns a table object. NOTE! This is a high-level function to be used
Returns a table object and optionally increment its MySQL open handle count.
mainly from outside the 'dict' directory. Inside this directory
NOTE! This is a high-level function to be used mainly from outside the
dict_table_get_low is usually the appropriate function. */
'dict' directory. Inside this directory dict_table_get_low is usually the
appropriate function. */
dict_table_t
*
dict_table_t
*
dict_table_get
(
dict_table_get
(
/*===========*/
/*===========*/
/* out: table, NULL if
/* out: table, NULL if
does not exist */
does not exist */
const
char
*
table_name
)
/* in: table name */
const
char
*
table_name
,
/* in: table name */
{
ibool
inc_mysql_count
)
dict_table_t
*
table
;
/* in: whether to increment the open
handle count on the table */
mutex_enter
(
&
(
dict_sys
->
mutex
));
table
=
dict_table_get_low
(
table_name
);
mutex_exit
(
&
(
dict_sys
->
mutex
));
if
(
table
!=
NULL
)
{
if
(
!
table
->
stat_initialized
)
{
dict_update_statistics
(
table
);
}
}
return
(
table
);
}
/**************************************************************************
Returns a table object and increments MySQL open handle count on the table. */
dict_table_t
*
dict_table_get_and_increment_handle_count
(
/*======================================*/
/* out: table, NULL if
does not exist */
const
char
*
table_name
)
/* in: table name */
{
{
dict_table_t
*
table
;
dict_table_t
*
table
;
...
@@ -845,15 +822,17 @@ dict_table_get_and_increment_handle_count(
...
@@ -845,15 +822,17 @@ dict_table_get_and_increment_handle_count(
table
=
dict_table_get_low
(
table_name
);
table
=
dict_table_get_low
(
table_name
);
if
(
table
!=
NULL
)
{
if
(
inc_mysql_count
&&
table
)
{
table
->
n_mysql_handles_opened
++
;
table
->
n_mysql_handles_opened
++
;
}
}
mutex_exit
(
&
(
dict_sys
->
mutex
));
mutex_exit
(
&
(
dict_sys
->
mutex
));
if
(
table
!=
NULL
)
{
if
(
table
!=
NULL
)
{
if
(
!
table
->
stat_initialized
&&
!
table
->
ibd_file_missing
)
{
if
(
!
table
->
stat_initialized
)
{
/* If table->ibd_file_missing == TRUE, this will
print an error message and return without doing
anything. */
dict_update_statistics
(
table
);
dict_update_statistics
(
table
);
}
}
}
}
...
...
handler/ha_innodb.cc
View file @
7fc2434c
...
@@ -2345,7 +2345,7 @@ ha_innobase::open(
...
@@ -2345,7 +2345,7 @@ ha_innobase::open(
/* Get pointer to a table object in InnoDB dictionary cache */
/* Get pointer to a table object in InnoDB dictionary cache */
ib_table
=
dict_table_get
_and_increment_handle_count
(
norm_name
);
ib_table
=
dict_table_get
(
norm_name
,
TRUE
);
if
(
NULL
==
ib_table
)
{
if
(
NULL
==
ib_table
)
{
ut_print_timestamp
(
stderr
);
ut_print_timestamp
(
stderr
);
...
@@ -4923,7 +4923,7 @@ ha_innobase::create(
...
@@ -4923,7 +4923,7 @@ ha_innobase::create(
log_buffer_flush_to_disk
();
log_buffer_flush_to_disk
();
innobase_table
=
dict_table_get
(
norm_name
);
innobase_table
=
dict_table_get
(
norm_name
,
FALSE
);
DBUG_ASSERT
(
innobase_table
!=
0
);
DBUG_ASSERT
(
innobase_table
!=
0
);
...
...
include/dict0dict.h
View file @
7fc2434c
...
@@ -326,26 +326,20 @@ dict_foreign_parse_drop_constraints(
...
@@ -326,26 +326,20 @@ dict_foreign_parse_drop_constraints(
const
char
***
constraints_to_drop
);
/* out: id's of the
const
char
***
constraints_to_drop
);
/* out: id's of the
constraints to drop */
constraints to drop */
/**************************************************************************
/**************************************************************************
Returns a table object. NOTE! This is a high-level function to be used
Returns a table object and optionally increment its MySQL open handle count.
mainly from outside the 'dict' directory. Inside this directory
NOTE! This is a high-level function to be used mainly from outside the
dict_table_get_low is usually the appropriate function. */
'dict' directory. Inside this directory dict_table_get_low is usually the
appropriate function. */
dict_table_t
*
dict_table_t
*
dict_table_get
(
dict_table_get
(
/*===========*/
/*===========*/
/* out: table, NULL if
/* out: table, NULL if
does not exist */
does not exist */
const
char
*
table_name
);
/* in: table name */
const
char
*
table_name
,
/* in: table name */
/**************************************************************************
ibool
inc_mysql_count
);
Returns a table object and increments MySQL open handle count on the table.
/* in: whether to increment the open
*/
handle count on the table */
dict_table_t
*
dict_table_get_and_increment_handle_count
(
/*======================================*/
/* out: table, NULL if
does not exist */
const
char
*
table_name
);
/* in: table name */
/**************************************************************************
/**************************************************************************
Returns a table object based on table id. */
Returns a table object based on table id. */
...
...
row/row0ins.c
View file @
7fc2434c
...
@@ -1524,7 +1524,8 @@ row_ins_check_foreign_constraints(
...
@@ -1524,7 +1524,8 @@ row_ins_check_foreign_constraints(
if
(
foreign
->
foreign_index
==
index
)
{
if
(
foreign
->
foreign_index
==
index
)
{
if
(
foreign
->
referenced_table
==
NULL
)
{
if
(
foreign
->
referenced_table
==
NULL
)
{
dict_table_get
(
foreign
->
referenced_table_name
);
dict_table_get
(
foreign
->
referenced_table_name
,
FALSE
);
}
}
if
(
0
==
trx
->
dict_operation_lock_mode
)
{
if
(
0
==
trx
->
dict_operation_lock_mode
)
{
...
...
row/row0sel.c
View file @
7fc2434c
...
@@ -4453,7 +4453,7 @@ row_search_check_if_query_cache_permitted(
...
@@ -4453,7 +4453,7 @@ row_search_check_if_query_cache_permitted(
dict_table_t
*
table
;
dict_table_t
*
table
;
ibool
ret
=
FALSE
;
ibool
ret
=
FALSE
;
table
=
dict_table_get
(
norm_name
);
table
=
dict_table_get
(
norm_name
,
FALSE
);
if
(
table
==
NULL
)
{
if
(
table
==
NULL
)
{
...
...
row/row0upd.c
View file @
7fc2434c
...
@@ -202,7 +202,8 @@ row_upd_check_references_constraints(
...
@@ -202,7 +202,8 @@ row_upd_check_references_constraints(
foreign
->
n_fields
)))
{
foreign
->
n_fields
)))
{
if
(
foreign
->
foreign_table
==
NULL
)
{
if
(
foreign
->
foreign_table
==
NULL
)
{
dict_table_get
(
foreign
->
foreign_table_name
);
dict_table_get
(
foreign
->
foreign_table_name
,
FALSE
);
}
}
if
(
foreign
->
foreign_table
)
{
if
(
foreign
->
foreign_table
)
{
...
...
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