|
报错信息:
1、F:\\Program Files\\HP\\LoadRunner\\include/Ptt_Mysql.h(75): Error: C interpreter run time error: F:\\Program Files\\HP\\LoadRunner\\include/Ptt_Mysql.h (75): Error -- memory violation : Exception ACCESS_VIOLATION received.
2、Abnormal termination, caused by mdrv process termination.
我的脚本如下:
#include "Ptt_Mysql.h"
#define MYSQLSERVER "192.168.1.139"
#define MYSQLUSERNAME "itsm"
#define MYSQLPASSWORD "123444"
#define MYSQLDB "xt"
#define MYSQLPORT 9906
MYSQL *Mconn;
vuser_init()
{
lr_load_dll("libmysql.dll");
Mconn=lr_mysql_connect(MYSQLSERVER, MYSQLUSERNAME, MYSQLPASSWORD, MYSQLDB, MYSQLPORT);
return 0;
}
Action()
{
char chQuery[3000];
char x[3000];
char y[10];
strcpy(y,lr_eval_string ("{userID}"));
strcpy(x,"SELECT bpi.ID AS PROCESS_INSTANCE_ID,FORM_INSTANCE_ID FROM BPM_PROCESS_INSTANCE bpi INNER JOIN FM_FORM_VERSION ffv ON ffv.ID = bpi.FORM_VERSION_ID INNER JOIN FM_FORM ff ON ff.ID = ffv.FORM_ID INNER JOIN SF_SERVICE_CATEGORY ssc ON ssc.ID=ff.SERVICE_CATEGORY_ID INNER JOIN ( SELECT bnh.PROCESS_INSTANCE_ID piid,bnh.ROLE_BY_AREA_FLAG FROM BPM_NODE_HISTORY bnh WHERE bnh.RUN_FLAG = '1' AND bnh.IMPLEMENTER_ID =");
strcat(x,y);
strcat(x," UNION SELECT bnh.PROCESS_INSTANCE_ID piid,bnh.ROLE_BY_AREA_FLAG FROM BPM_NODE_HISTORY bnh WHERE bnh.IMPLEMENT_ROLE_TYPE = 'GROUP_ROLE' AND bnh.RUN_FLAG = '1' AND (IMPLEMENTER_ID IS NULL OR IMPLEMENTER_ID='') AND bnh.IMPLEMENT_GROUP_ID IN ( SELECT GROUP_ID FROM SYS_GROUP_USER sgu,SYS_USER su WHERE sgu.USER_ID =");
strcat(x,y);
strcat(x," AND sgu.USER_ID = su.ID AND su.PAUSE_ORDERS =");
strcat(x,y);
strcat(x,") UNION SELECT bnh.PROCESS_INSTANCE_ID piid,bnh.ROLE_BY_AREA_FLAG FROM BPM_NODE_HISTORY bnh WHERE bnh.IMPLEMENT_ROLE_TYPE = 'SYSTEM_ROLE' AND bnh.RUN_FLAG = '1' AND (IMPLEMENTER_ID IS NULL OR IMPLEMENTER_ID='') AND bnh.IMPLEMENT_GROUP_ID IN ( SELECT ROLE_ID FROM SYS_USER_ROLE syr,SYS_USER su WHERE syr.USER_ID =");
strcat(x,y);
strcat(x," AND syr.USER_ID = su.ID AND su.PAUSE_ORDERS = ");
strcat(x,y);
strcat(x,") UNION SELECT bnh.PROCESS_INSTANCE_ID piid,bnh.ROLE_BY_AREA_FLAG FROM BPM_NODE_HISTORY bnh WHERE bnh.IMPLEMENT_ROLE_TYPE = 'REVIEW_ROLE' AND bnh.RUN_FLAG = '1' AND EXISTS(SELECT ID FROM BPM_REVIEW_INFO WHERE NODE_HISTORY_ID=bnh.ID AND OPT_TIME IS NULL AND OPT_PERSON_ID=");
strcat(x,y);
strcat(x,") ) qnitemp ON bpi.ID = qnitemp.piid;");
sprintf(chQuery,"%s",x);
lr_output_message ("%s",chQuery);
lr_mysql_query(Mconn,chQuery);
……
}
我查了很多资料都没有解决,希望各位大师能帮帮忙 |
|