Пример #1
0
bool
DbUtil::selectDb()
{
  if ((getDbName()) != NULL)
  {
    if(mysql_select_db(m_mysql, this->getDbName()))
    {
      //printError("mysql_select_db failed");
      return false;
    }
    return true;   
  }
  printError("getDbName() == NULL");
  return false;
}
Пример #2
0
int
DbUtil::selectDb()
{
  if ((getDbName()) != NULL)
  {
    if(mysql_select_db(m_mysql, this->getDbName()))
    {
      printError("mysql_select_db failed");
      return DBU_FAILED;
    }
    return DBU_OK;   
  }
  printError("getDbName() == NULL");
  return DBU_FAILED;
}
Пример #3
0
static void
dumpCTRecord(ChangeTrackingRecord *record)
{
	
	printf("(%04d/%04d): ", recs_read, recs_in_page);

	getSpaceName(record->relFileNode.spcNode);
	getDbName(record->relFileNode.dbNode);
	getRelName(record->relFileNode.relNode);

	printf("space %8s, db %8s, tblname %8s, ", spaceName, dbName, relName);
	printf("xlogloc [%X/%X] ", record->xlogLocation.xlogid, record->xlogLocation.xrecoff);	
	printf("block number %4d ", record->bufferPoolBlockNum);
	printf("persistent tid %s ", ItemPointerToStringX(&record->persistentTid));
	printf("persistent sn " INT64_FORMAT, record->persistentSerialNum);
	printf("\n");
}
Пример #4
0
static void
print_backup_blocks(XLogRecPtr cur, XLogRecord *rec)
{
	char *blk;
	int i;
	char buf[1024];

	/*
	 * backup blocks by full_page_write
	 */
	blk = (char*)XLogRecGetData(rec) + rec->xl_len;
	for (i = 0; i < XLR_MAX_BKP_BLOCKS; i++)
	{
		BkpBlock  bkb;

		if (!(rec->xl_info & (XLR_SET_BKP_BLOCK(i))))
			continue;
		memcpy(&bkb, blk, sizeof(BkpBlock));
		getSpaceName(bkb.node.spcNode, spaceName, sizeof(spaceName));
		getDbName(bkb.node.dbNode, dbName, sizeof(dbName));
		getRelName(bkb.node.relNode, relName, sizeof(relName));
		snprintf(buf, sizeof(buf), "bkpblock[%d]: s/d/r:%s/%s/%s blk:%u hole_off/len:%u/%u\n", 
				i+1, spaceName, dbName, relName,
				bkb.block, bkb.hole_offset, bkb.hole_length);
		blk += sizeof(BkpBlock) + (BLCKSZ - bkb.hole_length);

		if (!enable_stats)
			printf("[cur:%u/%X, xid:%d, rmid:%d(%s), len:%d/%d, prev:%u/%X] %s",
			       cur.xlogid, cur.xrecoff,
			       rec->xl_xid,
			       rec->xl_rmid,
			       RM_names[rec->xl_rmid],
			       rec->xl_len, rec->xl_tot_len,
			       rec->xl_prev.xlogid, rec->xl_prev.xrecoff, 
			       buf);

		xlogstats.bkpblock_count++;
		xlogstats.bkpblock_len += (BLCKSZ - bkb.hole_length);
	}
}
Пример #5
0
static void
print_backup_blocks(XLogRecPtr cur, XLogRecord *rec)
{
	char *blk;
	int i;
	char buf[1024];

	/*
	 * backup blocks by full_page_write
	 */
	blk = (char*)XLogRecGetData(rec) + rec->xl_len;
	for (i = 0; i < XLR_MAX_BKP_BLOCKS; i++)
	{
		BkpBlock  bkb;

		if (!(rec->xl_info & (XLR_SET_BKP_BLOCK(i))))
			continue;
		memcpy(&bkb, blk, sizeof(BkpBlock));
		getSpaceName(bkb.node.spcNode, spaceName, sizeof(spaceName));
		getDbName(bkb.node.dbNode, dbName, sizeof(dbName));
		getRelName(bkb.node.relNode, relName, sizeof(relName));
		snprintf(buf, sizeof(buf), "bkpblock[%d]: s/d/r:%s/%s/%s blk:%u hole_off/len:%u/%u\n", 
				i+1, spaceName, dbName, relName,
				bkb.block, bkb.hole_offset, bkb.hole_length);
		blk += sizeof(BkpBlock) + (BLCKSZ - bkb.hole_length);

		if (!enable_stats)
		{
			PRINT_XLOGRECORD_HEADER(cur, rec);
			printf("%s", buf);
		}

		xlogstats.bkpblock_count++;
		xlogstats.bkpblock_len += (BLCKSZ - bkb.hole_length);
	}
}
Пример #6
0
/** Sets the loaded values to the given server configuration
  *
  * The given ServerConfiguration pointer \b must be valid.
  *
  * \param sc The ServerConfiguration structure pointer
  *
  * \return \c true if the operation successed
  *
  */
bool RainbruRPG::Server::xmlServerConf::load(ServerConfiguration* sc){
  LOGI("Getting saved server configuration :");

  LOGCATS("  name : '");
  LOGCATS( getServerName() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  desc : '");
  LOGCATS( getServerDesc() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  technote : '");
  LOGCATS( getTechNote() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Playmode : '");
  LOGCATB( getPlayMode() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Editmode : '");
  LOGCATB( getEditMode() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Floodmode : '");
  LOGCATB( getFloodMode() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Port : '");
  LOGCATI( getPort() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  MaxClient : '");
  LOGCATI( getMaxClient() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  Type : '");
  LOGCATI( getType());
  LOGCATS("'");
  LOGCAT();

  // Database debug
  LOGCATS("  dbHostName : '");
  LOGCATS( getDbHostName().c_str() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS("  DbName : '");
  LOGCATS( getDbName().c_str() );
  LOGCATS("'");
  LOGCAT();

  LOGCATS(" DbUserName  : '******'");
  LOGCAT();

  LOGCATS(" DbUserPwd  : '");
  LOGCATS( getDbUserPwd().c_str() );
  LOGCATS("'");
  LOGCAT();

  sc->setName(getServerName());
  sc->setDesc(getServerDesc());
  sc->setType(getType());
  sc->setTechNote(getTechNote());
  sc->setPlayMode(getPlayMode());
  sc->setEditMode(getEditMode());
  sc->setFloodMode(getFloodMode());
  sc->setPort(getPort());
  sc->setFtpPort(getFtpPort());
  sc->setMaxClient(getMaxClient());
  sc->setIpAdress(getIpAdress());
  //database values
  sc->setHostName(getDbHostName().c_str());
  sc->setDatabaseName(getDbName().c_str());
  sc->setUserName(getDbUserName().c_str());
  sc->setPassword(getDbUserPwd().c_str());
}