Index: trunk/skirmish/ora.cc |
— | — | @@ -152,7 +152,7 @@ |
153 | 153 | if (!ora_success(OCIAttrGet(p, OCI_DTYPE_PARAM, &colname, &namelen, OCI_ATTR_NAME, conn->err))) |
154 | 154 | throw db::error(conn->error()); |
155 | 155 | |
156 | | - fields[i].name = colname; |
| 156 | + fields[i].name.assign(colname, colname + namelen); |
157 | 157 | |
158 | 158 | ub2 width; |
159 | 159 | if (!ora_success(OCIAttrGet(p, OCI_DTYPE_PARAM, &width, 0, OCI_ATTR_DATA_SIZE, conn->err))) |
— | — | @@ -160,9 +160,9 @@ |
161 | 161 | |
162 | 162 | fields[i].width = width; |
163 | 163 | |
164 | | - fields[i].data.resize(width); |
| 164 | + fields[i].data.resize(width + 1); |
165 | 165 | ub2 rcode, len; |
166 | | - if (!ora_success(OCIDefineByPos(stmt, &fields[i].define, conn->err, i + 1, &fields[i].data[0], width, |
| 166 | + if (!ora_success(OCIDefineByPos(stmt, &fields[i].define, conn->err, i + 1, &fields[i].data[0], width + 1, |
167 | 167 | SQLT_STR, &fields[i].isnull, &len, &rcode, OCI_DEFAULT))) |
168 | 168 | throw db::error(conn->error()); |
169 | 169 | } |
— | — | @@ -180,6 +180,7 @@ |
181 | 181 | |
182 | 182 | result::~result() |
183 | 183 | { |
| 184 | + OCIHandleFree(stmt, OCI_HTYPE_STMT); |
184 | 185 | } |
185 | 186 | |
186 | 187 | bool |
Index: trunk/skirmish/Makefile |
— | — | @@ -9,8 +9,7 @@ |
10 | 10 | |
11 | 11 | OBJS = $(SRCS:.cc=.o) |
12 | 12 | |
13 | | -all: |
14 | | - $(MAKE) skirmish |
| 13 | +all: skirmish |
15 | 14 | |
16 | 15 | skirmish: $(OBJS) |
17 | 16 | $(CXX) $(CXXFLAGS) $(LDFLAGS) $(OBJS) -o $@ $(LIBS) |