projects
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DNS: time-limit cached returns, using TTL. Bug 1395
[exim.git]
/
src
/
src
/
lookups
/
mysql.c
diff --git
a/src/src/lookups/mysql.c
b/src/src/lookups/mysql.c
index 9511d2acb411757a084c5273af39523e56645e69..1ce8831e8950094638f4c8a16913b7cb160b7fce 100644
(file)
--- a/
src/src/lookups/mysql.c
+++ b/
src/src/lookups/mysql.c
@@
-2,7
+2,7
@@
* Exim - an Internet mail transport agent *
*************************************************/
* Exim - an Internet mail transport agent *
*************************************************/
-/* Copyright (c) University of Cambridge 1995 - 20
09
*/
+/* Copyright (c) University of Cambridge 1995 - 20
15
*/
/* See the file NOTICE for conditions of use and distribution. */
/* Thanks to Paul Kelly for contributing the original code for these
/* See the file NOTICE for conditions of use and distribution. */
/* Thanks to Paul Kelly for contributing the original code for these
@@
-74,7
+74,7
@@
Arguments:
resultptr where to store the result
errmsg where to point an error message
defer_break TRUE if no more servers are to be tried after DEFER
resultptr where to store the result
errmsg where to point an error message
defer_break TRUE if no more servers are to be tried after DEFER
- do_cache set
false
if data is changed
+ do_cache set
zero
if data is changed
The server string is of the form "host/dbname/user/password". The host can be
host:port. This string is in a nextinlist temporary buffer, so can be
The server string is of the form "host/dbname/user/password". The host can be
host:port. This string is in a nextinlist temporary buffer, so can be
@@
-84,8
+84,8
@@
Returns: OK, FAIL, or DEFER
*/
static int
*/
static int
-perform_mysql_search(uschar *query, uschar *server, uschar **resultptr,
- uschar **errmsg, BOOL *defer_break,
BOOL
*do_cache)
+perform_mysql_search(
const
uschar *query, uschar *server, uschar **resultptr,
+ uschar **errmsg, BOOL *defer_break,
uint
*do_cache)
{
MYSQL *mysql_handle = NULL; /* Keep compilers happy */
MYSQL_RES *mysql_result = NULL;
{
MYSQL *mysql_handle = NULL; /* Keep compilers happy */
MYSQL_RES *mysql_result = NULL;
@@
-225,7
+225,7
@@
can be detected by calling mysql_field_count(). If its result is zero, no data
was expected (this is all explained clearly in the MySQL manual). In this case,
we return the number of rows affected by the command. In this event, we do NOT
want to cache the result; also the whole cache for the handle must be cleaned
was expected (this is all explained clearly in the MySQL manual). In this case,
we return the number of rows affected by the command. In this event, we do NOT
want to cache the result; also the whole cache for the handle must be cleaned
-up. Setting do_cache
FALSE
requests this. */
+up. Setting do_cache
zero
requests this. */
if ((mysql_result = mysql_use_result(mysql_handle)) == NULL)
{
if ((mysql_result = mysql_use_result(mysql_handle)) == NULL)
{
@@
-233,7
+233,7
@@
if ((mysql_result = mysql_use_result(mysql_handle)) == NULL)
{
DEBUG(D_lookup) debug_printf("MYSQL: query was not one that returns data\n");
result = string_sprintf("%d", mysql_affected_rows(mysql_handle));
{
DEBUG(D_lookup) debug_printf("MYSQL: query was not one that returns data\n");
result = string_sprintf("%d", mysql_affected_rows(mysql_handle));
- *do_cache =
FALSE
;
+ *do_cache =
0
;
goto MYSQL_EXIT;
}
*errmsg = string_sprintf("MYSQL: lookup result failed: %s\n",
goto MYSQL_EXIT;
}
*errmsg = string_sprintf("MYSQL: lookup result failed: %s\n",
@@
-340,8
+340,8
@@
query is deferred with a retryable error is now in a separate function that is
shared with other SQL lookups. */
static int
shared with other SQL lookups. */
static int
-mysql_find(void *handle, uschar *filename, uschar *query, int length,
- uschar **result, uschar **errmsg,
BOOL
*do_cache)
+mysql_find(void *handle, uschar *filename,
const
uschar *query, int length,
+ uschar **result, uschar **errmsg,
uint
*do_cache)
{
return lf_sqlperform(US"MySQL", US"mysql_servers", mysql_servers, query,
result, errmsg, do_cache, perform_mysql_search);
{
return lf_sqlperform(US"MySQL", US"mysql_servers", mysql_servers, query,
result, errmsg, do_cache, perform_mysql_search);