Merge branch 'master' of github.com:keplerproject/luasql

This commit is contained in:
Tomás Guisasola 2018-10-30 19:24:15 -03:00
commit ea0c91d534

View File

@ -189,8 +189,6 @@ static int alloc_column_buffer (lua_State *L, cur_data *cur, int i) {
cur->errhp), cur->errhp); cur->errhp), cur->errhp);
switch (col->type) { switch (col->type) {
case SQLT_CHR:
case SQLT_STR:
case SQLT_VCS: case SQLT_VCS:
case SQLT_AFC: case SQLT_AFC:
case SQLT_AVC: case SQLT_AVC:
@ -203,6 +201,17 @@ static int alloc_column_buffer (lua_State *L, cur_data *cur, int i) {
SQLT_STR /*col->type*/, (dvoid *)&(col->null), (ub2 *)0, SQLT_STR /*col->type*/, (dvoid *)&(col->null), (ub2 *)0,
(ub2 *)0, (ub4) OCI_DEFAULT), cur->errhp); (ub2 *)0, (ub4) OCI_DEFAULT), cur->errhp);
break; break;
case SQLT_CHR:
case SQLT_STR:
ASSERT (L, OCIAttrGet (param, OCI_DTYPE_PARAM,
(dvoid *)&(col->max), 0, OCI_ATTR_DATA_SIZE,
cur->errhp), cur->errhp);
col->val.s = calloc (col->max * 2 + 1, sizeof(col->val.s));
ASSERT (L, OCIDefineByPos (cur->stmthp, &(col->define),
cur->errhp, (ub4)i, col->val.s, col->max * 2 + 1,
SQLT_STR /*col->type*/, (dvoid *)&(col->null), (ub2 *)0,
(ub2 *)0, (ub4) OCI_DEFAULT), cur->errhp);
break;
case SQLT_NUM: case SQLT_NUM:
case SQLT_FLT: case SQLT_FLT:
case SQLT_INT: case SQLT_INT: