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
1f38322d
Commit
1f38322d
authored
Oct 16, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Plain Diff
Merged in latest changes
parents
1ef62bf6
d5230553
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
62 additions
and
78 deletions
+62
-78
mysql-test/r/partition_not_windows.result
mysql-test/r/partition_not_windows.result
+2
-2
mysql-test/r/partition_range.result
mysql-test/r/partition_range.result
+0
-5
mysql-test/r/partition_symlink.result
mysql-test/r/partition_symlink.result
+2
-2
mysql-test/t/partition_range.test
mysql-test/t/partition_range.test
+0
-6
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/share/errmsg.txt
sql/share/errmsg.txt
+0
-2
sql/sql_lex.cc
sql/sql_lex.cc
+0
-1
sql/sql_lex.h
sql/sql_lex.h
+0
-3
sql/sql_partition.cc
sql/sql_partition.cc
+27
-13
sql/sql_partition.h
sql/sql_partition.h
+4
-4
sql/sql_yacc.yy
sql/sql_yacc.yy
+3
-19
No files found.
mysql-test/r/partition_not_windows.result
View file @
1f38322d
...
@@ -24,8 +24,8 @@ data directory='/not/existing'
...
@@ -24,8 +24,8 @@ data directory='/not/existing'
index directory='/not/existing'
index directory='/not/existing'
);
);
Warnings:
Warnings:
Warning 161
8
<DATA DIRECTORY> option ignored
Warning 161
9
<DATA DIRECTORY> option ignored
Warning 161
8
<INDEX DIRECTORY> option ignored
Warning 161
9
<INDEX DIRECTORY> option ignored
show create table t2;
show create table t2;
Table Create Table
Table Create Table
t2 CREATE TABLE `t2` (
t2 CREATE TABLE `t2` (
...
...
mysql-test/r/partition_range.result
View file @
1f38322d
...
@@ -84,11 +84,6 @@ create table t1 (a int, b char(20))
...
@@ -84,11 +84,6 @@ create table t1 (a int, b char(20))
partition by range(a)
partition by range(a)
(partition p0 values less than (1,"b"));
(partition p0 values less than (1,"b"));
ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
ERROR HY000: Cannot have more than one value for this type of RANGE partitioning
create table t1 (a int, b char(20));
create global index inx on t1 (a,b)
partition by range (a)
(partition p0 values less than (1));
drop table t1;
create table t1 (a int, b char(20))
create table t1 (a int, b char(20))
partition by range column_list(b)
partition by range column_list(b)
(partition p0 values less than ("b"));
(partition p0 values less than ("b"));
...
...
mysql-test/r/partition_symlink.result
View file @
1f38322d
...
@@ -101,8 +101,8 @@ data directory='/not/existing'
...
@@ -101,8 +101,8 @@ data directory='/not/existing'
index directory='/not/existing'
index directory='/not/existing'
);
);
Warnings:
Warnings:
Warning 161
8
<DATA DIRECTORY> option ignored
Warning 161
9
<DATA DIRECTORY> option ignored
Warning 161
8
<INDEX DIRECTORY> option ignored
Warning 161
9
<INDEX DIRECTORY> option ignored
show create table t2;
show create table t2;
Table Create Table
Table Create Table
t2 CREATE TABLE `t2` (
t2 CREATE TABLE `t2` (
...
...
mysql-test/t/partition_range.test
View file @
1f38322d
...
@@ -74,12 +74,6 @@ create table t1 (a int, b char(20))
...
@@ -74,12 +74,6 @@ create table t1 (a int, b char(20))
partition
by
range
(
a
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
1
,
"b"
));
(
partition
p0
values
less
than
(
1
,
"b"
));
create
table
t1
(
a
int
,
b
char
(
20
));
create
global
index
inx
on
t1
(
a
,
b
)
partition
by
range
(
a
)
(
partition
p0
values
less
than
(
1
));
drop
table
t1
;
create
table
t1
(
a
int
,
b
char
(
20
))
create
table
t1
(
a
int
,
b
char
(
20
))
partition
by
range
column_list
(
b
)
partition
by
range
column_list
(
b
)
(
partition
p0
values
less
than
(
"b"
));
(
partition
p0
values
less
than
(
"b"
));
...
...
sql/ha_partition.cc
View file @
1f38322d
/* 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
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
it under the terms of the GNU General Public License as published by
...
...
sql/ha_partition.h
View file @
1f38322d
/* 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
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
it under the terms of the GNU General Public License as published by
...
...
sql/opt_range.cc
View file @
1f38322d
/* 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
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
it under the terms of the GNU General Public License as published by
...
@@ -655,8 +655,10 @@ class RANGE_OPT_PARAM
...
@@ -655,8 +655,10 @@ class RANGE_OPT_PARAM
*/
*/
uint
real_keynr
[
MAX_KEY
];
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
],
uchar
min_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
],
max_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
];
max_key
[
MAX_KEY_LENGTH
+
MAX_FIELD_WIDTH
];
...
@@ -3131,7 +3133,7 @@ static
...
@@ -3131,7 +3133,7 @@ static
int
find_used_partitions
(
PART_PRUNE_PARAM
*
ppar
,
SEL_ARG
*
key_tree
)
int
find_used_partitions
(
PART_PRUNE_PARAM
*
ppar
,
SEL_ARG
*
key_tree
)
{
{
int
res
,
left_res
=
0
,
right_res
=
0
;
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
set_full_part_if_bad_ret
=
FALSE
;
bool
ignore_part_fields
=
ppar
->
ignore_part_fields
;
bool
ignore_part_fields
=
ppar
->
ignore_part_fields
;
bool
did_set_ignore_part_fields
=
FALSE
;
bool
did_set_ignore_part_fields
=
FALSE
;
...
@@ -3146,8 +3148,8 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
...
@@ -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 */
/* Push SEL_ARG's to stack to enable looking backwards as well */
ppar
->
cur_part_fields
+=
ppar
->
is_part_keypart
[
partno
];
ppar
->
cur_part_fields
+=
ppar
->
is_part_keypart
[
key_tree_part
];
ppar
->
cur_subpart_fields
+=
ppar
->
is_subpart_keypart
[
partno
];
ppar
->
cur_subpart_fields
+=
ppar
->
is_subpart_keypart
[
key_tree_part
];
*
(
ppar
->
arg_stack_end
++
)
=
key_tree
;
*
(
ppar
->
arg_stack_end
++
)
=
key_tree
;
if
(
key_tree
->
type
==
SEL_ARG
::
KEY_RANGE
)
if
(
key_tree
->
type
==
SEL_ARG
::
KEY_RANGE
)
...
@@ -3249,6 +3251,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
...
@@ -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
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
this clause then turns into use of all partitions and thus we
simply set res= -1 as if the mapper had returned that.
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
)
if
(
ppar
->
arg_stack
[
0
]
->
part
==
0
)
{
{
...
@@ -3283,7 +3286,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
...
@@ -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
Save our intent to mark full partition as used if we will not be able
to obtain further limits on subpartitions
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
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)
...
@@ -3296,7 +3299,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
goto
process_next_key_part
;
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
))
(
NULL
!=
ppar
->
part_info
->
get_subpart_iter_for_interval
))
{
{
PARTITION_ITERATOR
subpart_iter
;
PARTITION_ITERATOR
subpart_iter
;
...
@@ -3338,7 +3341,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
...
@@ -3338,7 +3341,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
if
(
key_tree
->
is_singlepoint
())
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
->
cur_part_fields
==
ppar
->
part_fields
&&
ppar
->
part_info
->
get_part_iter_for_interval
==
NULL
)
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)
...
@@ -3369,7 +3372,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
goto
process_next_key_part
;
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
)
ppar
->
cur_subpart_fields
==
ppar
->
subpart_fields
)
{
{
/*
/*
...
@@ -3406,7 +3409,7 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
...
@@ -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
we're processing subpartititoning's key parts, this means we'll not be
able to infer any suitable condition, so bail out.
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
;
res
=
-
1
;
goto
pop_and_go_right
;
goto
pop_and_go_right
;
...
@@ -3455,8 +3458,8 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
...
@@ -3455,8 +3458,8 @@ int find_used_partitions(PART_PRUNE_PARAM *ppar, SEL_ARG *key_tree)
pop_and_go_right:
pop_and_go_right:
/* Pop this key part info off the "stack" */
/* Pop this key part info off the "stack" */
ppar
->
arg_stack_end
--
;
ppar
->
arg_stack_end
--
;
ppar
->
cur_part_fields
-=
ppar
->
is_part_keypart
[
partno
];
ppar
->
cur_part_fields
-=
ppar
->
is_part_keypart
[
key_tree_part
];
ppar
->
cur_subpart_fields
-=
ppar
->
is_subpart_keypart
[
partno
];
ppar
->
cur_subpart_fields
-=
ppar
->
is_subpart_keypart
[
key_tree_part
];
if
(
res
==
-
1
)
if
(
res
==
-
1
)
return
-
1
;
return
-
1
;
...
...
sql/partition_element.h
View file @
1f38322d
/* 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
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
it under the terms of the GNU General Public License as published by
...
...
sql/partition_info.cc
View file @
1f38322d
/* Copyr
ght (C) 2006 MySQL AB
/* Copyr
ight (C) 2006-2008 MySQL AB, Sun Microsystems Inc. 2008-2009
This program is free software; you can redistribute it and/or modify
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
it under the terms of the GNU General Public License as published by
...
@@ -363,7 +363,7 @@ char* partition_info::has_unique_fields()
...
@@ -363,7 +363,7 @@ char* partition_info::has_unique_fields()
for
(
j
=
0
;
j
<
num_fields
;
j
++
)
for
(
j
=
0
;
j
<
num_fields
;
j
++
)
{
{
field_name_inner
=
it_inner
++
;
field_name_inner
=
it_inner
++
;
if
(
i
=
=
j
)
if
(
i
>
=
j
)
continue
;
continue
;
if
(
!
(
my_strcasecmp
(
system_charset_info
,
if
(
!
(
my_strcasecmp
(
system_charset_info
,
field_name_outer
,
field_name_outer
,
...
@@ -660,7 +660,7 @@ bool partition_info::check_range_constants(THD *thd)
...
@@ -660,7 +660,7 @@ bool partition_info::check_range_constants(THD *thd)
if
(
column_list
)
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
;
part_column_list_val
*
current_largest_col_val
;
uint
num_column_values
=
part_field_list
.
elements
;
uint
num_column_values
=
part_field_list
.
elements
;
uint
size_entries
=
sizeof
(
part_column_list_val
)
*
num_column_values
;
uint
size_entries
=
sizeof
(
part_column_list_val
)
*
num_column_values
;
...
@@ -669,7 +669,7 @@ bool partition_info::check_range_constants(THD *thd)
...
@@ -669,7 +669,7 @@ bool partition_info::check_range_constants(THD *thd)
LINT_INIT
(
current_largest_col_val
);
LINT_INIT
(
current_largest_col_val
);
if
(
unlikely
(
range_col_array
==
NULL
))
if
(
unlikely
(
range_col_array
==
NULL
))
{
{
mem_alloc_error
(
num_parts
*
size
of
(
longlong
)
);
mem_alloc_error
(
num_parts
*
size
_entries
);
goto
end
;
goto
end
;
}
}
loc_range_col_array
=
range_col_array
;
loc_range_col_array
=
range_col_array
;
...
...
sql/partition_info.h
View file @
1f38322d
/* 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
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
it under the terms of the GNU General Public License as published by
...
...
sql/share/errmsg.txt
View file @
1f38322d
...
@@ -6180,8 +6180,6 @@ ER_TOO_LONG_FIELD_COMMENT
...
@@ -6180,8 +6180,6 @@ ER_TOO_LONG_FIELD_COMMENT
ER_FUNC_INEXISTENT_NAME_COLLISION 42000
ER_FUNC_INEXISTENT_NAME_COLLISION 42000
eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
eng "FUNCTION %s does not exist. Check the 'Function Name Parsing and Resolution' section in the Reference Manual"
ER_GLOBAL_PARTITION_INDEX_ERROR
eng "Partitioning of indexes only supported for global indexes"
ER_PARTITION_COLUMN_LIST_ERROR
ER_PARTITION_COLUMN_LIST_ERROR
eng "Inconsistency in usage of column lists for partitioning"
eng "Inconsistency in usage of column lists for partitioning"
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
ER_WRONG_TYPE_COLUMN_VALUE_ERROR
...
...
sql/sql_lex.cc
View file @
1f38322d
...
@@ -323,7 +323,6 @@ void lex_start(THD *thd)
...
@@ -323,7 +323,6 @@ void lex_start(THD *thd)
lex
->
select_lex
.
select_number
=
1
;
lex
->
select_lex
.
select_number
=
1
;
lex
->
length
=
0
;
lex
->
length
=
0
;
lex
->
part_info
=
0
;
lex
->
part_info
=
0
;
lex
->
global_flag
=
0
;
lex
->
select_lex
.
in_sum_expr
=
0
;
lex
->
select_lex
.
in_sum_expr
=
0
;
lex
->
select_lex
.
ftfunc_list_alloc
.
empty
();
lex
->
select_lex
.
ftfunc_list_alloc
.
empty
();
lex
->
select_lex
.
ftfunc_list
=
&
lex
->
select_lex
.
ftfunc_list_alloc
;
lex
->
select_lex
.
ftfunc_list
=
&
lex
->
select_lex
.
ftfunc_list_alloc
;
...
...
sql/sql_lex.h
View file @
1f38322d
...
@@ -1565,9 +1565,6 @@ typedef struct st_lex : public Query_tables_list
...
@@ -1565,9 +1565,6 @@ typedef struct st_lex : public Query_tables_list
/* Partition info structure filled in by PARTITION BY parse part */
/* Partition info structure filled in by PARTITION BY parse part */
partition_info
*
part_info
;
partition_info
*
part_info
;
/* Flag to index a global index created */
bool
global_flag
;
/*
/*
The definer of the object being created (view, trigger, stored routine).
The definer of the object being created (view, trigger, stored routine).
I.e. the value of DEFINER clause.
I.e. the value of DEFINER clause.
...
...
sql/sql_partition.cc
View file @
1f38322d
/* 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
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
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)
...
@@ -1406,8 +1406,8 @@ static void set_up_partition_func_pointers(partition_info *part_info)
DBUG_ASSERT
(
part_info
->
get_part_partition_id
);
DBUG_ASSERT
(
part_info
->
get_part_partition_id
);
if
(
!
part_info
->
column_list
)
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
;
part_info
->
get_part_partition_id
=
get_part_id_charset_func_part
;
}
}
}
}
...
@@ -2677,7 +2677,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
...
@@ -2677,7 +2677,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
part_info A reference to the partition_info struct where all the
part_info A reference to the partition_info struct where all the
desired information is given
desired information is given
out:part_id The partition id is returned through this pointer
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
RETURN VALUE
part_id Partition id of partition that would contain
part_id Partition id of partition that would contain
...
@@ -2735,7 +2735,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
...
@@ -2735,7 +2735,7 @@ static void restore_part_field_pointers(Field **ptr, uchar **restore_ptr)
get_partition_id_range_col
get_partition_id_range_col
get_partition_id_hash_nosub
get_partition_id_hash_nosub
get_partition_id_key_nosub
get_partition_id_key_nosub
get_partition_id_linhash_nosub
get_partition_id_lin
ear_
hash_nosub
get_partition_id_linear_key_nosub
get_partition_id_linear_key_nosub
*/
*/
...
@@ -2927,12 +2927,12 @@ uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info,
...
@@ -2927,12 +2927,12 @@ uint32 get_partition_id_cols_list_for_endpoint(partition_info *part_info,
}
}
else
else
{
{
DBUG_RETURN
(
list_index
+
test
(
left_endpoint
^
include_endpoint
));
DBUG_RETURN
(
list_index
+
test
(
!
tailf
));
}
}
}
while
(
max_list_index
>=
min_list_index
);
}
while
(
max_list_index
>=
min_list_index
);
notfound:
if
(
cmp
>
0
)
if
(
cmp
>
0
)
list_index
++
;
list_index
++
;
notfound:
DBUG_RETURN
(
list_index
);
DBUG_RETURN
(
list_index
);
}
}
...
@@ -3031,7 +3031,6 @@ int get_partition_id_range_col(partition_info *part_info,
...
@@ -3031,7 +3031,6 @@ int get_partition_id_range_col(partition_info *part_info,
DBUG_PRINT
(
"exit"
,(
"partition: %d"
,
*
part_id
));
DBUG_PRINT
(
"exit"
,(
"partition: %d"
,
*
part_id
));
DBUG_RETURN
(
0
);
DBUG_RETURN
(
0
);
return
0
;
}
}
...
@@ -6760,13 +6759,28 @@ static void set_up_range_analysis_info(partition_info *part_info)
...
@@ -6760,13 +6759,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_tuple_to_record
(
Field
**
pfield
,
uint32
*
store_length_array
,
uint32
*
store_length_array
,
uchar
*
value
,
uchar
*
value
,
uchar
*
value_end
)
uchar
*
value_end
)
{
{
/
/ see store_key_image_to_rec
/
* This function is inspired by store_key_image_rec. */
uint32
nparts
=
0
;
uint32
nparts
=
0
;
uchar
*
loc_value
;
uchar
*
loc_value
;
while
(
value
<
value_end
)
while
(
value
<
value_end
)
...
@@ -6793,12 +6807,12 @@ uint32 store_tuple_to_record(Field **pfield,
...
@@ -6793,12 +6807,12 @@ uint32 store_tuple_to_record(Field **pfield,
/*
/*
RANGE(columns) partitioning: compare value bound and probe tuple.
RANGE(columns) partitioning: compare value bound and probe tuple.
The value bound always is a full tuple (but may include
MIN_VALUE and
The value bound always is a full tuple (but may include
the MAX_VALUE
MAX_VALUE special values
).
special value
).
The probe tuple may be a prefix of partitioning tuple. The tail_is_min
The probe tuple may be a prefix of partitioning tuple. The tail_is_min
parameter specifies whether the suffix components should be assumed to
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
)
static
int
cmp_rec_and_tuple
(
part_column_list_val
*
val
,
uint32
nvals_in_rec
)
...
...
sql/sql_partition.h
View file @
1f38322d
/* 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
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
it under the terms of the GNU General Public License as published by
...
@@ -175,12 +175,12 @@ typedef struct st_partition_iter
...
@@ -175,12 +175,12 @@ typedef struct st_partition_iter
part_info Partitioning info
part_info Partitioning info
is_subpart
is_subpart
store_length_array Length of fields packed in opt_range_key format
store_length_array Length of fields packed in opt_range_key format
min_val Left 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
.
max_val Right edge, field value in opt_range_key format
min_len Length of minimum value
min_len Length of minimum value
max_len Length of maximum value
max_len Length of maximum value
flags Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE,
flags Some combination of NEAR_MIN, NEAR_MAX, NO_MIN_RANGE,
NO_MAX_RANGE
.
NO_MAX_RANGE
part_iter Iterator structure to be initialized
part_iter Iterator structure to be initialized
DESCRIPTION
DESCRIPTION
...
...
sql/sql_yacc.yy
View file @
1f38322d
...
@@ -1157,7 +1157,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
...
@@ -1157,7 +1157,6 @@ bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
opt_natural_language_mode opt_query_expansion
opt_natural_language_mode opt_query_expansion
opt_ev_status opt_ev_on_completion ev_on_completion opt_ev_comment
opt_ev_status opt_ev_on_completion ev_on_completion opt_ev_comment
ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
ev_alter_on_schedule_completion opt_ev_rename_to opt_ev_sql_stmt
opt_global
%type <ulong_num>
%type <ulong_num>
ulong_num real_ulong_num merge_insert_types
ulong_num real_ulong_num merge_insert_types
...
@@ -1691,12 +1690,12 @@ create:
...
@@ -1691,12 +1690,12 @@ create:
$5->table.str);
$5->table.str);
}
}
}
}
| CREATE opt_
global opt_
unique_or_fulltext INDEX_SYM ident key_alg ON
| CREATE opt_unique_or_fulltext INDEX_SYM ident key_alg ON
table_ident
table_ident
{
{
LEX *lex=Lex;
LEX *lex=Lex;
lex->sql_command= SQLCOM_CREATE_INDEX;
lex->sql_command= SQLCOM_CREATE_INDEX;
if (!lex->current_select->add_table_to_list(lex->thd, $
8
,
if (!lex->current_select->add_table_to_list(lex->thd, $
7
,
NULL,
NULL,
TL_OPTION_UPDATING))
TL_OPTION_UPDATING))
MYSQL_YYABORT;
MYSQL_YYABORT;
...
@@ -1704,7 +1703,6 @@ create:
...
@@ -1704,7 +1703,6 @@ create:
lex->alter_info.flags= ALTER_ADD_INDEX;
lex->alter_info.flags= ALTER_ADD_INDEX;
lex->col_list.empty();
lex->col_list.empty();
lex->change=NullS;
lex->change=NullS;
lex->global_flag= $2;
}
}
'(' key_list ')' key_options
'(' key_list ')' key_options
{
{
...
@@ -1715,22 +1713,13 @@ create:
...
@@ -1715,22 +1713,13 @@ create:
my_parse_error(ER(ER_SYNTAX_ERROR));
my_parse_error(ER(ER_SYNTAX_ERROR));
MYSQL_YYABORT;
MYSQL_YYABORT;
}
}
key= new Key($
3, $5
.str, &lex->key_create_info, 0,
key= new Key($
2, $4
.str, &lex->key_create_info, 0,
lex->col_list);
lex->col_list);
if (key == NULL)
if (key == NULL)
MYSQL_YYABORT;
MYSQL_YYABORT;
lex->alter_info.key_list.push_back(key);
lex->alter_info.key_list.push_back(key);
lex->col_list.empty();
lex->col_list.empty();
}
}
opt_partitioning
{
LEX *lex= Lex;
if (!lex->global_flag && lex->part_info)
{
my_error(ER_GLOBAL_PARTITION_INDEX_ERROR, MYF(0));
YYABORT;
}
}
| CREATE DATABASE opt_if_not_exists ident
| CREATE DATABASE opt_if_not_exists ident
{
{
Lex->create_info.default_table_charset= NULL;
Lex->create_info.default_table_charset= NULL;
...
@@ -4366,11 +4355,6 @@ opt_part_option:
...
@@ -4366,11 +4355,6 @@ opt_part_option:
{ Lex->part_info->curr_part_elem->part_comment= $3.str; }
{ Lex->part_info->curr_part_elem->part_comment= $3.str; }
;
;
opt_global:
/* empty */ { $$= FALSE;}
| GLOBAL_SYM { $$= TRUE; }
;
/*
/*
End of partition parser part
End of partition parser part
*/
*/
...
...
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