diff options
author | pixel <pixel> | 2008-03-18 09:29:58 +0000 |
---|---|---|
committer | pixel <pixel> | 2008-03-18 09:29:58 +0000 |
commit | 32b08bdd2746e0a678f0510df6c5d319028967d1 (patch) | |
tree | a81aba6fa03bd380a63346a7b87a29bdc440260c /lib | |
parent | 44a7787711acd906c1bc137a9af1ccb68ae0370d (diff) |
Forgot getRowid for ResultSet.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/LuaOCCI.cc | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/LuaOCCI.cc b/lib/LuaOCCI.cc index 0f0c2f7..0aa304f 100644 --- a/lib/LuaOCCI.cc +++ b/lib/LuaOCCI.cc @@ -968,7 +968,7 @@ enum EncapOCCI_ResultSet_methods_t { // RESULTSET_GETNUMBER, // RESULTSET_GETOBJECT, // RESULTSET_GETREF, -// RESULTSET_GETROWID, + RESULTSET_GETROWID, // RESULTSET_GETROWPOSITION, // RESULTSET_GETSTATEMENT, RESULTSET_GETSTREAM, @@ -1004,6 +1004,7 @@ struct lua_functypes_t EncapOCCI_ResultSet_methods[] = { { RESULTSET_GETINT, "getInt", 1, 1, { BLUA_NUMBER } }, { RESULTSET_GETMAXCOLUMNSIZE, "getMaxColumnSize", 1, 1, { BLUA_NUMBER } }, { RESULTSET_GETNUMARRAYROWS, "getNumArrayRows", 0, 0, { } }, + { RESULTSET_GETROWID, "getRowid", 1, 1, { BLUA_NUMBER } }, { RESULTSET_GETSTREAM, "getStream", 1, 1, { BLUA_NUMBER } }, { RESULTSET_GETSTRING, "getString", 1, 1, { BLUA_NUMBER } }, { RESULTSET_GETUINT, "getUInt", 1, 1, { BLUA_NUMBER } }, @@ -1040,6 +1041,7 @@ class sLua_EncapOCCI_ResultSet : public Base { DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETINT); DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETMAXCOLUMNSIZE); DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETNUMARRAYROWS); + DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETROWID); DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETSTREAM); DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETSTRING); DECLARE_METHOD(EncapOCCI_ResultSet, RESULTSET_GETUINT); @@ -1077,6 +1079,7 @@ void LuaOCCI_ResultSet::pushmembers(Lua * L) { PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETINT); PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETMAXCOLUMNSIZE); PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETNUMARRAYROWS); + PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETROWID); PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETSTREAM); PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETSTRING); PUSH_METHOD(EncapOCCI_ResultSet, RESULTSET_GETUINT); @@ -1197,6 +1200,21 @@ int sLua_EncapOCCI_ResultSet::EncapOCCI_ResultSet_proceed_unprotected(Lua * L, i L->push((lua_Number) rset->getNumArrayRows()); r = 1; break; + case RESULTSET_GETROWID: + { + Bytes bytes = rset->getRowid(L->tonumber(2)); + Buffer * b = new Buffer(true); + int size = bytes.length(); + unsigned char * x = (unsigned char *) malloc(size); + bytes.getBytes(x, size); + b->write(x, size); + free(x); + LuaBuffer o(b); + o.pushdestruct(L); + L->push((lua_Number) size); + } + r = 2; + break; case RESULTSET_GETSTREAM: { strm = rset->getStream(L->tonumber(2)); |