Commit 5845efba 5845efba26f3dcae8718fe9d447a6071e9255af4 by Sergey Poznyakoff

* auth/sql.c (get_field): NULL value in an optional field is

equivalent to MU_ERR_NOENT.
1 parent 8d4b5c02
1 2008-11-21 Sergey Poznyakoff <gray@gnu.org.ua>
2
3 * auth/sql.c (get_field): NULL value in an optional field is
4 equivalent to MU_ERR_NOENT.
5
1 2008-11-18 Sergey Poznyakoff <gray@gnu.org.ua> 6 2008-11-18 Sergey Poznyakoff <gray@gnu.org.ua>
2 7
3 * mailbox/amd.c (_amd_attach_message): Call mu_body_clear_modified 8 * mailbox/amd.c (_amd_attach_message): Call mu_body_clear_modified
......
...@@ -180,10 +180,15 @@ get_field (mu_sql_connection_t conn, const char *id, char **ret, int mandatory) ...@@ -180,10 +180,15 @@ get_field (mu_sql_connection_t conn, const char *id, char **ret, int mandatory)
180 } 180 }
181 else if (!*ret) 181 else if (!*ret)
182 { 182 {
183 if (mandatory)
184 {
183 mu_error (_("SQL field `%s' (`%s') has NULL value"), 185 mu_error (_("SQL field `%s' (`%s') has NULL value"),
184 id, name ? *name : id); 186 id, name ? *name : id);
185 rc = MU_ERR_READ; 187 rc = MU_ERR_READ;
186 } 188 }
189 else
190 rc = MU_ERR_NOENT;
191 }
187 192
188 return rc; 193 return rc;
189 } 194 }
......