Skip to content

Commit 4874072

Browse files
committed
Fix a core dump
1 parent 8650300 commit 4874072

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Correct handling of data types in expression evaluation
77
* Variables of type integer, double, string can be made shared among all threads
88
* The oltp workload has new features to allow it to be used for live demonstration
9+
* An oltp workload run can be set to gradually increase the arrival rate
910
* $queueeverytiming:on directive to include emulated queue time
1011

1112
## 3.0.3

src/rwlcoderun.c

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*
1515
* History
1616
*
17+
* bengsig 15-nov-2022 - Core dump in flush local sql upon exit
1718
* bengsig 3-nov-2022 - Harden code with rwl_type throughout
1819
* bengsig 31-oct-2022 - Add better queue time via $queueeverytiming:on
1920
* bengsig 26-oct-2022 - Add $niceabort:on directive
@@ -80,7 +81,6 @@ void rwlcoderun ( rwl_xeqenv *xev)
8081
ub4 miscuse = 0;
8182
double thead = 0.0, tgotdb = 0.0, tend = 0.0;
8283
text *codename;
83-
sb4 pvnum;
8484
rwl_identifier *pproc;
8585

8686
pc = xev->start[xev->pcdepth];
@@ -94,15 +94,28 @@ void rwlcoderun ( rwl_xeqenv *xev)
9494
return;
9595
}
9696

97-
pvnum = xev->rwm->code[pc].ceint2;
98-
/*ASSERT*/
99-
if (pvnum<0)
97+
switch (xev->rwm->code[pc].ctyp)
10098
{
101-
rwlexecsevere(xev, &xev->rwm->code[pc].cloc, "[rwlcoderun-nopvnum:%s;%d;%d;%d]"
102-
, codename, xev->pcdepth, pc, pvnum);
103-
return;
99+
case RWL_CODE_HEAD:
100+
case RWL_CODE_SQLHEAD:
101+
{
102+
103+
sb4 pvnum = xev->rwm->code[pc].ceint2;
104+
/*ASSERT*/
105+
if (pvnum<0)
106+
{
107+
rwlexecsevere(xev, &xev->rwm->code[pc].cloc, "[rwlcoderun-nopvnum:%s;%d;%d;%d]"
108+
, codename, xev->pcdepth, pc, pvnum);
109+
return;
110+
}
111+
pproc = xev->evar+pvnum;
112+
}
113+
break;
114+
115+
default:
116+
pproc = 0;
117+
break;
104118
}
105-
pproc = xev->evar+pvnum;
106119

107120
if (bit(xev->rwm->m2flags, RWL_P2_NOEXEC))
108121
{
@@ -1505,7 +1518,7 @@ void rwlcoderun ( rwl_xeqenv *xev)
15051518
));
15061519

15071520
endprogram:
1508-
if (pproc->vdata)
1521+
if (pproc && pproc->vdata)
15091522
{
15101523
// Any local sql we need to flush?
15111524
ub4 pp;

0 commit comments

Comments
 (0)