Archive for the ‘udfs’ Category

memcached talk tonight, ManadLUG

Сентябрь 11th, 2009
I have a talk scheduled tonight, for anyone who's in the Southern New Hampshire area (or greater Northern New England area): http://permalink.gmane.org/gmane.org.user-groups.linux.gnhlug.announce/743

I'll be going over a number of things, time permitting:

* memcached (in general)
* NorthScale's memcached Amazon Machine Images and Virtual Appliance
* moxi - memcached proxy
* memcached Functions for MySQL

I'll run a couple demonstrations with each, first simple memcached usage, then using two memcached instances through moxi, then I'll throw in using them with the UDFs.

I intend to see if the Boston MySQL Users Group would be interested in this talk soon as well.
PlanetMySQL Voting: Vote UP / Vote DOWN

Drizzle may now sleep!

Июль 31st, 2009
I realized the other day that I need the sleep() function, which up until this morning, Drizzle did not have, for testing the memcached Drizzle UDFs. Well, now it does:

drizzle> select sleep(3);
+----------+
| sleep(3) |
+----------+
| 0 |
+----------+
1 row in set (3 sec)

drizzle> select sleep(0);
+----------+
| sleep(0) |
+----------+
| 0 |
+----------+
1 row in set (0 sec)

drizzle> select sleep(20);
+-----------+
| sleep(20) |
+-----------+
| 0 |
+-----------+
1 row in set (20 sec)

As you see, it returns zero, just as the MySQL sleep() function does.

The code can be had at:

lp:~capttofu/drizzle/sleep

memcached Functions for MySQL now on launchpad

Июль 28th, 2009
Hi all,

This is a quick post to let you know that the memcached functions for MySQL have been moved to Launchpad. The project page is: https://launchpad.net/memcached-udfs

I think this will help to get the project more exposure, as well as making it easier for people to contribute to the project. I've found Launchpad to be quite useful for managing projects and so decided to move the UDFs there.

I'm working on getting out another version soon. I just fixed a bug the deals with user-defined variables that were set to NULL causing the UDFs to crash the server. It was a bug in the length of the argument being set to 8192


For instance, the first explicitly:

mysql> select memc_set('nullval', null);

(gdb) p args->args[1]
$3 = 0x0
(gdb) p args->lengths[1]
$4 = 0

The second case, wrong:

mysql> select @nullvar= NULL;
+----------------+
| @nullvar= NULL |
+----------------+
| NULL |
+----------------+
1 row in set (0.00 sec)

mysql> select memc_set('nullval', @nullvar);

(gdb) p args->args[1]
$5 = 0x0
(gdb) p args->lengths[1]
$6 = 8192

This is totally a bug. I used to pass the length unmodified to memcached_set() in the value function:

rc= memcached_set(&container->memc,
args->args[0], (size_t)args->lengths[0],
args->args[1], (size_t)args->lengths[1],
container->expiration, (uint16_t)0);

And MySQL would crash!

This one line fixed it:

if (args->args[1] == NULL)
args->lengths[1]= 0;

BTW - thanks to Jean-Jacques Moortgat at AOL for finding this bug!

I need to file this bug, also meant to send this to Monty to look at. I was showing him at OSCON but we were both really busy last week.