regexp1987 / common-schema

Automatically exported from code.google.com/p/common-schema
0 stars 0 forks source link

sql_range_partitions seems confused #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Which version of common_schema are you using?   2.2

This is on Percona Server 5.6.15, FTR.  

Which component is failing? sql_range_partitions

What is the expected output?

I'm expecting to get a sane ALTER TABLE to add a new partition to this table:

CREATE TABLE `sbtest1` (
  `id` int(10) unsigned NOT NULL,
  `k` int(10) unsigned NOT NULL DEFAULT '0',
  `c` char(120) NOT NULL DEFAULT '',
  `pad` char(60) NOT NULL DEFAULT '',
  `joined` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`joined`),
  KEY `k_1` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
/*!50500 PARTITION BY RANGE  COLUMNS(joined)
(PARTITION p0 VALUES LESS THAN ('2014-02-07 17:55:00') ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN ('2014-02-07 18:00:00') ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN ('2014-02-07 18:05:00') ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (MAXVALUE) ENGINE = InnoDB) */
1 row in set (0.01 sec)

 What do you see instead?

A NULL for the 'sql_add_next_parition'.  

localhost mysql> select * from common_schema.sql_range_partitions\G
*************************** 2. row ***************************
            table_schema: test
              table_name: sbtest1
        count_partitions: 4
   count_past_partitions: NULL
 count_future_partitions: NULL
            has_maxvalue: 1
sql_drop_first_partition: alter table `test`.`sbtest1` drop partition `p1`
  sql_add_next_partition: NULL
2 rows in set, 104 warnings (0.16 sec)

localhost mysql> select * from common_schema.status\G
*************************** 1. row ***************************
                       project_name: common_schema
                            version: 2.2
                           revision: 523
                       install_time: 2014-02-07 17:42:57
                    install_success: 1
          base_components_installed: 1
 innodb_plugin_components_installed: 1
percona_server_components_installed: 0
              install_mysql_version: 5.6.15-56-log
                   install_sql_mode: NO_AUTO_VALUE_ON_ZERO,NO_ENGINE_SUBSTITUTION
1 row in set (0.03 sec)

Original issue reported on code.google.com by jay.jans...@percona.com on 7 Feb 2014 at 5:58

GoogleCodeExporter commented 8 years ago
Ha, this is the first time I see range partitioning by the MINUTE. Currently 
common_schema looks at DAY as smallest resolution. I'll add support for HOUR 
and MINUTE.

Original comment by shlomi.n...@gmail.com on 19 Feb 2014 at 7:47

GoogleCodeExporter commented 8 years ago

Original comment by shlomi.n...@gmail.com on 31 Mar 2014 at 3:31

GoogleCodeExporter commented 8 years ago
Added support for MINUTE and HOUR intervals. Not released yet.

Original comment by shlomi.n...@gmail.com on 27 May 2014 at 12:11