New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove ON DUPLICATE #630
Comments
ahem, not SELECT?UPDATE:INSERT; but UPDATE?:INSERT; |
Attachment: remove ON DUPLICATE |
did you test all the affected features after applying your patch? including the profiler? |
Replying to [matt](comment:3): > did you test all the affected features after applying your patch? including the profiler? I didn’t test the query profiler. In the patch there is 2 extra ‘array’ in the last part :/ (before both $paramsBind). About the round : actually there is number_fomat and in the db a double precision (float). I find better to have integer on both side. (I think I had an issue on that part and just crop) |
please make sure you test your patch fully before submitting it for review.. |
Replying to [matt](comment:5): > please make sure you test your patch fully before submitting it for review.. yes you are right, I did trust too much the unit test. |
Can we create a wrapper function for this? I would prefer to keep the ON DUPLICATE query for mysql and provide the alternate UPDATE/INSERT query for other DB's. |
adding a wrapper mean starting handle multiple database. |
I agree it would be better if the postgresql wrapper would special handling this type of queries. You could use the event 'Reporting.createDatabase' to create your special database object that would overload the default ones to special handle this type of queries. Please let us know if this works as expected. |
removing mysqlish in order to improve compatibliy with other database backend.
So replace the ON DUPLICATE with : SELECT ? UPDATE : INSERT;
As it will be ok because the ON DUPLICATE clause is use only on queries wchich not used a lot. It can have faillure if it is used concurrently, the time to do a fail update, an insert can hit the database and then the next insert (from the failed update) will failled.
However we can use a sql function if needed (it will be able to catch the error and make the right thing).
The text was updated successfully, but these errors were encountered: