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
c6e67a9b
Commit
c6e67a9b
authored
Oct 06, 2009
by
Mikael Ronstrom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#47838, NULL values in ranges was dropped due to missing else part in store_tuple_to_record
parent
01072e22
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
4 deletions
+46
-4
mysql-test/r/partition_column.result
mysql-test/r/partition_column.result
+12
-0
mysql-test/t/partition_column.test
mysql-test/t/partition_column.test
+27
-0
sql/sql_partition.cc
sql/sql_partition.cc
+7
-4
No files found.
mysql-test/r/partition_column.result
View file @
c6e67a9b
drop table if exists t1;
drop table if exists t1;
create table t1 (a int signed)
partition by list column_list(a)
( partition p0 values in (column_list(1), column_list(3), column_list(5),
column_list(7), column_list(9), column_list(NULL)),
partition p1 values in (column_list(2), column_list(4), column_list(6),
column_list(8), column_list(0)));
insert into t1 values (NULL),(0),(1),(2),(2),(4),(4),(4),(8),(8);
select * from t1 where a <= 1;
a
1
0
drop table t1;
create table t1 (a int, b int)
create table t1 (a int, b int)
partition by list column_list(a,b)
partition by list column_list(a,b)
( partition p0 values in (column_list(1, NULL), column_list(2, NULL),
( partition p0 values in (column_list(1, NULL), column_list(2, NULL),
...
...
mysql-test/t/partition_column.test
View file @
c6e67a9b
...
@@ -8,6 +8,33 @@
...
@@ -8,6 +8,33 @@
drop
table
if
exists
t1
;
drop
table
if
exists
t1
;
--
enable_warnings
--
enable_warnings
#
# BUG#47838, List partitioning have problems with <= and >=
#
create
table
t1
(
a
int
signed
)
partition
by
list
(
a
)
(
partition
p0
values
in
(
1
,
3
,
5
,
7
,
9
,
NULL
),
partition
p1
values
in
(
2
,
4
,
6
,
8
,
0
));
insert
into
t1
values
(
NULL
),(
0
),(
1
),(
2
),(
2
),(
4
),(
4
),(
4
),(
8
),(
8
);
select
*
from
t1
where
NULL
<=
a
;
select
*
from
t1
where
a
is
null
;
explain
partitions
select
*
from
t1
where
a
is
null
;
select
*
from
t1
where
a
<=
1
;
drop
table
t1
;
create
table
t1
(
a
int
signed
)
partition
by
list
column_list
(
a
)
(
partition
p0
values
in
(
column_list
(
1
),
column_list
(
3
),
column_list
(
5
),
column_list
(
7
),
column_list
(
9
),
column_list
(
NULL
)),
partition
p1
values
in
(
column_list
(
2
),
column_list
(
4
),
column_list
(
6
),
column_list
(
8
),
column_list
(
0
)));
insert
into
t1
values
(
NULL
),(
0
),(
1
),(
2
),(
2
),(
4
),(
4
),(
4
),(
8
),(
8
);
select
*
from
t1
where
a
<=
NULL
;
select
*
from
t1
where
a
is
null
;
explain
partitions
select
*
from
t1
where
a
is
null
;
select
*
from
t1
where
a
<=
1
;
drop
table
t1
;
create
table
t1
(
a
int
,
b
int
)
create
table
t1
(
a
int
,
b
int
)
partition
by
list
column_list
(
a
,
b
)
partition
by
list
column_list
(
a
,
b
)
(
partition
p0
values
in
(
column_list
(
1
,
NULL
),
column_list
(
2
,
NULL
),
(
partition
p0
values
in
(
column_list
(
1
,
NULL
),
column_list
(
2
,
NULL
),
...
...
sql/sql_partition.cc
View file @
c6e67a9b
...
@@ -6761,9 +6761,8 @@ uint32 store_tuple_to_record(Field **pfield,
...
@@ -6761,9 +6761,8 @@ uint32 store_tuple_to_record(Field **pfield,
if
((
*
pfield
)
->
real_maybe_null
())
if
((
*
pfield
)
->
real_maybe_null
())
{
{
if
(
*
loc_value
)
if
(
*
loc_value
)
{
(
*
pfield
)
->
set_null
();
(
*
pfield
)
->
set_null
();
}
else
(
*
pfield
)
->
set_notnull
();
(
*
pfield
)
->
set_notnull
();
loc_value
++
;
loc_value
++
;
}
}
...
@@ -6950,12 +6949,16 @@ int get_part_iter_for_interval_cols_via_map(partition_info *part_info,
...
@@ -6950,12 +6949,16 @@ int get_part_iter_for_interval_cols_via_map(partition_info *part_info,
get_col_endpoint
=
get_partition_id_cols_range_for_endpoint
;
get_col_endpoint
=
get_partition_id_cols_range_for_endpoint
;
part_iter
->
get_next
=
get_next_partition_id_range
;
part_iter
->
get_next
=
get_next_partition_id_range
;
}
}
else
else
if
(
part_info
->
part_type
==
LIST_PARTITION
)
{
{
get_col_endpoint
=
get_partition_id_cols_list_for_endpoint
;
get_col_endpoint
=
get_partition_id_cols_list_for_endpoint
;
part_iter
->
get_next
=
get_next_partition_id_list
;
part_iter
->
get_next
=
get_next_partition_id_list
;
part_iter
->
part_info
=
part_info
;
part_iter
->
part_info
=
part_info
;
DBUG_ASSERT
(
part_info
->
num_list_values
);
}
}
else
assert
(
0
);
if
(
flags
&
NO_MIN_RANGE
)
if
(
flags
&
NO_MIN_RANGE
)
part_iter
->
part_nums
.
start
=
part_iter
->
part_nums
.
cur
=
0
;
part_iter
->
part_nums
.
start
=
part_iter
->
part_nums
.
cur
=
0
;
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