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
256f697a
Commit
256f697a
authored
Oct 16, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed review comments
parent
db0ee17a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
55 additions
and
38 deletions
+55
-38
sql/ha_partition.cc
sql/ha_partition.cc
+1
-1
sql/ha_partition.h
sql/ha_partition.h
+1
-1
sql/opt_range.cc
sql/opt_range.cc
+16
-13
sql/partition_element.h
sql/partition_element.h
+1
-1
sql/partition_info.cc
sql/partition_info.cc
+4
-4
sql/partition_info.h
sql/partition_info.h
+1
-1
sql/sql_partition.cc
sql/sql_partition.cc
+27
-13
sql/sql_partition.h
sql/sql_partition.h
+4
-4
No files found.
sql/ha_partition.cc
View file @
256f697a
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
/* Copyright 2005-2008 MySQL AB, 2008
-2009
Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
sql/ha_partition.h
View file @
256f697a
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
/* Copyright 2005-2008 MySQL AB, 2008
-2009
Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
sql/opt_range.cc
View file @
256f697a
/* Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
/* Copyright 2000-2008 MySQL AB, 2008
-2009
Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -655,8 +655,10 @@ class RANGE_OPT_PARAM
*/
uint
real_keynr
[
MAX_KEY
];
/* Used to store 'current key tuples', in both range analysis and
* partitioning (list) analysis*/
/*
Used to store 'current key tuples', in both range analysis and
partitioning (list) analysis
*/
uchar
min_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
],
max_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
];
...
...
@@ -3131,7 +3133,7 @@ static
int
find_used_partitions
(
PART_PRUNE_PARAM
*
ppar
,
SEL_ARG
*
key_tree
)
{
int
res
,
left_res
=
0
,
right_res
=
0
;
int
partno
=
(
int
)
key_tree
->
part
;
int
key_tree_part
=
(
int
)
key_tree
->
part
;
bool
set_full_part_if_bad_ret
=
FALSE
;
bool
ignore_part_fields
=
ppar
->
ignore_part_fields
;
bool
did_set_ignore_part_fields
=
FALSE
;
...
...
@@ -3146,8 +3148,8 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
}
/* Push SEL_ARG's to stack to enable looking backwards as well */
ppar
->
cur_part_fields
+=
ppar
->
is_part_keypart
[
partno
];
ppar
->
cur_subpart_fields
+=
ppar
->
is_subpart_keypart
[
partno
];
ppar
->
cur_part_fields
+=
ppar
->
is_part_keypart
[
key_tree_part
];
ppar
->
cur_subpart_fields
+=
ppar
->
is_subpart_keypart
[
key_tree_part
];
*
(
ppar
->
arg_stack_end
++
)
=
key_tree
;
if
(
key_tree
->
type
==
SEL_ARG
::
KEY_RANGE
)
...
...
@@ -3249,6 +3251,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
but this is a harder case we will solve later. For the harder case
this clause then turns into use of all partitions and thus we
simply set res= -1 as if the mapper had returned that.
TODO: What to do here is defined in WL#4065.
*/
if
(
ppar
->
arg_stack
[
0
]
->
part
==
0
)
{
...
...
@@ -3283,7 +3286,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
Save our intent to mark full partition as used if we will not be able
to obtain further limits on subpartitions
*/
if
(
partno
<
ppar
->
last_part_partno
)
if
(
key_tree_part
<
ppar
->
last_part_partno
)
{
/*
We need to ignore the rest of the partitioning fields in all
...
...
@@ -3296,7 +3299,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
goto
process_next_key_part
;
}
if
(
partno
==
ppar
->
last_subpart_partno
&&
if
(
key_tree_part
==
ppar
->
last_subpart_partno
&&
(
NULL
!=
ppar
->
part_info
->
get_subpart_iter_for_interval
))
{
PARTITION_ITERATOR
subpart_iter
;
...
...
@@ -3338,7 +3341,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
if
(
key_tree
->
is_singlepoint
())
{
if
(
partno
==
ppar
->
last_part_partno
&&
if
(
key_tree_part
==
ppar
->
last_part_partno
&&
ppar
->
cur_part_fields
==
ppar
->
part_fields
&&
ppar
->
part_info
->
get_part_iter_for_interval
==
NULL
)
{
...
...
@@ -3369,7 +3372,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
goto
process_next_key_part
;
}
if
(
partno
==
ppar
->
last_subpart_partno
&&
if
(
key_tree_part
==
ppar
->
last_subpart_partno
&&
ppar
->
cur_subpart_fields
==
ppar
->
subpart_fields
)
{
/*
...
...
@@ -3406,7 +3409,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
we're processing subpartititoning's key parts, this means we'll not be
able to infer any suitable condition, so bail out.
*/
if
(
partno
>=
ppar
->
last_part_partno
)
if
(
key_tree_part
>=
ppar
->
last_part_partno
)
{
res
=
-
1
;
goto
pop_and_go_right
;
...
...
@@ -3455,8 +3458,8 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
pop_and_go_right:
/* Pop this key part info off the "stack" */
ppar
->
arg_stack_end
--
;
ppar
->
cur_part_fields
-=
ppar
->
is_part_keypart
[
partno
];
ppar
->
cur_subpart_fields
-=
ppar
->
is_subpart_keypart
[
partno
];
ppar
->
cur_part_fields
-=
ppar
->
is_part_keypart
[
key_tree_part
];
ppar
->
cur_subpart_fields
-=
ppar
->
is_subpart_keypart
[
key_tree_part
];
if
(
res
==
-
1
)
return
-
1
;
...
...
sql/partition_element.h
View file @
256f697a
/* Copyright (C) 2006-200
9 MySQL AB
/* Copyright (C) 2006-200
8 MySQL AB, Sun Microsystems Inc. 2008-2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
sql/partition_info.cc
View file @
256f697a
/* Copyright (C) 2006
MySQL AB
/* Copyright (C) 2006
-2008 MySQL AB, Sun Microsystems Inc. 2008-2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -363,7 +363,7 @@ char* partition_info::has_unique_fields()
for
(
j
=
0
;
j
<
num_fields
;
j
++
)
{
field_name_inner
=
it_inner
++
;
if
(
i
=
=
j
)
if
(
i
>
=
j
)
continue
;
if
(
!
(
my_strcasecmp
(
system_charset_info
,
field_name_outer
,
...
...
@@ -660,7 +660,7 @@ bool partition_info::check_range_constants(THD *thd)
if
(
column_list
)
{
part_column_list_val
*
loc_range_col_array
;
part_column_list_val
*
loc_range_col_array
;
part_column_list_val
*
current_largest_col_val
;
uint
num_column_values
=
part_field_list
.
elements
;
uint
size_entries
=
sizeof
(
part_column_list_val
)
*
num_column_values
;
...
...
@@ -669,7 +669,7 @@ bool partition_info::check_range_constants(THD *thd)
LINT_INIT
(
current_largest_col_val
);
if
(
unlikely
(
range_col_array
==
NULL
))
{
mem_alloc_error
(
num_parts
*
size
of
(
longlong
)
);
mem_alloc_error
(
num_parts
*
size
_entries
);
goto
end
;
}
loc_range_col_array
=
range_col_array
;
...
...
sql/partition_info.h
View file @
256f697a
/* Copyright 2006-2008 MySQL AB, 2008 Sun Microsystems, Inc.
/* Copyright 2006-2008 MySQL AB, 2008
-2009
Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
sql/sql_partition.cc
View file @
256f697a
/* Copyright 2005-2008 MySQL AB, 2008 Sun Microsystems, Inc.
/* Copyright 2005-2008 MySQL AB, 2008
-2009
Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -1406,8 +1406,8 @@ static void set_up_partition_func_pointers(partition_info *part_info)
DBUG_ASSERT
(
part_info
->
get_part_partition_id
);
if
(
!
part_info
->
column_list
)
{
part_info
->
get_part_partition_id
=
part_info
->
get_part_partition_id
_charset
;
part_info
->
get_part_partition_id
_charset
=
part_info
->
get_part_partition_id
;
part_info
->
get_part_partition_id
=
get_part_id_charset_func_part
;
}
}
...
...
@@ -2673,7 +2673,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
part_info A reference to the partition_info struct where all the
desired information is given
out:part_id The partition id is returned through this pointer
out:
func_value
Value of partition function (longlong)
out:
func_value
Value of partition function (longlong)
RETURN VALUE
part_id Partition id of partition that would contain
...
...
@@ -2731,7 +2731,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
get_partition_id_range_col
get_partition_id_hash_nosub
get_partition_id_key_nosub
get_partition_id_linhash_nosub
get_partition_id_lin
ear_
hash_nosub
get_partition_id_linear_key_nosub
*/
...
...
@@ -2923,12 +2923,12 @@ uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info,
}
else
{
DBUG_RETURN
(
list_index
+
test
(
left_endpoint
^
include_endpoint
));
DBUG_RETURN
(
list_index
+
test
(
!
tailf
));
}
}
while
(
max_list_index
>=
min_list_index
);
notfound:
if
(
cmp
>
0
)
list_index
++
;
notfound:
DBUG_RETURN
(
list_index
);
}
...
...
@@ -3027,7 +3027,6 @@ int get_partition_id_range_col(partition_info *part_info,
DBUG_PRINT
(
"exit"
,(
"partition: %d"
,
*
part_id
));
DBUG_RETURN
(
0
);
return
0
;
}
...
...
@@ -6746,13 +6745,28 @@ static void set_up_range_analysis_info(partition_info *part_info)
}
/* TODO Commenting those functions */
/*
This function takes a memory of packed fields in opt-range format
and stores it in record format. To avoid having to worry about how
the length of fields are calculated in opt-range format we send
an array of lengths used for each field in store_length_array.
SYNOPSIS
store_tuple_to_record()
pfield Field array
store_length_array Array of field lengths
value Memory where fields are stored
value_end End of memory
RETURN VALUE
nparts Number of fields assigned
*/
uint32
store_tuple_to_record
(
Field
**
pfield
,
uint32
*
store_length_array
,
uchar
*
value
,
uchar
*
value_end
)
{
/
/ see store_key_image_to_rec
/
* This function is inspired by store_key_image_rec. */
uint32
nparts
=
0
;
uchar
*
loc_value
;
while
(
value
<
value_end
)
...
...
@@ -6779,12 +6793,12 @@ uint32 store_tuple_to_record(Field **pfield,
/*
RANGE(columns) partitioning: compare value bound and probe tuple.
The value bound always is a full tuple (but may include
MIN_VALUE and
MAX_VALUE special values
).
The value bound always is a full tuple (but may include
the MAX_VALUE
special value
).
The probe tuple may be a prefix of partitioning tuple. The tail_is_min
parameter specifies whether the suffix components should be assumed to
hold M
IN_VALUE or M
AX_VALUE
hold MAX_VALUE
*/
static
int
cmp_rec_and_tuple
(
part_column_list_val
*
val
,
uint32
nvals_in_rec
)
...
...
sql/sql_partition.h
View file @
256f697a
/* Copyright (C) 2006
MySQL AB
/* Copyright (C) 2006
-2008 MySQL AB, Sun Microsystems Inc. 2008-2009
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
...
...
@@ -175,12 +175,12 @@ typedef struct st_partition_iter
part_info Partitioning info
is_subpart
store_length_array Length of fields packed in opt_range_key format
min_val Left edge, field value in opt_range_key format
.
max_val Right edge, field value in opt_range_key format
.
min_val Left edge, field value in opt_range_key format
max_val Right edge, field value in opt_range_key format
min_len Length of minimum value
max_len Length of maximum value
flags Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE,
NO_MAX_RANGE
.
NO_MAX_RANGE
part_iter Iterator structure to be initialized
DESCRIPTION
...
...
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