Thoughts on the take over of MySQL AB by Sun.

The buzz in the blogosphere yesterday could hardly be missed. MySQL AB and Sun Microsystems announced they reached a final agreement for the acquisition of MySQL AB by Sun Microsystems. First of all, I think that it is very important that there is a difference between MySQL AB (the company) and MySQL the open source Database engine.
MySQL doesn’t “own” MySQL. Mysql is an open source project, so the source is free to modify and use etc according to the GPL license.

The people of MySQL AB seem to be very happy with the take-over. I can imagine that. It will give for sure some financial ease of mind for the company and his employees and access to a large source of knowledge and resources. Somehow many people, including myself, have a suspicion against “the big corporations”. With the exception of Apple computers ofc :).
Don’t forget however that Sun has a decent and reliable history with Open Source. Open Office and making Java open source to name 2 big achievements of Sun.
I use MySQL now for close to 9 years. I have learned to love this database engine, discovering the more advanced features of SQL step by step. I only have used MySQL directly or interfaced by PHP.
I can only express my hope that Sun will support the continuous development of the MySQL API as used by the MySQLi or mysqlnd extensions of PHP.
Some analysts suspect that Sun is busy to build his “own” alternative to the classic LAMP (Linux, Apache, MySQL, PHP) stack. The Sun-Stack would be SAMJ (Solaris (opensourced!), Apache, MySQL, Java).
People should have the freedom to use and code the language they prefer.
I really hope it won’t be soon that if you want to have the full support for the capabilities of MySQL, you have to use a Java interface to interact with the database engine from a web-environment.

Dashcode

Apple released a public beta of Dashcode to ADC members (including the free accounts). I have to say I am deeply impressed.
It has still some quirks, but it is stable and has stunning features.

I started this week to play around with it and I can assure you it’s fun.
Implementing a Scrollarea gave some problems for me tho.
(I admit, has a lot to do with my JS n00bness…but hey…)

If you you update the content of your scrollarea, don’t forget to refresh it…

example:

if (logstatus == 0) {
		loginhoud = logcall.outputString;
		content.innerHTML = loginhoud;
		document.getElementById("scrollArea").object.refresh();
	}
	else {
		content.innerHTML = "Problem fetching server data...";
	}

I think this is missing in the documentation…(yup, reporting it to Apple as well).

AJAX with Safari

Mental note to myself:

When making a POST request with XMLHttprequest and Safari(v2.0.4), always generate some content for the browser.

If not, the status will always be undefined.
example:

if (!$mysqli->query($insert)) {
  trigger_error("error writing data: ".$insert);
  exit;
}
else {
  echo "0";
}

This costed me some hours pulling my hair….
The following javascript works like a charm when you return a “0″ at the end of the php file called with POST. If you don’t return anything, Safari will decide that the HTTP headers are undefined and thus call the error handler.

KwAjax.ContentLoader.onReadyState=function(){
  var req=this.req;
  var ready=req.readyState;
  if (ready==KwAjax.READY_STATE_COMPLETE){
      var httpStatus=req.status;
      if (httpStatus == 200 || httpStatus == 0) {
        this.onload.call(this);
      }
      else {
        this.onerror.call(this);
      }
  }
}

Hilarious (and so happy it wasn’t me)

A mistake every DBA could make…having your auto-incremental primary key big enough to handle almost every thinkable 2 to the power of n, but you overlook the size of your index.

It has happened to slashdot last week:
Original story.

The funniest comment is imho:

Alright, who’s the joker who posted the 16,777,216th comment?

Thanks for breaking slashdot, jerk :D

duh

Sometimes you think to yourself: duh

Copy a table from 1 database to another was always something I did by exporting the table+data and importing it. Or I used the phpmyadmin tool for it.
Like today, but somehow my eye fell on the SQL syntax phpmyadmin used:

INSERT INTO newdb.newtable
SELECT *
FROM olddb.oldtable;

DUH!

Ofcourse this only works if you have copied the structure of the table already.

Gargleblaster.org

My latest run

date: 30 Nov 08 11:02 CET
distance: 4.95 km
duration: 28'04"
my last run

All my runs

total runs: 66
total km: 355.11
total time: 37:06'19"
farthest run: 11.13 km