Skip to content
Snippets Groups Projects
Commit 494647fb authored by Tilghman Lesher's avatar Tilghman Lesher
Browse files

Update the mysql driver to always return NULL columns, as this is needed for...

Update the mysql driver to always return NULL columns, as this is needed for the realtime API to work correctly.
(closes issue #16138)
 Reported by: sohosys
 Patches: 
       20091029__issue16138.diff.txt uploaded by tilghman (license 14)
 Tested by: sohosys


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 71ca1b54
No related branches found
No related tags found
No related merge requests found
......@@ -367,12 +367,13 @@ static struct ast_variable *realtime_mysql(const char *database, const char *tab
while ((row = mysql_fetch_row(result))) {
for (i = 0; i < numFields; i++) {
if (ast_strlen_zero(row[i]))
continue;
/* Encode NULL values separately from blank values, for the Realtime API */
if (row[i] == NULL) {
row[i] = "";
} else if (ast_strlen_zero(row[i])) {
row[i] = " ";
}
for (stringp = ast_strdupa(row[i]), chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) {
if (!chunk || ast_strlen_zero(ast_strip(chunk))) {
continue;
}
if (prev) {
if ((prev->next = ast_variable_new(fields[i].name, chunk, ""))) {
prev = prev->next;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment