02 April 2005

MySQL 5.0 “Triggers”


Just a quick note here after looking over this article about MySQL 5’s triggers while I was trying to find their “download the source” page. Apparently from inside a MySQL 5 trigger you can’t access information from any table. This basically reduces these “triggers” to being a local constraint; local because trying to do things with foreign keys would require a SELECT which is, of course, forbidden.

And there’s one more thing, don’t alter a table with triggers. It will crash your database. And triggers won’t be fired if there is a NOT NULL column. And a handful of other problems that they are working on right now. I’m sure they’ll get the hang of it eventually.

Yes, I usually use something else and it has a few of its own obscure problems with triggers.


31 March 2005

mod_dav Quota Patch Redux


I haven’t written about my patch to Apache httpd’s mod_dav module to show free disk space lately, and it apparently fell off the website when I moved things to the new server with built-in UPS. Thanks to the Internet Wayback Machine and TNPI, I’ve recovered the text and patch on the new server.

Anyone who has used Mac OS X’s iDisk tool may have noticed that the window shows how much space is available for writing unlike most WebDAV servers. I noticed this and wanted this feature on my own WebDAV server and created a patch to mod_dav that adds the needed properties. The specification for sending this information to clients is not finalized so this patch may stop working for some clients some day when the specification changes and clients change with it.

The patch is available here and should apply cleanly to the source for recent versions of Apache 2.0 (it was originally written for 2.0.47). This patch shows disk free, not quotas if you happen to have them enabled. And even then, the only the quota that applies to Apache is the quota for the user it runs as.

If you notice in the patch there are a couple places where real big numbers get divided by 512. This is because for some strange reason, when MacOSX’s mount_webdav bits calculate disk free they want to be getting the stats in 512-byte blocks. All the documentation I’ve found about <d:quota> and <d:quotaused> seems suggest that this number should be in bytes. But then again in those specs it was <d:quota-bytes>. /sbin/mount_webdav also does some really funny stuff when these numbers get large, I wonder in my mind if there is a buffer overflow or something lurking under the surface in mount_webdav’s quota handling.

The patch is much nicer now than it was when I first tried it in the handles the quota property. It handles this property through the avenues it is supposed to rather than pasting a quota onto every single PROPFIND that comes along. Whether that PROPFIND is looking for DAV:quota or not.

Further down the correct path than I am right now is implementing something along the lines of statfs(2) or statvfs(2) in the Apache Portable Runtime. Arguably it might be a better idea to just have functions that return the total disk space and available disk space. Especially since Windows may or may not support statfs() in its POSIX API. But in any case, the raw system calls in repos.c right now in this patch aren’t really appropriate.

It would be nice if this patch could be integrated into the Apache httpd project. That however will depend on the statfs calls being integrated into the APR.


Unethical Funding at WordPress


Apparently the people behind the WordPress project’s website, which includes the project’s founder, have decided that a good way to fund the project would be to use their Google PageRank to link to a lot of canned articles on topics that generate more advertising revenue than others. Some more details on this matter are available from Andy Baio’s blog and Ars Technica

It is deeply troubling that people associated with open source projects use resources that only have value because of unpaid community contribution and cash in on them. Unless that conversion is of impeccable ethics and completely transparent you’re bound to have a problem on your hands. In the case of the “Open Projects” (now Freenode) IRC network, there was a lack of transparency that led to the conclusion that Rob Levin was in fact using the donations that were advertised to “help the network” to pay his rent and feed his family. Certainly noble purposes, except that every other IRC network is run by volunteers who do the work mainly for free and when money is going to them to pay their living expenses that much is made more clear. This made some members of the user community upset.

In the case of WordPress, there is both the lack of transparency as to where the funds were used and the fact that the funds are being raised in a way that is certainly unethical. The link and page hiding method used is a violation of the contract between WordPress.org and Google for the AdWords program which opens the site maintainer and the project itself to lawsuits from Google, should they be feeling particularly nasty. As it is, Google has reset the pagerank for WordPress.org to zero and WordPress.org links are slowly disappearing from its search results. It doesn’t help matters that the project founder who is ostensibly responsible for this decision was on an extended vacation to various countries in Europe when this story broke. The particularly cynical might wonder how the vacation was funded.

At best, this was a tragic mistake on the part of the people responsible. The offending links and articles have now been removed, but it looks as if the damage is done and it may be too late for forgiveness from Google and many users.

I’m going to have to think long and hard about how much I can contribute to the WordPress parent project without getting myself tangled up in their apparently shaky ethics. I already had misgivings about the way they used the default links in the application to promote their personal blogs rather than useful community resources. (The lead developer brags about being Google’s “#1 most important Matt in the world” on his personal page, a direct result of his link being in the default install.) I had been planning to embark on a project to make WordPress database agnostic and did not want to deal with having to be a fork from the parent project. Perhaps a fork from the parent project would be better for the community though. The coming days and how this is all handled will shine a better light on which way is best to go.

For what it’s worth, I should point out that at no time have I been paid for my work on WordPress-pg and if I do receive such payment in the future I’ll be transparent about where the money is going and what I’m doing to repay the community for any such kindness.


30 March 2005

Can You Hear Me Now?


We’ve had one more hiccup in VoIP land. At first, we had only one provider for connecting long distance calls, SimpleTelecom. I’m not really sure what is wrong for them right now, but they aren’t completing calls. The IAX2 connector says “circuit-busy” and their call detail record says “Forbidden”. In any case, my call is not being connected and I want to talk to people. Good thing there are plenty choices and I’m not tied down.

In 15 minutes I setup an account with a competing long-distance provider, Teliax. Then with a small amount of change on the machine here, I was able to setup this new provider to be used in the event the first provider failed to complete my call. Voices didn’t transmit correctly when G729 compression was used, but forcing the call to G711-u seemed to fix things.

It was nice that adding new providers went relatively easily. On the other hand, people who get the “ready for your mother to use” services like Vonage, Packet8, and AT&T’s CallVantage are locked out of ever using another provider the same way people are traditionally used to with their normal plain old telephone service. When they have problems, there is no shopping for someone else that is working in the meantime. Vendor lock-in can be a bummer.