Its 6:15PM on a Friday so I am trying to write out some final
thoughts before I leave to go see a play (its Friday... I really
should get out).
Final rant for the week?
if()!
I am looking at some code in 5.1 (aka the mysql server) that I am
none to pleased with and its making me think about how to
determine where bugs in code are likely to be. I am not talking
memory leaks, aka the stuff that is cake to find, but instead the
bugs which keep you up at night.
Its time to start blaming if(). When I see an if(), especially
when there is no else, I take an extra hard look at it.
What was the exception that required the if()? Was it platform
dependent, was it there to fix some bug in some special case
(yuck! non general solution). Is the if() there to branch for a
feature?
So I am left pondering whether or not you can predict the amount
of bugs in any code base by …
I’ve worked for two Internet startup companies, both around 2 years each, both now long dead. The first was due to eventual lack of new VC funds, the second gross financial managment in the second year (apparently, when we were told there was no money December one year to pay us, the company that made large profits every month for over the first year, then had made losses every month for the past 12 months, but nobody knew about it. There were 5 Directors from 3 countries and nobody knew. Yeah Right!)
I’ve learnt a lot of non IT street smarts in this time. The first
startup took the VC route, and after 3 rounds while I wasn’t
involved in the process you pick up things. The single biggest
tip here is the Bell-Mason Diagnostic. Here a few introduction
references worthy of a quick review ( …
Welcome to the tenth edition of Log Buffer, the weekly compendium of blogs for DBAs. Let’s dive right in. Some like it gooey… or GUI anyway. Mike Hillyer lets us know about a new single GUI tools manual from MySQL. It’s a very thorough 148-pages long. I notice that it is not published under an [...]
After reading Todd Huss blog about the gotcha when using statement-based replication, where statements can "disappear" (that is, not be applied to the slave database), I believe that I can shed some light on the reason for this behavior.
Before that, some background.
Traditionally, MySQL has been using what is called statement-based replication. Statement-based replication replicates the changes to the slave by sending the actual statement that was executed on the master over to the slave, and the slave subsequently executes that statement. Of course, only statements that change something will be sent to the slave.
Sometimes, you don't want to send all changes to the slaves. So
therefore it is possible to prevent the master from sending
changes to some databases using the --binlog-do-db
and …
There were some rumors going around that OSDBcon might get canceled, but I was just speaking to Zak and he confirmed that S&S, the company organizing the event, is committed to making the conference happen. Last I heard there are over 30 proposals with more coming in everyday. But the more the better! This years conference is being held once again in parallel with the International PHP Conference. However I think this is suboptimal. PHP developers for the most part are actively using open source databases already. Especially the MySQL guys have no trouble reaching the PHP guys with conferences dedicated to PHP. So it would be a good idea to to think about how to best get access to other audiences, like the Java and .Net crowd.
I talked to a few people about this via email and IRC. Personally I think it would also be great to …
[Read more]If you’ve worked with any of the commerical databases other than MySQL, you may have already had some experience with triggers.
I’m glad that the MySQL developers finally managed to squeeze in this extremely important feature. I no longer dread trying to defend MySQL from the Microsoft and Oracle developers who have had triggers for so many years.
I’ll use the example off the MySQL website (explained below in detail). I’ll assume you know how to create a table. If not, please read up on that first.
CREATE TABLE test1(a1 INT);
CREATE TABLE test2(a2 INT);
CREATE TABLE …
Well, database operations are bread-and-butter work for most PHP applications. PHP and MySQL, for example, have been like brother and sister for many years. You may have heard about "SQL injections", a bad taste from the outside world of $_GET, $_POST, $_COOKIE and the like.
Everybody should know that you shouldn't pass variables from outside unfiltered to i.e. mysql_query. Of course, sometimes this can slip through because we are human and humans make errors. The initial development of Chorizo! was driven by our own need to make it easier for our developers to detect potential security issues and fix them in a second. With Morcilla, our server-side PHP extension, life will be much easier, especially when you turn display_errors = Off in your php.ini settings which won't give a hint to potential attackers that a modified GET variable produced a SQL error. With Morcilla, we look inside the server and can detect SQL injection …
[Read more]
Near the end of a two weeks vacation in southern Italy, I
combined pleasure and business and took the 4 to 5 upgrade exams, which I passed, to
achieve both MySQL 5 DBA and Developer certifications.
I took both exams today in Palermo, one in the morning and one in
the afternoon. Now I am back to full-time tourist for a few more
days.
Recently, MySQL Cluster developer and team leader Martin Sköld
committed some major revisions and additions in the
storage/ndb/ndbapi-examples
directory of the MySQL
5.1 source. Although I don’t think these have yet been pushed out
to the public 5.1 tree, I went ahead late last week and added
them to the Practical Examples section of the NDB API Guide so
that interested parties can take advantage of a number of
corrections and other improvelements that Martin’s made.
There’s two new additions, also — here and here — these demonstrate for the first time in the Guide the use of the API with multiple clusters. You might find these particularly useful if …
[Read more]Sheeri talked a little about MySQL Triggers in One TRIGGER Fact, Optimizer Rewriting Stuff. While it’s great that MySQL 5.0 has Triggers, there are some things that I feel could become features in future releases.
IF EXISTS
One of the beautiful features that MySQL has is IF EXISTS. This ternary operation that if the object exists performs the operation, of not it does nothing works wonders in reviewing logs for errors. One of the problems with Oracle for example, is the requirement to ignore the ORA errors for non-existent objects.
But this functionality doesn’t exist for Triggers? One must wonder why. I’d like to see this.
mysql> DROP TRIGGER IF EXISTS trigger_name;[Read more]