Kaydet (Commit) 997b4400 authored tarafından Andrzej J.R. Hunt's avatar Andrzej J.R. Hunt

Some cleanup of getTables(). (firebird-sdbc)

Change-Id: I0a16d5a97a25a95b61b1fd11cf276b72d7dad7c5
üst b502e3fd
...@@ -291,23 +291,24 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn, ...@@ -291,23 +291,24 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn,
} }
else else
{ {
// TODO: confirm the sizings below.
for (int i=0; i < pOutSqlda->sqld; i++, pVar++) for (int i=0; i < pOutSqlda->sqld; i++, pVar++)
{ {
int dtype = (pVar->sqltype & ~1); /* drop flag bit for now */ int dtype = (pVar->sqltype & ~1); /* drop flag bit for now */
switch(dtype) { switch(dtype) {
case SQL_TEXT:
pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen);
break;
case SQL_VARYING: case SQL_VARYING:
pVar->sqltype = SQL_TEXT; pVar->sqltype = SQL_TEXT;
pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen + 2); pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen);
break; break;
case SQL_TEXT: case SQL_SHORT:
pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen); pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen);
break; break;
case SQL_LONG: case SQL_LONG:
pVar->sqldata = (char *)malloc(sizeof(long)); pVar->sqldata = (char *)malloc(sizeof(long));
break; break;
case SQL_SHORT:
pVar->sqldata = (char *)malloc(sizeof(char)*pVar->sqllen);
break;
case SQL_FLOAT: case SQL_FLOAT:
pVar->sqldata = (char *)malloc(sizeof(double)); pVar->sqldata = (char *)malloc(sizeof(double));
break; break;
...@@ -320,12 +321,30 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn, ...@@ -320,12 +321,30 @@ int OStatement_Base::prepareAndDescribeStatement(const OUString& sqlIn,
case SQL_TIMESTAMP: case SQL_TIMESTAMP:
pVar->sqldata = (char *)malloc(sizeof(time_t)); pVar->sqldata = (char *)malloc(sizeof(time_t));
break; break;
case SQL_BLOB:
assert(false); // We cannot deal with blobs in DSQL
break;
case SQL_ARRAY:
assert(false); // TODO: implement
break;
case SQL_TYPE_TIME:
assert(false); // TODO: implement
break;
case SQL_TYPE_DATE:
assert(false); // TODO: implement
break;
case SQL_INT64: case SQL_INT64:
pVar->sqldata = (char *)malloc(sizeof(int)); pVar->sqldata = (char *)malloc(sizeof(int));
break; break;
/* process remaining types */ case SQL_NULL:
assert(false); // TODO: implement
break;
case SQL_QUAD:
assert(false); // TODO: implement
break;
default: default:
OSL_ASSERT( false ); SAL_WARN("connectivity.firebird", "Unknown type: " << dtype);
assert(false);
break; break;
} }
if (pVar->sqltype & 1) if (pVar->sqltype & 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment