summaryrefslogtreecommitdiff
path: root/mysql-test/main/partition_alter.result
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-09-09 11:58:46 +0300
committerSergei Golubchik <serg@mariadb.org>2021-10-26 17:07:46 +0200
commitf6b0e34c381c54f392222c978fb17dcf12e7cff3 (patch)
tree63b3aab331175e9ed0cd815ffcc2edc03b6bce02 /mysql-test/main/partition_alter.result
parent379ddf492142e4d0fe1c7eba98b3143afd0e5426 (diff)
downloadmariadb-git-f6b0e34c381c54f392222c978fb17dcf12e7cff3.tar.gz
MDEV-26471 Syntax extension: do not require PARTITION keyword in partition definition
Instead of create or replace table t1 (x int) partition by range(x) ( partition p1 values less than (10), partition pn values less than maxvalue); it should be possible to type in shorter form: create or replace table t1 (x int) partition by range(x) ( p1 values less than (10), pn values less than maxvalue); As above examples demonstrate, make PARTITION keyword in partition definition optional.
Diffstat (limited to 'mysql-test/main/partition_alter.result')
-rw-r--r--mysql-test/main/partition_alter.result64
1 files changed, 64 insertions, 0 deletions
diff --git a/mysql-test/main/partition_alter.result b/mysql-test/main/partition_alter.result
index 997a5cf97fa..d233486b427 100644
--- a/mysql-test/main/partition_alter.result
+++ b/mysql-test/main/partition_alter.result
@@ -201,3 +201,67 @@ pk
delete from t1;
drop table t1;
# End of 10.3 tests
+create or replace table t1 (x int primary key)
+partition by range(x) (
+p1 values less than (10),
+partition p2 values less than (20),
+p3 values less than (30),
+partition p4 values less than (40),
+p5 values less than (50),
+pn values less than maxvalue);
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) NOT NULL,
+ PRIMARY KEY (`x`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY RANGE (`x`)
+(PARTITION `p1` VALUES LESS THAN (10) ENGINE = MyISAM,
+ PARTITION `p2` VALUES LESS THAN (20) ENGINE = MyISAM,
+ PARTITION `p3` VALUES LESS THAN (30) ENGINE = MyISAM,
+ PARTITION `p4` VALUES LESS THAN (40) ENGINE = MyISAM,
+ PARTITION `p5` VALUES LESS THAN (50) ENGINE = MyISAM,
+ PARTITION `pn` VALUES LESS THAN MAXVALUE ENGINE = MyISAM)
+create or replace table t1 (x int)
+partition by list(x) (
+partition p1 values in (2, 3, 4),
+partition p2 values in (12, 13, 14),
+partition p3 values in (22, 23, 24),
+p4 values in (32, 33, 34),
+p5 values in (42, 43, 44),
+pn values in (52, 53, 54));
+show create table t1;
+Table Create Table
+t1 CREATE TABLE `t1` (
+ `x` int(11) DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1
+ PARTITION BY LIST (`x`)
+(PARTITION `p1` VALUES IN (2,3,4) ENGINE = MyISAM,
+ PARTITION `p2` VALUES IN (12,13,14) ENGINE = MyISAM,
+ PARTITION `p3` VALUES IN (22,23,24) ENGINE = MyISAM,
+ PARTITION `p4` VALUES IN (32,33,34) ENGINE = MyISAM,
+ PARTITION `p5` VALUES IN (42,43,44) ENGINE = MyISAM,
+ PARTITION `pn` VALUES IN (52,53,54) ENGINE = MyISAM)
+create or replace table t1 (x int)
+partition by list(x) (
+partition partition p1 values in (2, 3, 4),
+pn values in (52, 53, 54));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'partition p1 values in (2, 3, 4),
+pn values in (52, 53, 54))' at line 3
+create or replace table t1 (x int)
+partition by list(x) (
+partition partition values in (2, 3, 4),
+pn values in (52, 53, 54));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'partition values in (2, 3, 4),
+pn values in (52, 53, 54))' at line 3
+create or replace table t1 (x int)
+partition by list(x) (
+partition values in (2, 3, 4),
+pn values in (52, 53, 54));
+ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'in (2, 3, 4),
+pn values in (52, 53, 54))' at line 3
+create or replace table t1 (x int)
+partition by list(x) (
+partitio values in (2, 3, 4),
+pn values in (52, 53, 54));
+drop table t1;