~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzledump.cc

  • Committer: Andrew Hutchings
  • Date: 2011-03-04 23:41:25 UTC
  • mto: (2220.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2221.
  • Revision ID: andrew@linuxjedi.co.uk-20110304234125-18hd11mrgsyz07lk
If drizzledump is run with --single-transaction it will now try and probe the sys_replication_log table.  If successful it will output something like:

-- SYS_REPLICATION_LOG: COMMIT_ID = 3, ID = 1301

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
  {