Fixed whilerow.

This commit is contained in:
brad Arant 2024-09-26 21:11:52 -07:00
parent 5a97da3d1c
commit c6c0be016e
4 changed files with 2 additions and 4 deletions

View File

@ -50,6 +50,7 @@ namespace jet {
splitName.split("."); splitName.split(".");
if(splitName.getList().size() == 1) if(splitName.getList().size() == 1)
return variables[splitName[0]]; return variables[splitName[0]];
std::cout << "session var: " << splitName << std::endl;
return getSessionVariable(splitName); return getSessionVariable(splitName);
} }
throw coreutils::Exception("expected variable name or type designator."); throw coreutils::Exception("expected variable name or type designator.");
@ -75,8 +76,6 @@ namespace jet {
} }
__mysql * Global::getSession(coreutils::MString sessionId) { __mysql * Global::getSession(coreutils::MString sessionId) {
std::cout << "sessionId: " << sessionId << std::endl;
std::cout << "count: " << sessions.size() << std::endl;
if(sessions.find(sessionId) == sessions.end()) if(sessions.find(sessionId) == sessions.end())
throw coreutils::Exception("requested session is not available."); throw coreutils::Exception("requested session is not available.");
return sessions[sessionId]; return sessions[sessionId];

View File

@ -11,6 +11,7 @@ namespace jet {
while ((count != 0) && global.getSession(variables["sessionid"])->hasRow()) { while ((count != 0) && global.getSession(variables["sessionid"])->hasRow()) {
processContainer(container); processContainer(container);
container.reset();
global.getSession(variables["sessionid"])->nextRow(); global.getSession(variables["sessionid"])->nextRow();
--count; --count;
} }

BIN
jet-2.0

Binary file not shown.

View File

@ -4,14 +4,12 @@
<comment>This is a comment and should not show up in the output.</comment> <comment>This is a comment and should not show up in the output.</comment>
<html> <html>
$[nonexistant] $[nonexistant]
<comment>
<mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1"> <mysql host="localhost" database="barant" user="barant" password="uversa" sessionid="1">
<sql sessionid="1">select * from testdata</sql> <sql sessionid="1">select * from testdata</sql>
<whilerow name="index" count="10" sessionid="1"> <whilerow name="index" count="10" sessionid="1">
$[1.id] $[1.text] $[1.value] $[1.id] $[1.text] $[1.value]
</whilerow> </whilerow>
</mysql> </mysql>
</comment>
<set name="ix" value="1" /> <set name="ix" value="1" />
<set name="theexpr" expr="SUBSTRING('abcdefg', 1, 3)" /> <set name="theexpr" expr="SUBSTRING('abcdefg', 1, 3)" />
<set name="theexpr2" expr="5+3" /> <set name="theexpr2" expr="5+3" />