Http_Post UDF causing MySQL to crash
Posted by: Peter Sylvester
Date: November 15, 2011 01:47PM

Hey folks. We've grabbed the following udf code (wrapper for curl) from google in attempt to add http post functionality to MySQL

http://code.google.com/p/mysql-udf-http/

The first parameter in the UDF is the address to send the post information to, the second parameter is the post parameters to be sent. When a valid DNS or IP address is provided in the first parameter the code works with absolutely no problems. If an invalid URL or IP address (or one that is valid but can't be reached) is provided, MySQL crashes.


The MySQL error log shows the following....

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x176e1930): select http_post('fjghofijgh.fhgifg.fhgfh', 'ssdfsdf=fsdfs')
Connection ID (thread ID): 2
Status: NOT_KILLED

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.


/var/log/messages shows the following....

Nov 14 15:02:34 banting kernel: mysqld[883] general protection rip:3632c0d9b2 rsp:4998c5e0 error:0
Nov 14 16:04:50 banting kernel: mysqld[17713]: segfault at 00000000000001ce rip 00000036331090f4 rsp 000000004a164180 error 4


If we run this outside of MySQL with an invalid URL it takes a little longer, but it doesn't pass back any kind of error or exception, but still has problems when it's loaded into MySQL.

Options: ReplyQuote


Subject
Views
Written By
Posted
Http_Post UDF causing MySQL to crash
2694
November 15, 2011 01:47PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.