{"id":1338,"date":"2009-01-08T14:38:54","date_gmt":"2009-01-08T04:38:54","guid":{"rendered":"http:\/\/www.flamingspork.com\/blog\/?p=1338"},"modified":"2009-02-21T13:28:58","modified_gmt":"2009-02-21T03:28:58","slug":"magic-number-super-fun-happy-time","status":"publish","type":"post","link":"https:\/\/www.flamingspork.com\/blog\/2009\/01\/08\/magic-number-super-fun-happy-time\/","title":{"rendered":"magic number super fun happy time"},"content":{"rendered":"<p>umm&#8230;..<\/p>\n<pre>int Field_timestamp::store(double nr)\r\n{\r\n  int error= 0;\r\n  if (nr &lt; 0 || nr &gt; 99991231235959.0)\r\n  {\r\n    set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN,\r\n                         ER_WARN_DATA_OUT_OF_RANGE,\r\n                         nr, DRIZZLE_TIMESTAMP_DATETIME);\r\n    nr= 0;\t\t\t\t\t\/\/ Avoid overflow on buff\r\n    error= 1;\r\n  }\r\n  error|= Field_timestamp::store((int64_t) rint(nr), false);\r\n  return error;\r\n}<\/pre>\n<p>(likely the same in mysql as well&#8230; haven&#8217;t checked though). these date and time things scare me.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>umm&#8230;.. int Field_timestamp::store(double nr) { int error= 0; if (nr &lt; 0 || nr &gt; 99991231235959.0) { set_datetime_warning(DRIZZLE_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE, nr, DRIZZLE_TIMESTAMP_DATETIME); nr= 0; \/\/ Avoid overflow on buff error= 1; } error|= Field_timestamp::store((int64_t) rint(nr), false); return error; } (likely the &hellip; <a href=\"https:\/\/www.flamingspork.com\/blog\/2009\/01\/08\/magic-number-super-fun-happy-time\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[75,14],"tags":[633,70,98],"class_list":["post-1338","post","type-post","status-publish","format-standard","hentry","category-drizzle-work-et-al","category-mysql","tag-code","tag-drizzle","tag-wtf"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5a6n8-lA","jetpack-related-posts":[{"id":1262,"url":"https:\/\/www.flamingspork.com\/blog\/2008\/11\/22\/drop-table-fail-on-the-road-to-removing-the-frm\/","url_meta":{"origin":1338,"position":0},"title":"drop table fail (on the road to removing the FRM)","author":"Stewart Smith","date":"2008-11-22","format":false,"excerpt":"So... in removing the FRM file in Drizzle, I found a bit of a nugget on how drop table works (currently in the MySQL server and now \"did\" in Drizzle). If you DROP TABLE t1; this is what happens open the .frm file read first 10bytes (oh, and if you\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2307,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/03\/01\/alter-table-rename-rename-rename\/","url_meta":{"origin":1338,"position":1},"title":"ALTER TABLE RENAME RENAME RENAME","author":"Stewart Smith","date":"2011-03-01","format":false,"excerpt":"Here's a nice challenge for you. What does the following do (or error out on?): CREATE TABLE t1 (a int); CREATE TABLE t2 (b int); ALTER TABLE t1 RENAME t3, RENAME t2, RENAME t4; I'd be interested to know what a) you think it does and then b) if you\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2253,"url":"https:\/\/www.flamingspork.com\/blog\/2011\/01\/05\/is-your-storage-engine-buggy-or-the-database-server\/","url_meta":{"origin":1338,"position":2},"title":"Is your Storage Engine buggy or the database server?","author":"Stewart Smith","date":"2011-01-05","format":false,"excerpt":"If your storage engine returns an error from rnd_init (or doStartTableScan as it's named in Drizzle) and does not save this error and return it in any subsequent calls to rnd_next, your engine is buggy. Namely it is buggy in that a) an error may not be reported back to\u2026","rel":"","context":"In &quot;code&quot;","block_context":{"text":"code","link":"https:\/\/www.flamingspork.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2041,"url":"https:\/\/www.flamingspork.com\/blog\/2010\/06\/29\/enum-now-works-properly-in-drizzle\/","url_meta":{"origin":1338,"position":3},"title":"ENUM now works properly (in Drizzle)","author":"Stewart Smith","date":"2010-06-29","format":false,"excerpt":"Over at the Drizzle blog, the recent 2010-06-07 tarball was announced. This tarball release has my fixes for the ENUM type, so that it now works as it should. I was quite amazed that such a small block of code could have so many bugs! One of the most interesting\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":661,"url":"https:\/\/www.flamingspork.com\/blog\/2006\/04\/19\/postgresql-73-sql-key-words\/","url_meta":{"origin":1338,"position":4},"title":"PostgreSQL 7.3: SQL Key Words","author":"Stewart Smith","date":"2006-04-19","format":false,"excerpt":"PostgreSQL: Documentation: Manuals: PostgreSQL 7.3: SQL Key Words It's very annoying that 'user' is a reserved word in postgresql. You also get really crappy error messages (at least with the various forms of quoting I've tried to use) when you try to create a table called 'user' $ psql web\u2026","rel":"","context":"In &quot;mysql&quot;","block_context":{"text":"mysql","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/mysql\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2907,"url":"https:\/\/www.flamingspork.com\/blog\/2012\/05\/25\/there-is-a-story\/","url_meta":{"origin":1338,"position":5},"title":"There is a story&#8230;.","author":"Stewart Smith","date":"2012-05-25","format":false,"excerpt":"I have a friend who is fond of telling a story from way back in November 2008 at the OpenSQL camp in Charlottesville, Virgina. This was relatively shortly after we had announced to the public that we'd started something called Drizzle\u00c2\u00a0(we did that at OSCON) and was even closer to\u2026","rel":"","context":"In &quot;drizzle&quot;","block_context":{"text":"drizzle","link":"https:\/\/www.flamingspork.com\/blog\/category\/work-et-al\/drizzle-work-et-al\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/comments?post=1338"}],"version-history":[{"count":3,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1338\/revisions"}],"predecessor-version":[{"id":1340,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/posts\/1338\/revisions\/1340"}],"wp:attachment":[{"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/media?parent=1338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/categories?post=1338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.flamingspork.com\/blog\/wp-json\/wp\/v2\/tags?post=1338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}