[exim] mysql lookup on update: $value is affected rows?

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Marilyn Davis
Datum:  
To: exim-users
Betreff: [exim] mysql lookup on update: $value is affected rows?
Hello Exim Experts,

I'm having trouble with a mysql lookup and the documentation seems so
clear that I know I must be missing something, or my syntax is screwy
and I can't see it. Here's a bit from the doc:

9.18. Special MySQL features

[skipped some]

If a MySQL query is issued that does not request any
data (an insert, update, or delete command), the
result of the lookup is the number of rows affected.

I'm running exim 4.43 on the test machine, where this is happening.

----

So, I concocted a router for testing:

affected_rows:
   driver = redirect
   debug_print = ${lookup mysql{\
update in_out set last_use = now() where in_id = RECIPIENT_ID \
                                    and out_id = REPLY_ID}{$value}{xxx}}
   data =


---

Before I run a test, I check the value in last_use (using a python
script, that's why the result is in a python tuple)

select last_use from in_out where in_id = 10 and out_id = 64
('2004-10-25 14:36:43',)

---

>From that router:


MYSQL query: update in_out set last_use = now() where in_id = 10 and out_id = 64
MYSQL using cached connection for localhost/maildance/root
MYSQL: query was not one that returns data
lookup forced cache cleanup
lookup yielded: 0
expanding: $value
    result: 0
expanding: xxx
    result: xxx
skipping: result is not used
expanding: ${lookup mysql{update in_out set last_use = now() where in_id = ${extract{recipient_id}{$address_data}} and out_id = ${extract{reply_id}{$address_data}}}{$value}{xxx}}
    result: 0
0
calling affect_rows router


---
0 ->> Zero! Zero rows affected?

But an external call to mysql assures me that it happened:

select last_use from in_out where in_id = 10 and out_id = 64
('2004-10-25 14:40:48',)

I must be misinterpreting something.

I'll be very grateful for any help.

Marilyn Davis