issues with prepared statements in mysql

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

issues with prepared statements in mysql

Alex G-2
I have a scenario where I execute a trigger in mysql when info is added to the acc table. In some circumstances, my trigger results in a duplicate key when it tries to add info to another table. The prepared statement functionality reads this as an error, and fails to do the insert into the acc table as a result of this.

Is there any way to get around this?
<input onclick="jsCall();" id="jsProxy" type="hidden">

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: issues with prepared statements in mysql

Bogdan-Andrei Iancu
Hi Alex,

and the acc record is actually added (even with the trigger error) ? or
the acc insert fails completely ?

Regards,
Bogdan

Alex G wrote:

> I have a scenario where I execute a trigger in mysql when info is
> added to the acc table. In some circumstances, my trigger results in a
> duplicate key when it tries to add info to another table. The prepared
> statement functionality reads this as an error, and fails to do the
> insert into the acc table as a result of this.
>
> Is there any way to get around this?
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


--
Bogdan-Andrei Iancu
www.voice-system.ro


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: issues with prepared statements in mysql

Alex G-2

It fails completely. As a matter o fact... anything that doesn't return "query OK" fails: :(

On Mar 3, 2010 12:17 PM, "Bogdan-Andrei Iancu" <[hidden email]> wrote:

Hi Alex,

and the acc record is actually added (even with the trigger error) ? or
the acc insert fails completely ?

Regards,
Bogdan


Alex G wrote:
> I have a scenario where I execute a trigger in mysql when info is
> added to the a...

> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


--
Bogdan-Andrei Iancu
www.voice-system.ro


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: issues with prepared statements in mysql

Alex Balashov
That's because it is a single transaction and is being rolled back,
most likely.

On 03/03/2010 01:23 PM, Alex G wrote:

> It fails completely. As a matter o fact... anything that doesn't return
> "query OK" fails: :(
>
>> On Mar 3, 2010 12:17 PM, "Bogdan-Andrei Iancu" <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>> Hi Alex,
>>
>> and the acc record is actually added (even with the trigger error) ? or
>> the acc insert fails completely ?
>>
>> Regards,
>> Bogdan
>>
>>
>> Alex G wrote:
>> > I have a scenario where I execute a trigger in mysql when info is
>> > added to the a...
>>
>> > ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Users mailing list
>> > [hidden email] <mailto:[hidden email]>
>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>> --
>> Bogdan-Andrei Iancu
>> www.voice-system.ro <http://www.voice-system.ro>
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email] <mailto:[hidden email]>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users


--
Alex Balashov - Principal
Evariste Systems LLC

Tel    : +1 678-954-0670
Direct : +1 678-954-0671
Web    : http://www.evaristesys.com/

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: issues with prepared statements in mysql

Bogdan-Andrei Iancu
In reply to this post by Alex G-2
well, in this case, the mysql driver in opensips reports the truth :)...

the only option here is to make your trigger more fault-resistant  ;)

Regards,
Bogdan

Alex G wrote:

>
> It fails completely. As a matter o fact... anything that doesn't
> return "query OK" fails: :(
>
>> On Mar 3, 2010 12:17 PM, "Bogdan-Andrei Iancu"
>> <[hidden email] <mailto:[hidden email]>> wrote:
>>
>> Hi Alex,
>>
>> and the acc record is actually added (even with the trigger error) ? or
>> the acc insert fails completely ?
>>
>> Regards,
>> Bogdan
>>
>>
>> Alex G wrote:
>> > I have a scenario where I execute a trigger in mysql when info is
>> > added to the a...
>>
>> >
>> ------------------------------------------------------------------------
>> >
>> > _______________________________________________
>> > Users mailing list
>> > [hidden email] <mailto:[hidden email]>
>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>>
>> --
>> Bogdan-Andrei Iancu
>> www.voice-system.ro <http://www.voice-system.ro>
>>
>>
>> _______________________________________________
>> Users mailing list
>> [hidden email] <mailto:[hidden email]>
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>  


--
Bogdan-Andrei Iancu
www.voice-system.ro


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users