Repository: incubator-trafodion Updated Branches: refs/heads/master 5d7f41f0e -> 3a35dbee0
fix TRAFODION-2797 Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/f878f5e7 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/f878f5e7 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/f878f5e7 Branch: refs/heads/master Commit: f878f5e7a92ed0f5246bd6c890cbf4b622db52fb Parents: bf2ad71 Author: SuJinpei <873118...@qq.com> Authored: Tue Nov 7 08:57:48 2017 +0800 Committer: SuJinpei <873118...@qq.com> Committed: Tue Nov 7 08:57:48 2017 +0800 ---------------------------------------------------------------------- core/conn/odb/src/odb.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/f878f5e7/core/conn/odb/src/odb.c ---------------------------------------------------------------------- diff --git a/core/conn/odb/src/odb.c b/core/conn/odb/src/odb.c index 9d25ff8..8e2115d 100755 --- a/core/conn/odb/src/odb.c +++ b/core/conn/odb/src/odb.c @@ -8426,31 +8426,31 @@ static void Oload2(int eid) len-- ; } bc = buff ; /* Initialize current field position */ - size_t i = 0; - while (i < len) { + size_t currentFiledPos = 0; + while (currentFiledPos < len) { ifl = 0; - for (; i < len; ++i) { - if ((fg & 0001) && (fg & 0100) && (bc[i] == lfs || bc[i] == lrs)) { /* treat string qualifier before as end quote */ + for (; currentFiledPos < len; ++currentFiledPos) { + if ((fg & 0001) && (fg & 0100) && (bc[currentFiledPos] == lfs || bc[currentFiledPos] == lrs)) { /* treat string qualifier before as end quote */ fg &= ~0101; } - if (bc[i] == lfs && !(fg & 0001)) { /* if field sep... */ + if (bc[currentFiledPos] == lfs && !(fg & 0001)) { /* if field sep... */ fg |= 0020; /* set field complete flag on */ - ++i; + ++currentFiledPos; break; } - else if (bc[i] == lrs && !(fg & 0001)) { /* if record sep... */ + else if (bc[currentFiledPos] == lrs && !(fg & 0001)) { /* if record sep... */ fg |= 0040; /* set record complete flag on */ - ++i; + ++currentFiledPos; break; } - else if ((bc[i] == lsq) && (fg & 0001) && !(fg & 0100)) { /* if string qualifier char and in string qualifier */ + else if ((bc[currentFiledPos] == lsq) && (fg & 0001) && !(fg & 0100)) { /* if string qualifier char and in string qualifier */ fg |= 0100; } - else if ((bc[i] == lsq) && !(fg & 0100)) { + else if ((bc[currentFiledPos] == lsq) && !(fg & 0100)) { fg ^= 0001; /* flip quoted string flag */ } else { /* add new character to field buffer */ - str[ifl++] = bc[i]; + str[ifl++] = bc[currentFiledPos]; fg &= ~0100; /* set escape flag off */ } }