Comment 3 for bug 1318917

Revision history for this message
Andy B (u-launchpad-x) wrote :

Some additional notes.

1)
Creating the field as

    data BLOB not null default (cast('' as BLOB))

avoids the NULL insert issue and maintains the type of the empty data column so the replay reading works.

2)
Should this crop up in an sqlite3 database that won't load, it can be fixed with the following query:

    update gearman_queue set data = cast('' as BLOB) where data is NULL

3)
The gearman command line client enforces having a data payload, but gearmand will accept an empty payload. It's odd that libgearman will enforce something differently than what the server will accept. But, there's also an inconsistency in the gearman command line client.

$ gearman -P -f junk -b -N
<hit enter, attempting to create an empty data payload after the newline is stripped>
gearman: gearman_client_add_task : add_task(GEARMAN_INVALID_ARGUMENT) invalid workload -> libgearman/add.cc:194: pid(26893)
=> no job created

$ echo -n | gearman -P -f junk -b
=> job created with data=NULL

$ gearman -P -f junk -b </dev/null
=> job created with data=NULL

$ gearman -P -f junk -b -N </dev/null
=> immediately exit, since EOF is detected on STDIN.

I'd expect these to all act the same, either creating a job with an empty payload or being rejected.