From 6cdf33c8bcee0a79078e46f72e30dc4bfcc6b16a Mon Sep 17 00:00:00 2001 From: prabatuty Date: Sun, 4 Apr 2010 06:54:27 +0000 Subject: [PATCH] improve code readability --- src/cache/CacheTableLoader.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cache/CacheTableLoader.cxx b/src/cache/CacheTableLoader.cxx index 2b9a5010..37c6aab7 100644 --- a/src/cache/CacheTableLoader.cxx +++ b/src/cache/CacheTableLoader.cxx @@ -400,14 +400,14 @@ DbRetVal CacheTableLoader::load(AbsSqlConnection *conn, AbsSqlStatement *stmt, b ptr += strlen(ptr); if (colType == SQL_CHAR || colType == SQL_VARCHAR || colType == SQL_BINARY) { sprintf(ptr, "(%d) NOT NULL",colLength+1); - } else { sprintf(ptr, " NOT NULL",colLength); } + } else { sprintf(ptr, " NOT NULL"); } ptr += strlen(ptr); } else { sprintf(ptr, ", %s %s", colName, AllDataType::getSQLString(AllDataType::convertFromSQLType(colType,colLength,scale,tdbName))); ptr += strlen(ptr); if (colType == SQL_CHAR || colType == SQL_VARCHAR || colType == SQL_BINARY) { sprintf(ptr, "(%d) NOT NULL",colLength+1); - } else { sprintf(ptr, " NOT NULL",colLength); } + } else { sprintf(ptr, " NOT NULL"); } ptr += strlen(ptr); } //tabDef.addField((char*)colName, AllDataType::convertFromSQLType(colType,colLength,scale,tdbName), colLength+1, NULL, true); @@ -421,14 +421,14 @@ DbRetVal CacheTableLoader::load(AbsSqlConnection *conn, AbsSqlStatement *stmt, b ptr += strlen(ptr); if (colType == SQL_CHAR || colType == SQL_VARCHAR || colType == SQL_BINARY) { sprintf(ptr, "(%d) NOT NULL",colLength+1); - } else { sprintf(ptr, " NOT NULL",colLength); } + } else { sprintf(ptr, " NOT NULL"); } ptr += strlen(ptr); } else { sprintf(ptr, ", %s %s", colName, AllDataType::getSQLString(AllDataType::convertFromSQLType(colType,colLength, scale, tdbName))); ptr += strlen(ptr); if (colType == SQL_CHAR || colType == SQL_VARCHAR || colType == SQL_BINARY) { sprintf(ptr, "(%d) NOT NULL",colLength+1); - } else { sprintf(ptr, " NOT NULL",colLength); } + } else { sprintf(ptr, " NOT NULL"); } ptr += strlen(ptr); } //tabDef.addField((char*)colName, AllDataType::convertFromSQLType(colType,colLength,scale, tdbName), colLength +1, NULL, true); -- 2.11.4.GIT