summaryrefslogtreecommitdiff
path: root/sql/partition_info.cc
diff options
context:
space:
mode:
authorMikael Ronstrom <mikael@mysql.com>2009-12-17 18:39:10 +0100
committerMikael Ronstrom <mikael@mysql.com>2009-12-17 18:39:10 +0100
commit29c60cd5b7250995a5ac79c0fd703c0db5d612eb (patch)
treedc87d904496dc0919e3aa3f4ea3d6896bd8f3f7a /sql/partition_info.cc
parentd456e4470dcec35b9c3c35073e516894f41a2900 (diff)
downloadmariadb-git-29c60cd5b7250995a5ac79c0fd703c0db5d612eb.tar.gz
BUG#49591, Fixed version string in SHOW CREATE TABLE to accomodate for column list partitioning and new function to_seconds
Diffstat (limited to 'sql/partition_info.cc')
-rw-r--r--sql/partition_info.cc36
1 files changed, 36 insertions, 0 deletions
diff --git a/sql/partition_info.cc b/sql/partition_info.cc
index 56d79ac0d45..65029a817de 100644
--- a/sql/partition_info.cc
+++ b/sql/partition_info.cc
@@ -116,6 +116,42 @@ char *partition_info::create_default_partition_names(uint part_no,
/*
+ Generate a version string for partition expression
+ This function must be updated every time there is a possibility for
+ a new function of a higher version number than 5.5.0.
+
+ SYNOPSIS
+ set_show_version_string()
+ RETURN VALUES
+ None
+*/
+void partition_info::set_show_version_string(String *packet)
+{
+ int version= 0;
+ if (column_list)
+ packet->append(STRING_WITH_LEN("\n/*!50500"));
+ else
+ {
+ if (part_expr)
+ part_expr->walk(&Item::intro_version, 0, (uchar*)&version);
+ if (subpart_expr)
+ subpart_expr->walk(&Item::intro_version, 0, (uchar*)&version);
+ if (version == 0)
+ {
+ /* No new functions in partition function */
+ packet->append(STRING_WITH_LEN("\n/*!50100"));
+ }
+ else
+ {
+ char buf[65];
+ char *buf_ptr= longlong10_to_str((longlong)version, buf, 10);
+ packet->append(STRING_WITH_LEN("\n/*!"));
+ packet->append(buf, (size_t)(buf_ptr - buf));
+ }
+ }
+}
+
+/*
Create a unique name for the subpartition as part_name'sp''subpart_no'
SYNOPSIS
create_subpartition_name()