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
0d716860
Commit
0d716860
authored
Jun 25, 2007
by
holyfoot/hf@hfmain.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk@192.168.21.1:mysql-5.1-opt
into mysql.com:/home/hf/work/27084/my51-27084
parents
47d868c9
576f2f84
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
16 deletions
+60
-16
mysql-test/r/partition.result
mysql-test/r/partition.result
+10
-0
mysql-test/t/partition.test
mysql-test/t/partition.test
+15
-0
sql/item_cmpfunc.cc
sql/item_cmpfunc.cc
+15
-0
sql/item_cmpfunc.h
sql/item_cmpfunc.h
+1
-12
sql/sql_partition.cc
sql/sql_partition.cc
+6
-1
sql/sql_partition.h
sql/sql_partition.h
+2
-1
sql/table.cc
sql/table.cc
+11
-2
No files found.
mysql-test/r/partition.result
View file @
0d716860
...
...
@@ -1267,4 +1267,14 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
ERROR HY000: Incorrect usage of PARTITION and log table
ALTER TABLE general_log ENGINE = CSV;
SET GLOBAL general_log = default;
CREATE TABLE `t1` ( `a` varchar(1)) ENGINE=MyISAM
PARTITION BY LIST (CASE a WHEN 'a' THEN 1
WHEN 'b' THEN 2
WHEN 'c' THEN 3
END) (
PARTITION a VALUES IN (1),
PARTITION b VALUES IN (2),
PARTITION c VALUES IN (3)
);
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/partition.test
View file @
0d716860
...
...
@@ -1494,4 +1494,19 @@ ALTER TABLE general_log PARTITION BY RANGE (TO_DAYS(event_time))
ALTER
TABLE
general_log
ENGINE
=
CSV
;
SET
GLOBAL
general_log
=
default
;
#
# Bug #27084 partitioning by list seems failing when using case
#
CREATE
TABLE
`t1`
(
`a`
varchar
(
1
))
ENGINE
=
MyISAM
PARTITION
BY
LIST
(
CASE
a
WHEN
'a'
THEN
1
WHEN
'b'
THEN
2
WHEN
'c'
THEN
3
END
)
(
PARTITION
a
VALUES
IN
(
1
),
PARTITION
b
VALUES
IN
(
2
),
PARTITION
c
VALUES
IN
(
3
)
);
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/item_cmpfunc.cc
View file @
0d716860
...
...
@@ -2586,6 +2586,21 @@ void Item_func_case::print(String *str)
str
->
append
(
STRING_WITH_LEN
(
"end)"
));
}
void
Item_func_case
::
cleanup
()
{
uint
i
;
DBUG_ENTER
(
"Item_func_case::cleanup"
);
Item_func
::
cleanup
();
for
(
i
=
0
;
i
<=
(
uint
)
DECIMAL_RESULT
;
i
++
)
{
delete
cmp_items
[
i
];
cmp_items
[
i
]
=
0
;
}
DBUG_VOID_RETURN
;
}
/*
Coalesce - return first not NULL argument.
*/
...
...
sql/item_cmpfunc.h
View file @
0d716860
...
...
@@ -1142,18 +1142,7 @@ public:
Item
*
find_item
(
String
*
str
);
CHARSET_INFO
*
compare_collation
()
{
return
cmp_collation
.
collation
;
}
bool
check_partition_func_processor
(
uchar
*
bool_arg
)
{
return
FALSE
;}
void
cleanup
()
{
uint
i
;
DBUG_ENTER
(
"Item_func_case::cleanup"
);
Item_func
::
cleanup
();
for
(
i
=
0
;
i
<=
(
uint
)
DECIMAL_RESULT
;
i
++
)
{
delete
cmp_items
[
i
];
cmp_items
[
i
]
=
0
;
}
DBUG_VOID_RETURN
;
}
void
cleanup
();
};
/*
...
...
sql/sql_partition.cc
View file @
0d716860
...
...
@@ -3663,6 +3663,8 @@ void get_partition_set(const TABLE *table, uchar *buf, const uint index,
table Table object of partitioned table
create_table_ind Is it called from CREATE TABLE
default_db_type What is the default engine of the table
work_part_info_used Flag is raised if we don't create new
part_info, but used thd->work_part_info
RETURN VALUE
TRUE Error
...
...
@@ -3683,7 +3685,8 @@ bool mysql_unpack_partition(THD *thd,
const
char
*
part_buf
,
uint
part_info_len
,
const
char
*
part_state
,
uint
part_state_len
,
TABLE
*
table
,
bool
is_create_table_ind
,
handlerton
*
default_db_type
)
handlerton
*
default_db_type
,
bool
*
work_part_info_used
)
{
bool
result
=
TRUE
;
partition_info
*
part_info
;
...
...
@@ -3698,6 +3701,7 @@ bool mysql_unpack_partition(THD *thd,
Lex_input_stream
lip
(
thd
,
part_buf
,
part_info_len
);
lex_start
(
thd
);
*
work_part_info_used
=
false
;
/*
We need to use the current SELECT_LEX since I need to keep the
Name_resolution_context object which is referenced from the
...
...
@@ -3782,6 +3786,7 @@ bool mysql_unpack_partition(THD *thd,
thd
->
free_items
();
part_info
=
thd
->
work_part_info
;
table
->
s
->
version
=
0UL
;
*
work_part_info_used
=
true
;
}
}
table
->
part_info
=
part_info
;
...
...
sql/sql_partition.h
View file @
0d716860
...
...
@@ -81,7 +81,8 @@ bool mysql_unpack_partition(THD *thd, const char *part_buf,
uint
part_info_len
,
const
char
*
part_state
,
uint
part_state_len
,
TABLE
*
table
,
bool
is_create_table_ind
,
handlerton
*
default_db_type
);
handlerton
*
default_db_type
,
bool
*
work_part_info_used
);
void
make_used_partitions_str
(
partition_info
*
part_info
,
String
*
parts_str
);
uint32
get_list_array_idx_for_endpoint
(
partition_info
*
part_info
,
bool
left_endpoint
,
...
...
sql/table.cc
View file @
0d716860
...
...
@@ -1589,21 +1589,30 @@ int open_table_from_share(THD *thd, TABLE_SHARE *share, const char *alias,
thd
->
set_n_backup_active_arena
(
&
part_func_arena
,
&
backup_arena
);
thd
->
stmt_arena
=
&
part_func_arena
;
bool
tmp
;
bool
work_part_info_used
;
tmp
=
mysql_unpack_partition
(
thd
,
share
->
partition_info
,
share
->
partition_info_len
,
share
->
part_state
,
share
->
part_state_len
,
outparam
,
is_create_table
,
share
->
default_part_db_type
);
share
->
default_part_db_type
,
&
work_part_info_used
);
outparam
->
part_info
->
is_auto_partitioned
=
share
->
auto_partitioned
;
DBUG_PRINT
(
"info"
,
(
"autopartitioned: %u"
,
share
->
auto_partitioned
));
if
(
!
tmp
)
/* we should perform the fix_partition_func in either local or
caller's arena depending on work_part_info_used value
*/
if
(
!
tmp
&&
!
work_part_info_used
)
tmp
=
fix_partition_func
(
thd
,
outparam
,
is_create_table
);
thd
->
stmt_arena
=
backup_stmt_arena_ptr
;
thd
->
restore_active_arena
(
&
part_func_arena
,
&
backup_arena
);
if
(
!
tmp
)
{
if
(
work_part_info_used
)
tmp
=
fix_partition_func
(
thd
,
outparam
,
is_create_table
);
outparam
->
part_info
->
item_free_list
=
part_func_arena
.
free_list
;
}
if
(
tmp
)
{
if
(
is_create_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