Showing entries 41 to 47
« 10 Newer Entries
Displaying posts with tag: udf (reset)
Memcached UDFs for MySQL version 0.5 Released

I'm pleased to announce the release of Memcached UDFs for MySQL. This release contains the ability to now pass expiration values. For instance, you can:

select memc_set('keyabc', 'somevalue')

or

select memc_set('keyabc', 'I die in 10 seconds', 10);

The functions that now have this ability are:

memc_set()
memc_set_by_key()
memc_append()
memc_append_by_key()
memc_prepend()
memc_prepend_by_key()
memc_add()
memc_add_by_key()
memc_replace()
memc_replace_by_key()

You can download the latest archive from http://patg.net/downloads/memcached_functions_mysql-0.5.tar.gz

Also, mercurial repository at …

[Read more]
Liveblogging: Extending MySQL by Brian ?Krow? Aker

Liveblogging: Extending MySQL by Brian “Krow” Aker

Brian wins the award for “most frequent great quotes during a talk”.

Before MySQL 5.1 a UDF was the only way to extend MySQL.

All you need in a UDF is: init() execute() deinit()

my_bool id3_parse_init(UDF_INIT *initid UDF_ARGS *args, char *message)

UDF_ARGS tell you about incoming args
char *message is the output that might return
args->arg_count is the # of args

WARNING: use STRICT mode in MySQL, otherwise there are tons of silent failures.

“When you work on databases you start to put everything in databases. Tip, don’t put a DVD into a database, because really long BLOBs aren’t actually supported….”

In MySQL 5.1, you can now install plugins (example is memcache_servers plugin):

mysql> INSTALL PLUGIN memcache_servers SONAME …

[Read more]
UDFs at the MySQL User's conference

The MySQL User's conference will be held in less than a month from now!!!

This year there is quite a good number of sessions on adding your own functions and procedures, such as:

[Read more]
How to compile a C++ MySQL UDF on OSX 10.4

Recently, I came upon Baron Swartz's (xaprb's) great now_usec UDF:
http://www.xaprb.com/blog/2007/10/30/how-i-built-the-now_usec-udf-for-mysql/


I use an Intel Macbook Pro for my primary development environment. GCC on OS X has some interesting quirks. Usually to compile a UDF on GNU/Linux I use the following command line:

gcc -fPIC -Wall -I/usr/include/mysql -shared -o udf_now_usec.so udf_now_usec.cc


When I tried to execute the above on my OS X box, I got some errors:

$ gcc -fPIC -Wall -I../include -shared -o udf_now_usec.so udf_now_usec.cc
i686-apple-darwin8-gcc-4.0.1: unrecognized option '-shared'
/usr/bin/ld: Undefined symbols:
_main
___gxx_personality_v0</b>
collect2: ld returned 1 exit status



The …

[Read more]
Maatkit version 1674 released

This release contains bug fixes and new features. Click through to the full article for the details. I'll also write more about the changes in a separate article.

What is new in Maatkit

My posts lately have been mostly progress reports and release notices. That's because we're in the home stretch on the book, and I don't have much spare time. However, a lot has also been changing with Maatkit, and I wanted to take some time to write about it properly.

UDF

UDF_LUA

You are tired of writing your UDFs for MySQL in C or never wanted to write them in C at all ? How about writing them in lua ?

LUA is - easy to learn - easy to embed - easy to use

and not to forget lua has extensions for everything: - LuaSocket - how about some HTTP requests ? - LuaSQL - connecting back to the MySQL Server ? - ...

UDF_Lua is registered in the MySQL Forge.

functions

As example we want to read the real startup time of the errorlog.

-- we are run with the permissions of the mysqld
-- …
[Read more]
Showing entries 41 to 47
« 10 Newer Entries