~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Lee Bieber
  • Date: 2011-03-05 19:28:49 UTC
  • mfrom: (2220.1.2 build)
  • Revision ID: kalebral@gmail.com-20110305192849-y9qiehdsit5jtl9j
Merge Andrew - 729425: mysql-unix-socket-protocol plugin needs documenting      
Merge Andrew - 729340: Need drizzledump to output InnoDB replication log information for slave provisioning

Show diffs side-by-side

added added

removed removed

Lines of Context:
247
247
      cout << " (Drizzle server)";
248
248
    cout << endl << endl;
249
249
  }
 
250
 
250
251
} /* write_header */
251
252
 
252
253
 
430
431
  return 0;
431
432
}
432
433
 
433
 
static int do_unlock_tables()
434
 
{
435
 
  db_connection->queryNoResult("UNLOCK TABLES");
436
 
  return 0;
437
 
}
438
 
 
439
434
static int start_transaction()
440
435
{
441
436
  db_connection->queryNoResult("SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ");
442
437
  db_connection->queryNoResult("START TRANSACTION WITH CONSISTENT SNAPSHOT");
 
438
 
 
439
  if (db_connection->getServerType() == ServerDetect::SERVER_DRIZZLE_FOUND)
 
440
  {
 
441
    drizzle_result_st *result;
 
442
    drizzle_row_t row;
 
443
    std::string query("SELECT COMMIT_ID, ID FROM DATA_DICTIONARY.SYS_REPLICATION_LOG WHERE COMMIT_ID=(SELECT MAX(COMMIT_ID) FROM DATA_DICTIONARY.SYS_REPLICATION_LOG)");
 
444
    result= db_connection->query(query);
 
445
    if ((row= drizzle_row_next(result)))
 
446
    {
 
447
      cout << "-- SYS_REPLICATION_LOG: COMMIT_ID = " << row[0] << ", ID = " << row[1] << endl << endl;
 
448
    }
 
449
    db_connection->freeResult(result);
 
450
  }
 
451
 
443
452
  return 0;
444
453
}
445
454
 
771
780
    goto err;
772
781
  if (opt_lock_all_tables)
773
782
    db_connection->queryNoResult("FLUSH LOGS");
774
 
  if (opt_single_transaction && do_unlock_tables()) /* unlock but no commit! */
775
 
    goto err;
776
783
 
777
784
  if (opt_alldbs)
778
785
  {