title: std::string crashing while iterating on mySQL connector query results
body: <p>I'm trying to get a std::string from my database using mysql connexion</p>
  
  <p>Here is the simple code:</p>
  
  <pre><code>sql::Statement *stmt = con-&gt;createStatement();
  sql::ResultSet  *res = stmt-&gt;executeQuery("SELECT * FROM test.new_table");
  while (res-&gt;next()) {  
      std::string somestring = res-&gt;getString("idnew_table");
  } //crashes here
  
  delete res;
  delete stmt;
  </code></pre>
  
  <p>So, the executeQuery is fine, I enter the loop, and if I break, the expected results are in somestring. After the somestring declaration, I step foward to the end of the loop, and it crashes before the next iteration!</p>
  
  <p>Here is the call stack:</p>
  
  <pre><code>&gt;   msvcp100d.dll!std::_Lockit::_Lockit(int kind)  Line 64 + 0x14 bytes C++
      msvcp100d.dll!std::_Container_base12::_Orphan_all()  Line 200   C++
      CM.dll!std::_String_val&lt;char,std::allocator&lt;char&gt; &gt;::~_String_val&lt;char,std::allocator&lt;char&gt; &gt;()  Line 478 + 0xb bytes   C++
      CM.dll!std::basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;::~basic_string&lt;char,std::char_traits&lt;char&gt;,std::allocator&lt;char&gt; &gt;()  Line 755 + 0xf bytes   C++
      CM.dll!DAL::GetInfo()  Line 45 + 0xc bytes  C++
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>First-chance exception at 0x1038ad4a (msvcp100d.dll) in CMLauncher.exe: 0xC0000005: Access violation reading location 0xccccccd0.
  Unhandled exception at 0x76f615de in CMLauncher.exe: 0xC0000005: Access violation reading location 0xccccccd0.
  First-chance exception at 0x76f5016e in CMLauncher.exe: 0x00000000: The operation completed successfully.
  Unhandled exception at 0x76f615de in CMLauncher.exe: 0x00000000: The operation completed successfully.
  </code></pre>
  
  <p>So it looks like I have some uninitialized memory somewhere in the C++ runtime lib...
  It look like it's crashing in the std::string destructor, which kind of makes sense because it crashes when the scope of the string is done...</p>
  
  <p>My best guess is that libmysql is using an older version of the C++ runtime (say msvcp90d.dll) and that it's clashing with the new one... does that even make sense?</p>
  
  <p>I'm under windows 7, using mySQL Server 5.5, VS2010 Pro. all in 32bits. thx! I'll be happy to post any mroe information that is needed.</p>
  
  <p>Edit: Before anyone else reads DumbCoders comment: 
  <a href="http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html" rel="nofollow">MySQL Connector example</a>
  The documentation specifies that both the statement and the resultSet have to be deleted.</p>