{"id":1077,"date":"2015-04-07T18:05:01","date_gmt":"2015-04-07T18:05:01","guid":{"rendered":"http:\/\/10sa.com\/sql_stories\/?p=1077"},"modified":"2015-10-13T11:24:17","modified_gmt":"2015-10-13T11:24:17","slug":"unusual-mysql-partitioning","status":"publish","type":"post","link":"http:\/\/10sa.com\/sql_stories\/?p=1077","title":{"rendered":"Unusual: Mysql, partitioning"},"content":{"rendered":"<p>### Partitioning:<\/p>\n<pre lang=\"SQL\">mysql&gt;ALTER TABLE `els_clipping_tester_err` ADD FOREIGN KEY (`clipping_id`) REFERENCES `inf_clipping3`(`CLIP_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;\r\nERROR 1005 (HY000): Can't create table 'inforia.#sql-7f30_17f4dd0' (errno: 150)\r\nCannot resolve table name close to ....<\/pre>\n<pre lang=\"SQL\">\r\nmysql>alter table clipping3 remove partitioing;\r\nmysql>ALTER TABLE `els_clipping_tester_err` ADD FOREIGN KEY (`clipping_id`) REFERENCES `inf_clipping3`(`CLIP_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT;\r\nQuery OK, 0 rows affected (0.04 sec)\r\nRecords: 0 Duplicates: 0 Warnings: 0\r\n<\/pre>\n<p><a href=\"https:\/\/dev.mysql.com\/doc\/refman\/5.6\/en\/partitioning-limitations.html\">The explaination is the limitation for innodb.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>### Partitioning: mysql&gt;ALTER TABLE `els_clipping_tester_err` ADD FOREIGN KEY (`clipping_id`) REFERENCES `inf_clipping3`(`CLIP_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT; ERROR 1005 (HY000): Can&#8217;t create table &#8216;inforia.#sql-7f30_17f4dd0&#8217; (errno: 150) Cannot resolve table name close to &#8230;. mysql>alter table clipping3 remove partitioing; mysql>ALTER TABLE `els_clipping_tester_err` ADD FOREIGN KEY (`clipping_id`) REFERENCES `inf_clipping3`(`CLIP_ID`) ON DELETE RESTRICT ON UPDATE RESTRICT; Query OK, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[7,3],"tags":[],"_links":{"self":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/1077"}],"collection":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1077"}],"version-history":[{"count":4,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/1077\/revisions"}],"predecessor-version":[{"id":1119,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=\/wp\/v2\/posts\/1077\/revisions\/1119"}],"wp:attachment":[{"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1077"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1077"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/10sa.com\/sql_stories\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1077"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}