{"id":799,"date":"2009-04-30T06:32:09","date_gmt":"2009-04-30T04:32:09","guid":{"rendered":"http:\/\/code.openark.org\/blog\/?p=799"},"modified":"2009-05-13T10:04:34","modified_gmt":"2009-05-13T08:04:34","slug":"more-on-variables-ambiguities","status":"publish","type":"post","link":"https:\/\/code.openark.org\/blog\/mysql\/more-on-variables-ambiguities","title":{"rendered":"More on variables ambiguities"},"content":{"rendered":"<p>Continuing <a title=\"Link to Variables ambiguities in names and values\" rel=\"bookmark\" href=\"..\/mysql\/variables-ambiguities-in-names-and-values\">Variables ambiguities in names and values<\/a>, there are two more issues I wish to present.<\/p>\n<p>First, I&#8217;ve shown that variable values may be ambiguous. Thus, <strong>1<\/strong> and <strong>ON<\/strong> are interchangeable. But also <strong>1<\/strong> and <strong>YES<\/strong>.<\/p>\n<p>The important thing to note is that <em>it&#8217;s not always like that<\/em>. You can&#8217;t just swap <strong>1<\/strong> for <strong>ON<\/strong> or <strong>YES<\/strong> as you will: it depends on the variable. Thus, a specific variable (e.g. <strong>query_cache_type<\/strong>) may accept <strong>ON<\/strong> for <strong>1<\/strong> &#8211; but will not accept <strong>YES<\/strong>. Another may accept <strong>YES<\/strong> for <strong>1<\/strong> &#8211; bot not <strong>ON<\/strong>.<\/p>\n<p>Confused? Here&#8217;s the second issue. This one is really a bug, as I see it. Take a look at the following:<\/p>\n<blockquote>\n<pre>mysql&gt; SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table';\r\n+-----------------------+-------+\r\n| Variable_name         | Value |\r\n+-----------------------+-------+\r\n| innodb_file_per_table | ON    |\r\n+-----------------------+-------+<\/pre>\n<\/blockquote>\n<p>The <strong>ON<\/strong> value is actually <em>illegal<\/em>: if you try to set this value in your <strong>my.cnf<\/strong> file &#8211; you&#8217;ll get a non-file-per-table behavior. The real value you should be using in <strong>my.cnf<\/strong> is <strong>1<\/strong> (or no value at all).<\/p>\n<p>And so in this latter example, <strong>1<\/strong> equals <strong>ON<\/strong>, but only one of them is valid in the <strong>my.cnf<\/strong> file, and yet only the other one is being reported.<\/p>\n<p>The behavior is documented <a href=\"http:\/\/dev.mysql.com\/doc\/refman\/5.1\/en\/dynamic-system-variables.html\">here<\/a>. But, if, like myself, you find it undesired, please comment on <a href=\"http:\/\/bugs.mysql.com\/bug.php?id=44509\">bug #44509<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Continuing Variables ambiguities in names and values, there are two more issues I wish to present. First, I&#8217;ve shown that variable values may be ambiguous. Thus, 1 and ON are interchangeable. But also 1 and YES. The important thing to note is that it&#8217;s not always like that. You can&#8217;t just swap 1 for ON [&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-799","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-cT","_links":{"self":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/799","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=799"}],"version-history":[{"count":10,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/799\/revisions"}],"predecessor-version":[{"id":830,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/posts\/799\/revisions\/830"}],"wp:attachment":[{"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/media?parent=799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/categories?post=799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.openark.org\/blog\/wp-json\/wp\/v2\/tags?post=799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}