~mysql/mysql-connector-cpp/trunk

« back to all changes in this revision

Viewing changes to test/unit/classes/connectionmetadata.cpp

  • Committer: Hemant Dangi
  • Date: 2014-12-17 16:28:39 UTC
  • Revision ID: hemant.dangi@oracle.com-20141217162839-sdbpj3fcwn5gxjxh
Bug #75251: Add C++11 support and replace (deprecated in C++11) auto_ptr

Show diffs side-by-side

added added

removed removed

Lines of Context:
557
557
void connectionmetadata::getConnection()
558
558
{
559
559
  logMsg("connectionmetadata::getConnection() - MySQL_ConnectionMetaData::getConnection");
560
 
  Connection same_con;
 
560
  sql::Connection *same_con;
561
561
  try
562
562
  {
563
563
    stmt.reset(con->createStatement());
564
564
    stmt->execute("SET @this_is_my_connection_id=101");
565
565
    DatabaseMetaData * dbmeta=con->getMetaData();
566
 
    same_con.reset(dbmeta->getConnection());
 
566
    same_con= dbmeta->getConnection();
567
567
    stmt.reset(same_con->createStatement());
568
568
    res.reset(stmt->executeQuery("SELECT @this_is_my_connection_id AS _connection_id"));
569
569
    ASSERT(res->next());
570
570
    ASSERT_EQUALS(101, res->getInt("_connection_id"));
571
571
    ASSERT_EQUALS(res->getInt(1), res->getInt("_connection_id"));
572
 
    same_con.release(); // if the same don't clean it, it will be double free
573
572
  }
574
573
  catch (sql::SQLException &e)
575
574
  {