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
935817e9
Commit
935817e9
authored
Jun 15, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix to compile without partitioning.
Remove few ifdef's
parent
68a6705e
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
60 additions
and
62 deletions
+60
-62
cmake/plugin.cmake
cmake/plugin.cmake
+2
-1
include/my_global.h
include/my_global.h
+6
-0
mysql-test/r/not_partition.result
mysql-test/r/not_partition.result
+10
-10
sql/opt_range.cc
sql/opt_range.cc
+38
-38
sql/opt_range.h
sql/opt_range.h
+1
-1
sql/table.cc
sql/table.cc
+1
-1
sql/unireg.cc
sql/unireg.cc
+2
-11
No files found.
cmake/plugin.cmake
View file @
935817e9
...
...
@@ -90,7 +90,8 @@ MACRO(MYSQL_ADD_PLUGIN)
AND NOT ARG_MODULE_ONLY
)
SET
(
WITH_
${
plugin
}
1
)
ELSEIF
(
WITHOUT_
${
plugin
}
_STORAGE_ENGINE OR WITH_NONE OR
${
plugin
}
_DISABLED
)
ELSEIF
(
WITHOUT_
${
plugin
}
OR WITHOUT_
${
plugin
}
_STORAGE_ENGINE OR
WITH_NONE OR
${
plugin
}
_DISABLED
)
SET
(
WITHOUT_
${
plugin
}
1
)
SET
(
WITH_
${
plugin
}
_STORAGE_ENGINE 0
)
SET
(
WITH_
${
plugin
}
0
)
...
...
include/my_global.h
View file @
935817e9
...
...
@@ -103,6 +103,12 @@
#define HAVE_EXTERNAL_CLIENT
#endif
#ifdef WITH_PARTITION_STORAGE_ENGINE
#define IF_PARTITIONING(A,B) A
#else
#define IF_PARTITIONING(A,B) B
#endif
#if defined (_WIN32)
/*
off_t is 32 bit long. We do not use C runtime functions
...
...
mysql-test/r/not_partition.result
View file @
935817e9
...
...
@@ -3,7 +3,7 @@ FLUSH TABLES;
SELECT * FROM t1;
ERROR 42000: Unknown storage engine 'partition'
TRUNCATE TABLE t1;
ERROR 42
S02: Table 'test.t1' doesn't exist
ERROR 42
000: Unknown storage engine 'partition'
ANALYZE TABLE t1;
Table Op Msg_type Msg_text
test.t1 analyze Error Unknown storage engine 'partition'
...
...
@@ -21,17 +21,17 @@ Table Op Msg_type Msg_text
test.t1 repair Error Unknown storage engine 'partition'
test.t1 repair error Corrupt
ALTER TABLE t1 REPAIR PARTITION ALL;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
ALTER TABLE t1 CHECK PARTITION ALL;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
ALTER TABLE t1 OPTIMIZE PARTITION ALL;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
ALTER TABLE t1 ANALYZE PARTITION ALL;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
ALTER TABLE t1 REBUILD PARTITION ALL;
ERROR 42000: Unknown storage engine 'partition'
ALTER TABLE t1 TRUNCATE PARTITION ALL;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
ALTER TABLE t1 ENGINE Memory;
ERROR 42000: Unknown storage engine 'partition'
ALTER TABLE t1 ADD (new INT);
...
...
@@ -46,9 +46,9 @@ joined DATE NOT NULL
)
PARTITION BY KEY(joined)
PARTITIONS 6;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
ALTER TABLE t1 PARTITION BY KEY(joined) PARTITIONS 2;
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (
...
...
@@ -65,7 +65,7 @@ PARTITION p2 VALUES LESS THAN (1980),
PARTITION p3 VALUES LESS THAN (1990),
PARTITION p4 VALUES LESS THAN MAXVALUE
);
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
CREATE TABLE t1 (id INT, purchased DATE)
...
...
@@ -76,7 +76,7 @@ PARTITION p0 VALUES LESS THAN (1990),
PARTITION p1 VALUES LESS THAN (2000),
PARTITION p2 VALUES LESS THAN MAXVALUE
);
ERROR HY000: The 'partitioning' feature is disabled; you need M
ySQL
built with '--with-plugin-partition' to have it working
ERROR HY000: The 'partitioning' feature is disabled; you need M
ariaDB
built with '--with-plugin-partition' to have it working
drop table t1;
ERROR 42S02: Unknown table 't1'
create table t1 (a varchar(10) charset latin1 collate latin1_bin);
...
...
sql/opt_range.cc
View file @
935817e9
...
...
@@ -3609,6 +3609,44 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item *cond)
/****************************************************************************
* Partition pruning module
****************************************************************************/
/*
Store field key image to table record
SYNOPSIS
store_key_image_to_rec()
field Field which key image should be stored
ptr Field value in key format
len Length of the value, in bytes
DESCRIPTION
Copy the field value from its key image to the table record. The source
is the value in key image format, occupying len bytes in buffer pointed
by ptr. The destination is table record, in "field value in table record"
format.
*/
void
store_key_image_to_rec
(
Field
*
field
,
uchar
*
ptr
,
uint
len
)
{
/* Do the same as print_key() does */
my_bitmap_map
*
old_map
;
if
(
field
->
real_maybe_null
())
{
if
(
*
ptr
)
{
field
->
set_null
();
return
;
}
field
->
set_notnull
();
ptr
++
;
}
old_map
=
dbug_tmp_use_all_columns
(
field
->
table
,
field
->
table
->
write_set
);
field
->
set_key_image
(
ptr
,
len
);
dbug_tmp_restore_column_map
(
field
->
table
->
write_set
,
old_map
);
}
#ifdef WITH_PARTITION_STORAGE_ENGINE
/*
...
...
@@ -3943,44 +3981,6 @@ end:
}
/*
Store field key image to table record
SYNOPSIS
store_key_image_to_rec()
field Field which key image should be stored
ptr Field value in key format
len Length of the value, in bytes
DESCRIPTION
Copy the field value from its key image to the table record. The source
is the value in key image format, occupying len bytes in buffer pointed
by ptr. The destination is table record, in "field value in table record"
format.
*/
void
store_key_image_to_rec
(
Field
*
field
,
uchar
*
ptr
,
uint
len
)
{
/* Do the same as print_key() does */
my_bitmap_map
*
old_map
;
if
(
field
->
real_maybe_null
())
{
if
(
*
ptr
)
{
field
->
set_null
();
return
;
}
field
->
set_notnull
();
ptr
++
;
}
old_map
=
dbug_tmp_use_all_columns
(
field
->
table
,
field
->
table
->
write_set
);
field
->
set_key_image
(
ptr
,
len
);
dbug_tmp_restore_column_map
(
field
->
table
->
write_set
,
old_map
);
}
/*
For SEL_ARG* array, store sel_arg->min values into table record buffer
...
...
sql/opt_range.h
View file @
935817e9
...
...
@@ -1046,8 +1046,8 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item *cond);
#ifdef WITH_PARTITION_STORAGE_ENGINE
bool
prune_partitions
(
THD
*
thd
,
TABLE
*
table
,
Item
*
pprune_cond
);
void
store_key_image_to_rec
(
Field
*
field
,
uchar
*
ptr
,
uint
len
);
#endif
void
store_key_image_to_rec
(
Field
*
field
,
uchar
*
ptr
,
uint
len
);
extern
String
null_string
;
...
...
sql/table.cc
View file @
935817e9
...
...
@@ -2125,7 +2125,7 @@ bool TABLE_SHARE::write_frm_image(const uchar *frm, size_t len)
bool
TABLE_SHARE
::
read_frm_image
(
const
uchar
**
frm
,
size_t
*
len
)
{
if
(
partition_info_str
)
// cannot discover a partition
if
(
IF_PARTITIONING
(
partition_info_str
,
0
))
// cannot discover a partition
{
DBUG_ASSERT
(
db_type
()
->
discover_table
==
0
);
return
1
;
...
...
sql/unireg.cc
View file @
935817e9
...
...
@@ -72,9 +72,7 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
ulong
filepos
,
data_offset
;
uint
options_len
;
uchar
fileinfo
[
FRM_HEADER_SIZE
],
forminfo
[
FRM_FORMINFO_SIZE
];
#ifdef WITH_PARTITION_STORAGE_ENGINE
partition_info
*
part_info
=
thd
->
work_part_info
;
#endif
const
partition_info
*
part_info
=
IF_PARTITIONING
(
thd
->
work_part_info
,
0
);
int
error
;
uchar
*
frm_ptr
,
*
pos
;
LEX_CUSTRING
frm
=
{
0
,
0
};
...
...
@@ -106,12 +104,8 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
=> Total 6 byte
*/
create_info
->
extra_size
+=
6
;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
part_info
)
{
create_info
->
extra_size
+=
part_info
->
part_info_len
;
}
#endif
for
(
i
=
0
;
i
<
keys
;
i
++
)
{
...
...
@@ -266,13 +260,12 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
(
create_info
->
min_rows
==
1
)
&&
(
keys
==
0
));
int2store
(
fileinfo
+
28
,
key_info_length
);
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
part_info
)
{
fileinfo
[
61
]
=
(
uchar
)
ha_legacy_type
(
part_info
->
default_engine_type
);
DBUG_PRINT
(
"info"
,
(
"part_db_type = %d"
,
fileinfo
[
61
]));
}
#endif
int2store
(
fileinfo
+
59
,
db_file
->
extra_rec_buf_length
());
memcpy
(
frm_ptr
,
fileinfo
,
FRM_HEADER_SIZE
);
...
...
@@ -292,7 +285,6 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
memcpy
(
pos
,
str_db_type
.
str
,
str_db_type
.
length
);
pos
+=
str_db_type
.
length
;
#ifdef WITH_PARTITION_STORAGE_ENGINE
if
(
part_info
)
{
char
auto_partitioned
=
part_info
->
is_auto_partitioned
?
1
:
0
;
...
...
@@ -303,7 +295,6 @@ LEX_CUSTRING build_frm_image(THD *thd, const char *table,
*
pos
++=
auto_partitioned
;
}
else
#endif
{
pos
+=
6
;
}
...
...
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