|
参数化的值取数据库查询结果的数据,但每次limit 50的时候 取值是没有问题的,为什么limit 51以上的的话,row.cell取值就有问题呢?
1、以下是limit 50回访结果
Action()
{
int N;
char chQuery[1024];
lr_start_transaction("myQuerySql");
sprintf(chQuery,"SELECT id,title FROM `marketing_coupon_batch` limit 50;");
N = atoi(lr_eval_string("{rows}"));
lr_mysql_query(Mconn,chQuery);
lr_save_string(row[0][N].cell,"id");
lr_save_string(row[1][N].cell,"title");
lr_output_message(lr_eval_string("id: {id},title: {title}"));
mysql_close(Mconn);
return 0;
}
回访结果如下:
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(6): Notify: Transaction "myQuerySql" started.
Action.c(9): Notify: Parameter Substitution: parameter "rows" = "0"
Action.c(11): Notify: Saving Parameter "id = 1".
Action.c(12): Notify: Saving Parameter "title = test001".
Action.c(13): Notify: Parameter Substitution: parameter "id" = "1"
Action.c(13): Notify: Parameter Substitution: parameter "title" = "test001"
Action.c(13): id: 1,title: test001
2、以下是limit 60回访结果:为什么title不是test001呢
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(6): Notify: Transaction "myQuerySql" started.
Action.c(9): Notify: Parameter Substitution: parameter "rows" = "0"
Action.c(11): Notify: Saving Parameter "id = 1".
Action.c(12): Notify: Saving Parameter "title = 51".
Action.c(13): Notify: Parameter Substitution: parameter "id" = "1"
Action.c(13): Notify: Parameter Substitution: parameter "title" = "51"
Action.c(13): id: 1,title: 51
注:
select结果如下:
id title
1 test001
2 test002
3 test003
4 test004
5 test005
6 test006
7 test007
8 test008
9 test009
10 test010
11 test011
12 test012
13 test013
14 test014
15 test015
16 test016
17 test017
18 test018
19 test019
20 test020
21 test021
22 test022
23 test023
24 test024
25 test025
26 test026
27 test027
28 test028
29 test029
30 test030
31 test031
32 test032
33 test033
34 test034
35 test035
36 test036
37 test037
38 test038
39 test039
40 test040
41 test041
42 test042
43 test043
44 test044
45 test045
46 test046
47 test047
48 test048
49 test049
50 test050
51 test051
52 test052
53 test053
54 test054
55 test055
56 test056
57 test057
58 test058
59 test059
60 test060 |
|