{ "server error", RLM_SQL_ERROR },
{ "query invalid", RLM_SQL_QUERY_INVALID },
{ "no connection", RLM_SQL_RECONNECT },
+ { "no more rows", RLM_SQL_NO_MORE_ROWS },
{ NULL, 0 }
};
* Verify the 'Attribute' field
*/
if (!row[2] || row[2][0] == '\0') {
- REDEBUG("The 'Attribute' field is empty or NULL, skipping the entire row");
+ REDEBUG("Attribute field is empty or NULL, skipping the entire row");
return -1;
}
* Complain about empty or invalid 'op' field
*/
op = T_OP_CMP_EQ;
- REDEBUG("The 'op' field for attribute '%s = %s' is NULL, or non-existent.", row[2], row[3]);
+ REDEBUG("The op field for attribute '%s = %s' is NULL, or non-existent.", row[2], row[3]);
REDEBUG("You MUST FIX THIS if you want the configuration to behave as you expect");
}
/*
* The 'Value' field may be empty or NULL
*/
+ if (!row[3]) {
+ REDEBUG("Value field is empty or NULL, skipping the entire row");
+ return -1;
+ }
+
value = row[3];
+
/*
* If we have a new-style quoted string, where the
* *entire* string is quoted, do xlat's.
* Mark the pair to be allocated later.
*/
case T_BACK_QUOTED_STRING:
- value = NULL;
do_xlat = 1;
- break;
+
+ /* FALL-THROUGH */
/*
* Keep the original string.
rcode = rlm_sql_select_query(inst, request, handle, query);
if (rcode != RLM_SQL_OK) return -1; /* error handled by rlm_sql_select_query */
- while (rlm_sql_fetch_row(inst, request, handle) == 0) {
+ while (rlm_sql_fetch_row(inst, request, handle) == RLM_SQL_OK) {
row = (*handle)->row;
if (!row) break;
if (sql_fr_pair_list_afrom_str(ctx, request, pair, row) != 0) {