title: Query return NULL when using STR_TO_DATE
body: <p>i have two questions, using below query:</p>
  
  <ol>
  <li>this query is for select list purpose. I want to display period1 as the text while period2 as the option value. Is this a good practice? Any vulnerability where user can exploit the select list?</li>
  <li><p>Why the query return NULL for period2?</p>
  
  <pre><code>select distinct 
         STR_TO_DATE(period, '%Y-%m-%d') as period1,
         STR_TO_DATE(period, '%Y%m%d') as period2 
  from table
  </code></pre></li>
  </ol>