use conditstr instead stringset, add pop exception

pull/1/head
deffpuzzl 2018-06-14 09:42:35 +08:00
parent 989650e90b
commit 09a47596f3
8 changed files with 21 additions and 13 deletions

View File

@ -28,8 +28,8 @@ int main(int argc, char *argv[])
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
stringset(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值 conditstr(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值
if(RC_SUCC != lClick(pstSavm, (void *)&uTime)) if(RC_SUCC != lClick(pstSavm, (void *)&uTime))
{ {

View File

@ -28,8 +28,8 @@ int main(int argc, char *argv[])
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
stringset(pstSavm, stUser, user_no, "20180224"); // 查询条件赋值 conditstr(pstSavm, stUser, user_no, "20180224"); // 查询条件赋值
if(RC_SUCC != lCount(pstSavm, (void *)&lRow)) if(RC_SUCC != lCount(pstSavm, (void *)&lRow))
{ {

View File

@ -27,8 +27,8 @@ int main(int argc, char *argv[])
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
stringset(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值 conditstr(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值
if(RC_SUCC != lDelete(pstSavm)) if(RC_SUCC != lDelete(pstSavm))
{ {

View File

@ -27,7 +27,7 @@ int main(int argc, char *argv[])
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
decorate(pstSavm, dbUser, user_nm, MATCH_MIN); decorate(pstSavm, dbUser, user_nm, MATCH_MIN);
decorate(pstSavm, dbUser, user_phone, MATCH_MAX); decorate(pstSavm, dbUser, user_phone, MATCH_MAX);

View File

@ -28,7 +28,7 @@ int main(int argc, char *argv[])
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
decorate(pstSavm, dbUser, user_nm, GROUP_BY | ORDER_ASC); decorate(pstSavm, dbUser, user_nm, GROUP_BY | ORDER_ASC);
decorate(pstSavm, dbUser, user_phone, GROUP_BY | ORDER_DESC); decorate(pstSavm, dbUser, user_phone, GROUP_BY | ORDER_DESC);

View File

@ -28,8 +28,8 @@ long lSelectUserInfo()
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
stringset(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值 conditstr(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值
for(i = 0; i < 2000000; i ++) for(i = 0; i < 2000000; i ++)
{ {

View File

@ -28,8 +28,8 @@ int main(int argc, char *argv[])
} }
conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量 conditinit(pstSavm, stUser, TBL_USER_INFO); // 绑定变量
stringset(pstSavm, stUser, user_type, "1"); // 查询条件赋值 conditstr(pstSavm, stUser, user_type, "1"); // 查询条件赋值
stringset(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值 conditstr(pstSavm, stUser, user_no, "20180223"); // 查询条件赋值
if(RC_SUCC != lQuery(pstSavm, &lRow, (void **)&pstUser)) if(RC_SUCC != lQuery(pstSavm, &lRow, (void **)&pstUser))
{ {

View File

@ -82,7 +82,7 @@ long _lPush(SATvm *pstSavm, void *pvAddr)
*************************************************************************************************/ *************************************************************************************************/
long _lPop(SATvm *pstSavm, void *pvAddr, void *pvOut, Timesp *tm) long _lPop(SATvm *pstSavm, void *pvAddr, void *pvOut, Timesp *tm)
{ {
int nPos; int nPos, i = 0;
SHTruck *ps = NULL; SHTruck *ps = NULL;
extern int errno; extern int errno;
TblDef *pv = (TblDef *)pvAddr; TblDef *pv = (TblDef *)pvAddr;
@ -126,7 +126,15 @@ retry:
ps = (PSHTruck)pGetNode(pvAddr, pv->m_lData + pv->m_lTruck * nPos); ps = (PSHTruck)pGetNode(pvAddr, pv->m_lData + pv->m_lTruck * nPos);
if(IS_TRUCK_NULL(ps)) if(IS_TRUCK_NULL(ps))
{
if((++ i) > pv->m_lMaxRow)
{
pstSavm->m_lErrno = SVR_EXCEPTION;
return RC_FAIL;
}
goto retry; goto retry;
}
memcpy(pvOut, ps->m_pvData, pv->m_lReSize); memcpy(pvOut, ps->m_pvData, pv->m_lReSize);
SET_DATA_TRUCK(ps, DATA_TRUCK_NULL); SET_DATA_TRUCK(ps, DATA_TRUCK_NULL);