title: When I calling method, query returning undefined
body: <p>node-mysql <code>query</code> returning <code>undefined</code>.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>Hash.prototype.GetHash = function()
      {
          var test;
          var connection = this.config.CreateConnection();
          connection.connect(function(err){
             if (err)
                 throw err;
             else
             {
                 var query = "SELECT hash FROM test WHERE id = 1";
                 connection.query(query, function(err, rows, result){
                    if (err)
                        throw err;
                    else
                    {
                        test = rows[0].hash;
                        console.log(test);
                    }
                 });
                 connection.end(function(err){
                     if (err)
                         throw err;
                 });
             }
          });
          return test;
      }
  </code></pre>
  
  <p>console.log will give me right result <code>1a2b3c4d</code>.
  So. When I call this method to main method:</p>
  
  <pre><code>    var h = hash.GetHash();
      console.log(h);
  </code></pre>
  
  <p>Console give me result <code>undefined</code>.</p>
  
  <p>So I tried to cast, retype, create a new object from string class:
   this object <code>test</code>
  like:</p>
  
  <pre><code>var test = '';
  var test = new String;
  var test = new String(rows[0].hash);
  </code></pre>
  
  <p>And without succes :\
  Can anyone help me with this problem? Thanks a lot guys!</p>