title: Read MySQL result set with multiple columns and spaces
body: <p>Pretend I have a MySQL table <code>test</code> that looks like:</p>
  
  <pre><code>+----+---------------------+
  | id |     value           |
  +----+---------------------+
  | 1  | Hello World         |
  | 2  | Foo Bar             |
  | 3  | Goodbye Cruel World |
  +----+---------------------+
  </code></pre>
  
  <p>And I execute the query <code>SELECT id, value FROM test</code>.
  How would I assign each column to a variable in Bash using <code>read</code>?</p>
  
  <p><code>read -a</code> truncates everything after the first space in <code>value</code>:</p>
  
  <pre><code>mysql -D "jimmy" -NBe "SELECT id, value FROM test" | while read -a row;
  do
      id="${row[0]}"
      value="${row[1]}"
  
      echo "$id : $value"
  done;
  </code></pre>
  
  <p>and output looks like:</p>
  
  <pre><code>1 : Hello
  2 : Foo
  3 : Goodbye
  </code></pre>
  
  <p>but I need it to look like:</p>
  
  <pre><code>1 : Hello World
  2 : Foo Bar
  3 : Goodbye Cruel World
  </code></pre>
  
  <p>I'm aware there are args I could pass to MySQL to format the results in table format, but I need to parse each value in each row. This is just a simplified example of my problem. </p>