From a28ef45f55b57c7fcb39e29f771adbbbeb79bc28 Mon Sep 17 00:00:00 2001 From: kishoramballi Date: Fri, 9 Oct 2009 14:35:37 +0000 Subject: [PATCH] Performance fixes. --- src/sql/SelStatement.cxx | 5 +++-- src/storage/FieldList.cxx | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sql/SelStatement.cxx b/src/sql/SelStatement.cxx index cb20ab4e..6c2ab9d9 100644 --- a/src/sql/SelStatement.cxx +++ b/src/sql/SelStatement.cxx @@ -391,7 +391,6 @@ DbRetVal SelStatement::resolve() } FieldValue *newVal = new FieldValue(); strcpy(newVal->fldName,name->fldName); - strcpy(newVal->defValBuf, fInfo->defaultValueBuf); newVal->parsedString = NULL; newVal->paramNo = 0; newVal->aType = name->aType; @@ -401,7 +400,9 @@ DbRetVal SelStatement::resolve() newVal->isUnique = fInfo->isUnique; newVal->isAutoIncrement = fInfo->isAutoIncrement; newVal->isDefault = fInfo->isDefault; - + if (newVal->isDefault) + strcpy(newVal->defValBuf, fInfo->defaultValueBuf); + else newVal->defValBuf[0] ='\0'; if (name->aType == AGG_COUNT) { newVal->type = typeInt; newVal->length = sizeof(int); diff --git a/src/storage/FieldList.cxx b/src/storage/FieldList.cxx index 6923106a..d0196f16 100644 --- a/src/storage/FieldList.cxx +++ b/src/storage/FieldList.cxx @@ -155,7 +155,8 @@ DbRetVal FieldList::getFieldInfo(const char *fldName, FieldInfo *&info) info->type = iter->fldDef.type_; info->offset = iter->fldDef.offset_; info->isDefault = iter->fldDef.isDefault_; - strcpy(info->defaultValueBuf, iter->fldDef.defaultValueBuf_); + if (info->isDefault) + strcpy(info->defaultValueBuf, iter->fldDef.defaultValueBuf_); info->isNull = iter->fldDef.isNull_; info->isPrimary = iter->fldDef.isPrimary_; info->isUnique = iter->fldDef.isUnique_; -- 2.11.4.GIT