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
68929e8e
Commit
68929e8e
authored
Jun 25, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some corrections of the merge for the partition code.
parent
4aa9b285
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
sql/ha_partition.cc
sql/ha_partition.cc
+16
-12
sql/table.cc
sql/table.cc
+6
-0
No files found.
sql/ha_partition.cc
View file @
68929e8e
...
@@ -3674,27 +3674,31 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
...
@@ -3674,27 +3674,31 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type)
}
}
/*
/*
*
Get number of lock objects returned in store_lock
Get number of lock objects returned in store_lock
SYNOPSIS
@returns Number of locks returned in call to store_lock
lock_count()
RETURN VALUE
Number of locks returned in call to store_lock
DESCRIPTION
@desc
Returns the number of store locks needed in call to store lock.
Returns the number of store locks needed in call to store lock.
We return number of partitions
since we call store_lock on each
We return number of partitions
we will lock multiplied with number of
underlying handler
. Assists the above functions in allocating
locks needed by each partition
. Assists the above functions in allocating
sufficient space for lock structures.
sufficient space for lock structures.
*/
*/
uint
ha_partition
::
lock_count
()
const
uint
ha_partition
::
lock_count
()
const
{
{
DBUG_ENTER
(
"ha_partition::lock_count"
);
DBUG_ENTER
(
"ha_partition::lock_count"
);
DBUG_PRINT
(
"info"
,
(
"m_num_locks %d"
,
m_num_locks
));
/*
DBUG_RETURN
(
m_num_locks
);
The caller want to know the upper bound, to allocate enough memory.
There is no performance lost if we simply return maximum number locks
needed, only some minor over allocation of memory in get_lock_data().
Also notice that this may be called for another thread != table->in_use,
when mysql_lock_abort_for_thread() is called. So this is more safe, then
using number of partitions after pruning.
*/
DBUG_RETURN
(
m_tot_parts
*
m_num_locks
);
}
}
...
@@ -5785,7 +5789,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
...
@@ -5785,7 +5789,7 @@ int ha_partition::handle_ordered_index_scan(uchar *buf, bool reverse_order)
*/
*/
queue_set_max_at_top
(
&
m_queue
,
reverse_order
);
queue_set_max_at_top
(
&
m_queue
,
reverse_order
);
queue_set_cmp_arg
(
&
m_queue
,
(
void
*
)
m_curr_key_info
);
queue_set_cmp_arg
(
&
m_queue
,
(
void
*
)
m_curr_key_info
);
m_queue
.
elements
=
j
;
m_queue
.
elements
=
j
-
queue_first_element
(
&
m_queue
)
;
queue_fix
(
&
m_queue
);
queue_fix
(
&
m_queue
);
return_top_record
(
buf
);
return_top_record
(
buf
);
table
->
status
=
0
;
table
->
status
=
0
;
...
...
sql/table.cc
View file @
68929e8e
...
@@ -1359,6 +1359,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
...
@@ -1359,6 +1359,9 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
share
->
db_type
())))
share
->
db_type
())))
goto
err
;
goto
err
;
if
(
handler_file
->
set_ha_share_ref
(
&
share
->
ha_share
))
goto
err
;
record
=
share
->
default_values
-
1
;
/* Fieldstart = 1 */
record
=
share
->
default_values
-
1
;
/* Fieldstart = 1 */
null_bits_are_used
=
share
->
null_fields
!=
0
;
null_bits_are_used
=
share
->
null_fields
!=
0
;
if
(
share
->
null_field_first
)
if
(
share
->
null_field_first
)
...
@@ -2362,6 +2365,9 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
...
@@ -2362,6 +2365,9 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
if
(
!
(
outparam
->
file
=
get_new_handler
(
share
,
&
outparam
->
mem_root
,
if
(
!
(
outparam
->
file
=
get_new_handler
(
share
,
&
outparam
->
mem_root
,
share
->
db_type
())))
share
->
db_type
())))
goto
err
;
goto
err
;
if
(
outparam
->
file
->
set_ha_share_ref
(
&
share
->
ha_share
))
goto
err
;
}
}
else
else
{
{
...
...
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