* auth/sql.c (get_field): NULL value in an optional field is
equivalent to MU_ERR_NOENT.
Showing
2 changed files
with
10 additions
and
0 deletions
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 | } | ... | ... |
-
Please register or sign in to post a comment