Moved keywords from local variables to keywords map.

This commit is contained in:
brad Arant committed 2025-01-02 16:43:53 -08:00
1 parent 907f449ecc
commit 9622b5cf8c
23 files changed
+221 -220

No files matched your search

+6 -6
View File
@@ -6,13 +6,13 @@ namespace jet {
__mysql::__mysql(coreutils::ZString &in, coreutils::MString &parentOut, Global &global, Tag *parent, Tag *local) : Tag(in, parentOut, global, parent, this) {
if(!variableDefined("host"))
if(!keywordDefined("host"))
throw coreutils::Exception("host must be specified for mysql tag.");
if(!variableDefined("database"))
if(!keywordDefined("database"))
throw coreutils::Exception("database must be specified for mysql tag.");
if(!variableDefined("user"))
if(!keywordDefined("user"))
throw coreutils::Exception("user must be specified for mysql tag.");
if(!variableDefined("password"))
if(!keywordDefined("password"))
throw coreutils::Exception("password must be specified for mysql tag.");
resolveKeyword("host");
@@ -21,12 +21,12 @@ namespace jet {
resolveKeyword("password");
resolveKeyword("sessionid");
sessionId = variables["sessionid"];
sessionId = keywords["sessionid"];
global.addSession(sessionId, this);
mysql = mysql_init(NULL);
mysql = mysql_real_connect(mysql, variables["host"].c_str(), variables["user"].c_str(), variables["password"].c_str(), variables["database"].c_str(), 0, NULL, 0);
mysql = mysql_real_connect(mysql, keywords["host"].c_str(), keywords["user"].c_str(), keywords["password"].c_str(), keywords["database"].c_str(), 0, NULL, 0);
if(!mysql)
throw coreutils::Exception("database and host parameters are not valid.");