WordPress database error: [Can't create/write to file '/tmp/#sql-temptable-1-38a-50.MAI' (Errcode: 28 "No space left on device")]
SHOW FULL COLUMNS FROM `wp_options`

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/wp-includes/class-wpdb.php:1851) in /var/www/html/wp-includes/rest-api/class-wp-rest-server.php on line 1896 {"id":1029,"date":"2014-03-17T12:51:07","date_gmt":"2014-03-17T12:51:07","guid":{"rendered":"http:\/\/www.nickbennett.co.uk\/?p=1029"},"modified":"2023-01-01T13:52:08","modified_gmt":"2023-01-01T13:52:08","slug":"phpunit-dramas","status":"publish","type":"post","link":"https:\/\/blog.nickbennett.co.uk\/index.php\/2014\/03\/17\/phpunit-dramas\/","title":{"rendered":"PHPUnit Dramas"},"content":{"rendered":"

A frail PHPUnit<\/strong> suite is one thing, but one that completely crashes MySQL<\/strong> is something else entirely!<\/p>\n

I wanted to do a quick blog as this problem isn’t well documented and I want to save people the same pain I went through.<\/p>\n

The problem manifested on a rather large suite of tests with a dedicated MySQL<\/strong> instance. When running the suite we were getting ‘database gone away’<\/em> errors in our DB unit<\/strong> tests. Our first thoughts were that it was potentially an issue with our out-of-date version of MySQL<\/strong>. Upon investigation, though it appeared the problem could be replicated and indeed fixed.<\/p>\n

The problem seemed to be a number of things.<\/span><\/p>\n

    \n
  1. Multiple table creation scripts for the same table (I know)<\/li>\n
  2. Mixing up engine types for tables within the same database<\/li>\n
  3. Having MySQL comment blocks in the table creation statements<\/li>\n
  4. The use of set foreign constraints statement<\/li>\n<\/ol>\n

    After much pain, the suite was eventually restored to working order. The lesson learnt was to centralise all of the DB unit<\/strong> table creation scripts. This ensures 1 point of entry for changes and debugging.<\/p>\n","protected":false},"excerpt":{"rendered":"

    A frail PHPUnit suite is one thing, but one that completely crashes MySQL is something else entirely! I wanted to do a quick blog as this problem isn’t well documented and I want to save people the same pain I went through. The problem manifested on a rather large suite of tests with a dedicated […]<\/p>\n","protected":false},"author":1,"featured_media":373,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,12],"tags":[125,155,298,326,327],"class_list":["post-1029","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","category-technology","tag-database","tag-failures","tag-mysql","tag-php","tag-phpunit"],"_links":{"self":[{"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/1029","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1029"}],"version-history":[{"count":2,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/1029\/revisions"}],"predecessor-version":[{"id":1383,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/posts\/1029\/revisions\/1383"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1029"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1029"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nickbennett.co.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1029"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}