Web lists-archives.com

Re: Mysql-Proxy Return prior to Execution




Managed to solve, just in case anyone else needs the same:

function read_query( packet )

   if string.byte(packet) == proxy.COM_QUERY then

     ....condition.....

     if (condition) then

         print("replaced with " .. query )

         proxy.queries:append(1, string.char(proxy.COM_QUERY) .. query )

         proxy.response.type = proxy.MYSQLD_PACKET_OK

         return proxy.PROXY_SEND_RESULT, proxy.PROXY_SEND_QUERY

     end

    end

end

On Sun, Aug 30, 2015 at 3:00 AM, Stefan Certic <stefan@xxxxxxxxxxxxxxx>
wrote:

> Hi Martin,
>
> Application benchmarking purposes - i don't want any latency for updates
> to complete. Still, data is needed. But i don't want application nor server
> to handle the logic wether sql went fine or not.
>
> The idea is: Fire an update / insert, return ok to application, execute
> query - while application can execute another one immediately after OK.
>
> Best Regards,
>
> On Sun, Aug 30, 2015 at 2:52 AM, Martin Gainty <mgainty@xxxxxxxxxxx>
> wrote:
>
>>
>>
>>
>> > Date: Sun, 30 Aug 2015 02:39:24 +0200
>> > Subject: Mysql-Proxy Return prior to Execution
>> > From: stefan@xxxxxxxxxxxxxxx
>> > To: mysql@xxxxxxxxxxxxxxx
>> >
>> > Hi Everyone,
>> MG>Stefan-
>> >
>> > Does anyone by chance have a working example of mysql-proxy lua script
>> that
>> > can:
>> >
>> > - First return OK to a client
>> > - Then actually execute the query on server, ignoring the results.
>>
>> MG>can you please elaborate ..why execute query if no results returned to
>> client?
>> >
>> > Thanks in advance!
>> >
>> > --
>> > Stefan Certic
>> > *Chief Technology Officer*
>> >
>> >
>> >
>> > stefan@xxxxxxxxxxxxxxx
>> > --------------------------
>> > CS Network Solutions Limited
>> >
>> > 84 High Street, Southall, Middlesex, UB1 3DB. United Kingdom
>> >
>> > London Switchboard: +442071933539
>> > Belgrade Operations: +38112448755
>> >
>> > Web: www.cs-networks.net
>> > <http://www.facebook.com/smsanywhere> <https://twitter.com/cs_networks>
>> > <http://www.linkedin.com/company/cs-networks>
>> > <http://www.youtube.com/csnetworks>
>> > --------------------------
>> >
>> > This message (including any attachments) is confidential and may be
>> > privileged. If you have received it by mistake please notify the sender
>> by
>> > return e-mail and delete this message from your system. Any unauthorized
>> > use or dissemination of this message in whole or in part is strictly
>> > prohibited. Please note that e-mails are susceptible to change. CS
>> Networks
>> > shall not be liable for the improper or incomplete transmission of the
>> > information contained in this communication nor for any delay in its
>> > receipt or damage to your system. CS Networks does not guarantee that
>> the
>> > integrity of this communication has been maintained nor that this
>> > communication is free of viruses, interceptions or interference.
>>
>
>
>
> --
> Stefan Certic
> *Chief Technology Officer*
>
>
>
> stefan@xxxxxxxxxxxxxxx
> --------------------------
> CS Network Solutions Limited
>
> 84 High Street, Southall, Middlesex, UB1 3DB. United Kingdom
>
> London Switchboard: +442071933539
> Belgrade Operations: +38112448755
>
> Web: www.cs-networks.net
> <http://www.facebook.com/smsanywhere>  <https://twitter.com/cs_networks>
> <http://www.linkedin.com/company/cs-networks>
> <http://www.youtube.com/csnetworks>
> --------------------------
>
> This message (including any attachments) is confidential and may be
> privileged. If you have received it by mistake please notify the sender by
> return e-mail and delete this message from your system. Any unauthorized
> use or dissemination of this message in whole or in part is strictly
> prohibited. Please note that e-mails are susceptible to change. CS Networks
> shall not be liable for the improper or incomplete transmission of the
> information contained in this communication nor for any delay in its
> receipt or damage to your system.  CS Networks does not guarantee that the
> integrity of this communication has been maintained nor that this
> communication is free of viruses, interceptions or interference.
>



-- 
Stefan Certic
*Chief Technology Officer*



stefan@xxxxxxxxxxxxxxx
--------------------------
CS Network Solutions Limited

84 High Street, Southall, Middlesex, UB1 3DB. United Kingdom

London Switchboard: +442071933539
Belgrade Operations: +38112448755

Web: www.cs-networks.net
<http://www.facebook.com/smsanywhere>  <https://twitter.com/cs_networks>
<http://www.linkedin.com/company/cs-networks>
<http://www.youtube.com/csnetworks>
--------------------------

This message (including any attachments) is confidential and may be
privileged. If you have received it by mistake please notify the sender by
return e-mail and delete this message from your system. Any unauthorized
use or dissemination of this message in whole or in part is strictly
prohibited. Please note that e-mails are susceptible to change. CS Networks
shall not be liable for the improper or incomplete transmission of the
information contained in this communication nor for any delay in its
receipt or damage to your system.  CS Networks does not guarantee that the
integrity of this communication has been maintained nor that this
communication is free of viruses, interceptions or interference.