mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-29 18:19:30 +00:00
When calling the Realtime app more than once, unset fields which were
previously set are erroneously still set (Bug 6701). After discussion, it was determined this should only be changed in trunk. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -168,7 +168,12 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
|
||||
indicator = 0;
|
||||
res = SQLGetData(stmt, x + 1, SQL_CHAR, rowdata, sizeof(rowdata), &indicator);
|
||||
if (indicator == SQL_NULL_DATA)
|
||||
continue;
|
||||
rowdata[0] = '\0';
|
||||
else if (ast_strlen_zero(rowdata)) {
|
||||
/* Because we encode the empty string for a NULL, we will encode
|
||||
* actual empty strings as a string containing a single whitespace. */
|
||||
ast_copy_string(rowdata, " ", sizeof(rowdata));
|
||||
}
|
||||
|
||||
if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
|
||||
ast_log(LOG_WARNING, "SQL Get Data error!\n[%s]\n\n", sql);
|
||||
@@ -180,15 +185,12 @@ static struct ast_variable *realtime_odbc(const char *database, const char *tabl
|
||||
stringp = rowdata;
|
||||
while(stringp) {
|
||||
chunk = strsep(&stringp, ";");
|
||||
if (!ast_strlen_zero(ast_strip(chunk))) {
|
||||
if (prev) {
|
||||
prev->next = ast_variable_new(coltitle, chunk);
|
||||
if (prev->next)
|
||||
prev = prev->next;
|
||||
} else
|
||||
prev = var = ast_variable_new(coltitle, chunk);
|
||||
|
||||
}
|
||||
if (prev) {
|
||||
prev->next = ast_variable_new(coltitle, chunk);
|
||||
if (prev->next)
|
||||
prev = prev->next;
|
||||
} else
|
||||
prev = var = ast_variable_new(coltitle, chunk);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user