From c7c8f3121d1628d9685a3b7354da9c7cc4d741cc Mon Sep 17 00:00:00 2001 From: prabatuty Date: Tue, 3 Nov 2009 09:22:04 +0000 Subject: [PATCH] changing old cachetable.conf file to csqltable.conf in error messages --- src/cache/CacheTableLoader.cxx | 4 ++-- src/storage/TableConfig.cxx | 8 ++++---- src/tools/cacheverify.cxx | 30 +++++++++++++++--------------- src/tools/csqlcacheserver.cxx | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/cache/CacheTableLoader.cxx b/src/cache/CacheTableLoader.cxx index 1ae20e69..baa3d4ff 100644 --- a/src/cache/CacheTableLoader.cxx +++ b/src/cache/CacheTableLoader.cxx @@ -773,7 +773,7 @@ DbRetVal CacheTableLoader::reload() //get table cache senarios fp = fopen(Conf::config.getTableConfigFile(),"r"); if( fp == NULL ) { - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); return OK; } int mode; @@ -890,7 +890,7 @@ DbRetVal CacheTableLoader::recoverAllCachedTables() fp = fopen(Conf::config.getTableConfigFile(),"r"); if( fp == NULL ) { - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); conn.close(); return OK; } diff --git a/src/storage/TableConfig.cxx b/src/storage/TableConfig.cxx index 9a5852fd..a944feeb 100644 --- a/src/storage/TableConfig.cxx +++ b/src/storage/TableConfig.cxx @@ -267,7 +267,7 @@ DbRetVal TableConfig :: isTablePresent() fp = fopen(Conf :: config.getTableConfigFile(),"r"); if(fp == NULL) { - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); return OK; } conn.close(); @@ -333,7 +333,7 @@ unsigned int TableConfig::getTableMode(char *tabname) FILE *fp; fp = fopen(Conf::config.getTableConfigFile(),"r"); if( fp == NULL ) { - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); fclose(fp); return 0; } @@ -383,7 +383,7 @@ DbRetVal TableConfig::CacheInfo(bool isTabPresent) FILE *fp; fp = fopen(Conf::config.getTableConfigFile(),"r"); if( fp == NULL ) { - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); fclose(fp); return OK; } @@ -476,7 +476,7 @@ DbRetVal TableConfig::getDsnForTable(char *tab, char *dsnname) FILE *fp; fp = fopen(Conf::config.getTableConfigFile(),"r"); if( fp == NULL){ - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); fclose(fp); return ErrOS; } diff --git a/src/tools/cacheverify.cxx b/src/tools/cacheverify.cxx index 222f694d..897f0ab7 100644 --- a/src/tools/cacheverify.cxx +++ b/src/tools/cacheverify.cxx @@ -111,7 +111,7 @@ DbRetVal verifyCount(const char *tblName, long numTuples) rv = adStmt->prepare(statement); if(rv != OK) { delete adStmt; delete adConn; - printf("Prepare failed\n"); + printError(rv, "Prepare failed"); return rv; } SqlOdbcConnection *adcon= (SqlOdbcConnection *)adConn; @@ -119,12 +119,12 @@ DbRetVal verifyCount(const char *tblName, long numTuples) rv = adStmt->execute(rows); if(rv != OK) { delete adStmt; delete adConn; - printf("Execute failed\n"); + printError(rv, "Execute failed"); return rv; } if (adStmt->fetch()== NULL) { delete adStmt; delete adConn; - printf("Fetch failed\n"); + printError(ErrSysInternal, "Fetch failed"); return ErrSysInternal; } adConn->commit(); @@ -157,7 +157,7 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) ostmt->getPrimaryKeyFieldName((char*)tblName, fieldName); if (fieldName[0] == '\0') { delete trgtDbStmt; delete trgtDbCon; - printf("Primary key does not exist on table %s\n", tblName); + printError(ErrSysInternal, "Primary key does not exist on table %s", tblName); return ErrNotExists; } printf("\nPrimary key field name is \'%s\'\n", fieldName); @@ -205,7 +205,7 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) if(rv != OK) { stmt->free(); delete trgtDbStmt; delete trgtDbCon; - printf("Execute failed\n"); + printError(ErrSysInternal, "Execute failed"); return rv; } rv = trgtDbCon->beginTrans(); @@ -239,7 +239,7 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) rv = trgtDbStmt->prepare(tdbstatement); if(rv != OK) { delete trgtDbStmt; delete trgtDbCon; - printf("Prepare failed\n"); + printError(rv, "Prepare failed"); return rv; } stmt->prepare(csqlstatement); @@ -248,7 +248,7 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) rv = trgtDbStmt->execute(rows); if(rv != OK) { delete trgtDbStmt; delete trgtDbCon; - printf("Execute failed\n"); + printError(rv, "Execute failed\n"); return rv; } conn->beginTrans(); @@ -369,7 +369,7 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) rv = trgtDbStmt->prepare(csqlstatement); if(rv != OK) { delete trgtDbStmt; delete trgtDbCon; - printf("Prepare failed\n"); + printError(rv, "Prepare failed"); return rv; } @@ -390,14 +390,14 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) if (NULL == fname) { delete trgtDbStmt; delete trgtDbCon; delete fldInfo; - printf("Should never happen. Field Name list has NULL\n"); + printError(ErrSysFatal, "Fatal:Field Name list has NULL"); return ErrSysFatal; } rv = sqlStmt->getFieldInfo(tblName, fname->name, fldInfo); if (ErrNotFound == rv) { delete trgtDbStmt; delete trgtDbCon; delete fldInfo; - printf("Field %s does not exist in table\n", fname->name); + printError(ErrSysInternal, "Field %s does not exist in table", fname->name); return ErrSyntaxError; } FldVal *cfldVal = new FldVal(); @@ -435,7 +435,7 @@ DbRetVal verifyMismatchingRecords(const char *tblName, int option) rv = trgtDbStmt->execute(rows); if(rv != OK) { delete trgtDbStmt; delete trgtDbCon; - printf("Execute failed\n"); + printError(rv, "Execute failed"); return rv; } if (stmt->fetch() != NULL && trgtDbStmt->fetch() != NULL) { @@ -646,7 +646,7 @@ int main(int argc, char **argv) } if (!tableNameSpecified) { - printf("Table name is not specified. Check usage with ?\n"); + printError(ErrSysInternal, "Table name is not specified. Check usage with ?"); return 1; } @@ -660,7 +660,7 @@ int main(int argc, char **argv) conn = SqlFactory::createConnection(CSqlDirect); DbRetVal rv = conn->connect(username, password); if (rv != OK) { - printf("Authentication failed\n"); + printError(rv, "Authentication failed"); delete conn; return 1; } @@ -681,7 +681,7 @@ int main(int argc, char **argv) if( fp == NULL ) { conn->disconnect(); delete stmt; delete conn; - printf("cachetable.conf file does not exist\n"); + printError(ErrSysInternal, "csqltable.conf file does not exist"); return 2; } char tablename[IDENTIFIER_LENGTH]; @@ -731,7 +731,7 @@ int main(int argc, char **argv) if (isCached == false) { conn->disconnect(); - printf("The table \'%s\' is not cached\n", tableName); + printError(ErrSysInternal, "The table \'%s\' is not cached", tableName); delete stmt; delete conn; return 5; } diff --git a/src/tools/csqlcacheserver.cxx b/src/tools/csqlcacheserver.cxx index 07c569ad..acc19769 100644 --- a/src/tools/csqlcacheserver.cxx +++ b/src/tools/csqlcacheserver.cxx @@ -528,7 +528,7 @@ void createCacheTableList() FILE *fp; fp = fopen(Conf::config.getTableConfigFile(),"r"); if( fp == NULL ) { - printError(ErrSysInit, "cachetable.conf file does not exist"); + printError(ErrSysInit, "csqltable.conf file does not exist"); fclose(fp); } char tablename[IDENTIFIER_LENGTH]; -- 2.11.4.GIT