You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

165 lines
4.5 KiB

Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
Added support for more functions when using partitioned S3 tables MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
6 years ago
  1. # Test for COALESCE PARTITION, ALTER TABLE and ADD PARTITIONS
  2. # for tables with HASH partitions
  3. CREATE TABLE t1 (
  4. c1 INT DEFAULT NULL
  5. ) ENGINE=Aria
  6. PARTITION BY HASH (c1)
  7. PARTITIONS 3;
  8. INSERT INTO t1 VALUE (1), (2), (101), (102), (201), (202);
  9. ALTER TABLE t1 ENGINE=S3;
  10. SELECT count(*) FROM t1;
  11. count(*)
  12. 6
  13. SHOW TABLES;
  14. Tables_in_s3
  15. t1
  16. ALTER TABLE t1 COALESCE PARTITION 2;
  17. ERROR 42000: Table 't1' uses an extension that doesn't exist in this MariaDB version
  18. SHOW WARNINGS;
  19. Level Code Message
  20. Error 1112 Table 't1' uses an extension that doesn't exist in this MariaDB version
  21. Error 6 Error on delete of './s3/t1#P#p0#TMP#.MAI' (Errcode: 2 "No such file or directory")
  22. Error 6 Error on delete of './s3/t1#P#p0#TMP#.MAD' (Errcode: 2 "No such file or directory")
  23. ALTER TABLE t1 ADD PARTITION PARTITIONS 6;
  24. SELECT count(*) FROM t1;
  25. count(*)
  26. 6
  27. ALTER TABLE t1 ADD COLUMN c INT;
  28. SELECT count(*) FROM t1;
  29. count(*)
  30. 6
  31. DROP TABLE t1;
  32. # Test for simple change engine to S3
  33. CREATE TABLE t1 (
  34. c1 int DEFAULT NULL,
  35. c2 int DEFAULT NULL
  36. ) ENGINE=Aria
  37. PARTITION BY RANGE (c1)
  38. SUBPARTITION BY HASH(c2)
  39. SUBPARTITIONS 2
  40. (PARTITION p0 VALUES LESS THAN (100),
  41. PARTITION p1 VALUES LESS THAN (200),
  42. PARTITION p3 VALUES LESS THAN (300));
  43. INSERT INTO t1 VALUE (1,1), (2,2), (101,101), (102,102), (201,201), (202,202);
  44. ALTER TABLE t1 ENGINE=S3;
  45. SELECT count(*) FROM t1;
  46. count(*)
  47. 6
  48. # Test for rename table
  49. RENAME TABLE t1 TO t2;
  50. SELECT count(*) FROM t2;
  51. count(*)
  52. 6
  53. # Test for TRUNCATE, ANALYZE, CHECK, REBUILD, OPTIMIZE, REPAIR,
  54. # ADD, DROP, REORGANIZE partition
  55. ALTER TABLE t2 TRUNCATE PARTITION p3;
  56. ERROR HY000: Table 't2' is read only
  57. ALTER TABLE t2 ANALYZE PARTITION p3;
  58. Table Op Msg_type Msg_text
  59. s3.t2 analyze error Table 's3.t2' is read only
  60. SELECT count(*) FROM t2;
  61. count(*)
  62. 6
  63. ALTER TABLE t2 CHECK PARTITION p3;
  64. Table Op Msg_type Msg_text
  65. s3.t2 check error Subpartition p3sp0 returned error
  66. s3.t2 check error Unknown - internal error 165 during operation
  67. SELECT count(*) FROM t2;
  68. count(*)
  69. 6
  70. ALTER TABLE t2 REBUILD PARTITION p0, p1;
  71. ERROR 42000: Table 't2' uses an extension that doesn't exist in this MariaDB version
  72. ALTER TABLE t2 OPTIMIZE PARTITION p0, p1;
  73. Table Op Msg_type Msg_text
  74. s3.t2 optimize Error Table 't2' is read only
  75. s3.t2 optimize status Operation failed
  76. SELECT count(*) FROM t2;
  77. count(*)
  78. 6
  79. ALTER TABLE t2 REPAIR PARTITION p0, p1;
  80. Table Op Msg_type Msg_text
  81. s3.t2 repair Error Table 't2' is read only
  82. s3.t2 repair status Operation failed
  83. SELECT count(*) FROM t2;
  84. count(*)
  85. 6
  86. ALTER TABLE t2 ADD PARTITION (PARTITION p4 VALUES LESS THAN (400));
  87. SHOW CREATE TABLE t2;
  88. Table Create Table
  89. t2 CREATE TABLE `t2` (
  90. `c1` int(11) DEFAULT NULL,
  91. `c2` int(11) DEFAULT NULL
  92. ) ENGINE=S3 DEFAULT CHARSET=latin1
  93. PARTITION BY RANGE (`c1`)
  94. SUBPARTITION BY HASH (`c2`)
  95. SUBPARTITIONS 2
  96. (PARTITION `p0` VALUES LESS THAN (100) ENGINE = S3,
  97. PARTITION `p1` VALUES LESS THAN (200) ENGINE = S3,
  98. PARTITION `p3` VALUES LESS THAN (300) ENGINE = S3,
  99. PARTITION `p4` VALUES LESS THAN (400) ENGINE = S3)
  100. ALTER TABLE t2
  101. REORGANIZE PARTITION p4 INTO (
  102. PARTITION n0 VALUES LESS THAN (500),
  103. PARTITION n1 VALUES LESS THAN (600)
  104. );
  105. ERROR 42000: Table 't2' uses an extension that doesn't exist in this MariaDB version
  106. ALTER TABLE t2 DROP PARTITION p3;
  107. SHOW CREATE TABLE t2;
  108. Table Create Table
  109. t2 CREATE TABLE `t2` (
  110. `c1` int(11) DEFAULT NULL,
  111. `c2` int(11) DEFAULT NULL
  112. ) ENGINE=S3 DEFAULT CHARSET=latin1
  113. PARTITION BY RANGE (`c1`)
  114. SUBPARTITION BY HASH (`c2`)
  115. SUBPARTITIONS 2
  116. (PARTITION `p0` VALUES LESS THAN (100) ENGINE = S3,
  117. PARTITION `p1` VALUES LESS THAN (200) ENGINE = S3,
  118. PARTITION `p4` VALUES LESS THAN (400) ENGINE = S3)
  119. SELECT count(*) from t2;
  120. count(*)
  121. 4
  122. # Test for ALTER TABLE
  123. ALTER TABLE t2 ADD COLUMN c INT;
  124. SELECT count(*) FROM t2;
  125. count(*)
  126. 4
  127. ALTER TABLE t2 DROP COLUMN c;
  128. SELECT count(*) FROM t2;
  129. count(*)
  130. 4
  131. # Test for REMOVE PARTITIONING
  132. ALTER TABLE t2 REMOVE PARTITIONING;
  133. SHOW CREATE TABLE t2;
  134. Table Create Table
  135. t2 CREATE TABLE `t2` (
  136. `c1` int(11) DEFAULT NULL,
  137. `c2` int(11) DEFAULT NULL
  138. ) ENGINE=S3 DEFAULT CHARSET=latin1 PAGE_CHECKSUM=1
  139. SELECT count(*) FROM t2;
  140. count(*)
  141. 4
  142. DROP TABLE t2;
  143. # Test for EXCHANGE PARTITION
  144. CREATE TABLE t1 (
  145. c1 int DEFAULT NULL
  146. ) ENGINE=Aria
  147. PARTITION BY RANGE (c1)
  148. (PARTITION p0 VALUES LESS THAN (100),
  149. PARTITION p1 VALUES LESS THAN (200));
  150. INSERT INTO t1 VALUE (1), (2), (101), (102);
  151. ALTER TABLE t1 ENGINE=S3;
  152. CREATE TABLE t_part (
  153. c1 int DEFAULT NULL
  154. ) ENGINE=Aria;
  155. INSERT INTO t_part VALUE (120), (130), (140);
  156. ALTER TABLE t_part ENGINE=S3;
  157. ALTER TABLE t1 EXCHANGE PARTITION p1 WITH TABLE t_part;
  158. SELECT count(*) FROM t_part;
  159. count(*)
  160. 2
  161. SELECT count(*) FROM t1;
  162. count(*)
  163. 5
  164. DROP TABLE t1;
  165. DROP TABLE t_part;