{"id":793,"date":"2009-04-28T09:02:37","date_gmt":"2009-04-28T07:02:37","guid":{"rendered":"http:\/\/code.openark.org\/blog\/?p=793"},"modified":"2009-04-28T10:57:21","modified_gmt":"2009-04-28T08:57:21","slug":"variables-ambiguities-in-names-and-values","status":"publish","type":"post","link":"https:\/\/code.openark.org\/blog\/mysql\/variables-ambiguities-in-names-and-values","title":{"rendered":"Variables ambiguities in names and values"},"content":{"rendered":"<p>Writing up some scripts, I see more and more ambiguities with regard to global variables.<\/p>\n<p>For one thing, the <em>names<\/em> ambiguity between the hyphen (&#8216;-&#8216;) and the underscore (&#8216;_&#8217;). So <strong>wait_timeout<\/strong> and <strong>wait-timeout<\/strong> are the same variable.<\/p>\n<p>But just check out the many levels of inconsistency:<\/p>\n<ul>\n<li>Command line arguments (e.g. run <strong>mysqld<\/strong> with option variables) use the hyphen convention<\/li>\n<li><strong>mysql &#8211;verbose &#8211;help<\/strong> shows the hyphen convention<\/li>\n<li><strong>SHOW GLOBAL VARIABLES<\/strong> uses the underscore convention<\/li>\n<li>The MySQL supplied sample configuration files use both conventions interchangeably<\/li>\n<\/ul>\n<p>Enough? Not quite: there are ambiguities in <em>values<\/em>, as well. For example, you may set <strong>query_cache_type<\/strong> to <strong>1<\/strong> or <strong>ON<\/strong>. These are equivalent. That&#8217;s very friendly. However:<!--more--><\/p>\n<ul>\n<li><strong>mysql &#8211;verbose &#8211;help<\/strong> will show &#8220;<strong>query_cache_type 1<\/strong>&#8220;<\/li>\n<li><strong>SHOW GLOBAL VARIABLES<\/strong> will show &#8220;<strong>query_cache_type ON<\/strong>&#8220;<\/li>\n<\/ul>\n<p>We also have:<\/p>\n<ul>\n<li> <strong>1<\/strong> &lt;==&gt; <strong>YES<\/strong><\/li>\n<li><strong>OFF<\/strong> &lt;==&gt; <strong>FALSE<\/strong><\/li>\n<li><strong>ON<\/strong> &lt;==&gt; <strong>TRUE<\/strong><\/li>\n<\/ul>\n<p>Time to decide. Ambiguities are evil. They make for a difficult parsing\/analysis\/comparison\/validation work. Will anyone pick the glove?<\/p>\n<p>PS &#8211; Drizzle falk &#8211; isn&#8217;t this the kind of stuff you&#8217;re happy to drop?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Writing up some scripts, I see more and more ambiguities with regard to global variables. For one thing, the names ambiguity between the hyphen (&#8216;-&#8216;) and the underscore (&#8216;_&#8217;). So wait_timeout and wait-timeout are the same variable. But just check out the many levels of inconsistency: Command line arguments (e.g. run mysqld with option variables) [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_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,"enabled":false},"version":2}},"categories":[5],"tags":[11],"class_list":["post-793","post","type-post","status-publish","format-standard","hentry","category-mysql","tag-configuration"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2bZZp-cN","_links":{"self":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/793","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/comments?post=793"}],"version-history":[{"count":6,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/793\/revisions"}],"predecessor-version":[{"id":803,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/793\/revisions\/803"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/media?parent=793"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/categories?post=793"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/tags?post=793"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}