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
c66a20b4
Commit
c66a20b4
authored
Dec 12, 2017
by
Eugene Kosov
Committed by
Aleksey Midenkov
Dec 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SQL: better check for partition engine [#366]
Cleaned up by @midenok.
parent
74cc9ec1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
12 deletions
+47
-12
mysql-test/suite/versioning/r/partition.result
mysql-test/suite/versioning/r/partition.result
+9
-0
mysql-test/suite/versioning/t/partition.test
mysql-test/suite/versioning/t/partition.test
+11
-0
sql/handler.cc
sql/handler.cc
+12
-12
sql/partition_element.h
sql/partition_element.h
+15
-0
No files found.
mysql-test/suite/versioning/r/partition.result
View file @
c66a20b4
...
...
@@ -293,4 +293,13 @@ partition by range (a)
(partition p0 values less than (20) engine innodb,
partition p1 values less than maxvalue engine innodb);
insert into t1 values (1);
create or replace table t1 (
f_int1 integer default 0
) with system versioning
partition by range(f_int1)
subpartition by hash(f_int1)
( partition part1 values less than (1000)
(subpartition subpart11 storage engine = 'innodb',
subpartition subpart12 storage engine = 'innodb'));
insert into t1 values (1);
drop table t1;
mysql-test/suite/versioning/t/partition.test
View file @
c66a20b4
...
...
@@ -236,6 +236,17 @@ partition by range (a)
partition
p1
values
less
than
maxvalue
engine
innodb
);
insert
into
t1
values
(
1
);
create
or
replace
table
t1
(
f_int1
integer
default
0
)
with
system
versioning
partition
by
range
(
f_int1
)
subpartition
by
hash
(
f_int1
)
(
partition
part1
values
less
than
(
1000
)
(
subpartition
subpart11
storage
engine
=
'innodb'
,
subpartition
subpart12
storage
engine
=
'innodb'
));
insert
into
t1
values
(
1
);
drop
table
t1
;
--
source
suite
/
versioning
/
common_finish
.
inc
sql/handler.cc
View file @
c66a20b4
...
...
@@ -6845,25 +6845,25 @@ bool Vers_parse_info::fix_implicit(THD *thd, Alter_info *alter_info,
bool
Table_scope_and_contents_source_st
::
vers_native
(
THD
*
thd
)
const
{
bool
integer_fields
=
ha_check_storage_engine_flag
(
db_type
,
HTON_NATIVE_SYS_VERSIONING
)
;
if
(
ha_check_storage_engine_flag
(
db_type
,
HTON_NATIVE_SYS_VERSIONING
))
return
true
;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
partition_info
*
info
=
thd
->
work_part_info
)
partition_info
*
info
=
thd
->
work_part_info
;
if
(
info
&&
!
(
used_fields
&
HA_CREATE_USED_ENGINE
))
{
if
(
!
(
used_fields
&
HA_CREATE_USED_ENGINE
)
&&
info
->
partitions
.
elements
)
if
(
handlerton
*
hton
=
info
->
default_engine_type
)
return
ha_check_storage_engine_flag
(
hton
,
HTON_NATIVE_SYS_VERSIONING
);
List_iterator_fast
<
partition_element
>
it
(
info
->
partitions
);
while
(
partition_element
*
partition_element
=
it
++
)
{
partition_element
*
element
=
static_cast
<
partition_element
*>
(
info
->
partitions
.
elem
(
0
));
handlerton
*
hton
=
element
->
engine_type
;
if
(
hton
&&
ha_check_storage_engine_flag
(
hton
,
HTON_NATIVE_SYS_VERSIONING
))
{
integer_fields
=
true
;
}
if
(
partition_element
->
find_engine_flag
(
HTON_NATIVE_SYS_VERSIONING
))
return
true
;
}
}
#endif
return
integer_fields
;
return
false
;
}
bool
Table_scope_and_contents_source_st
::
vers_fix_system_fields
(
...
...
sql/partition_element.h
View file @
c66a20b4
...
...
@@ -231,6 +231,21 @@ class partition_element :public Sql_alloc
DBUG_ASSERT
(
ev
->
col_val_array
);
return
ev
->
col_val_array
[
idx
];
}
bool
find_engine_flag
(
uint32
flag
)
{
if
(
ha_check_storage_engine_flag
(
engine_type
,
flag
))
return
true
;
List_iterator_fast
<
partition_element
>
it
(
subpartitions
);
while
(
partition_element
*
element
=
it
++
)
{
if
(
element
->
find_engine_flag
(
flag
))
return
true
;
}
return
false
;
}
};
#endif
/* PARTITION_ELEMENT_INCLUDED */
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