Many maintenance procedures need to generate SQL as strings, and
then need to execute that string as SQL. Use PREPARE for
this.
CODE:CREATE DATABASE `admin`;
USE admin
CREATE PROCEDURE `execute`(in cmd text)
SQL SECURITY INVOKER
begin
set @x = cmd;
prepare x from @x;
execute x;
drop prepare x;
end
(as requested on Freenode:#mysql)
Interesting... Slidy by Dave Raggett.
Despite it being a pest, PowerPoint is of course still "the
standard". Yes, Apple's Keynote is very nice. OpenOffice.org just
clones PowerPoint and thus suffers from the same problems... the
main issues I have: maintenance, collaboration, and reusing
components.
With a decent system that uses XHTML as its format, distributed
revision control would sort out the maintenance and
collaboration, and as one would be able to chop things up, that
deals with re-use (and single source for one component that
exists in multiple presentations). Nice. Haven't (yet) looked at
this in detail, but it seems more sensible than some other
frameworks that have been created earlier.
Simple is good!
This article is a quick pointer on MySQL's three available tools
for UPSERT
(update/insert) or MERGE
queries.
There were recently number of posts about MyISAM, for example Arjen wrote pretty nice article about MyISAM features so I thought I would share my own view on using MyISAM in production.
For me it is not only about table locks. Table locks is only one
of MyISAM limitations you need to consider using it in
production.
Especially if you're comming from "traditional" databases you're
likely to be shocked by MyISAM behavior (and default MySQL
behavior due to this) - it will be corrupted by unproper
shutdown, it will fail with partial statement execution if
certain errors are discovered etc.
You should not think about this however as about bugs, as many MySQL features it is designed for particular load cases when it shines and it might not be good choice for others.
In 1999 for my production application (storing billions of rows in tens of …
[Read more]Groggy mentions trying to draw sequence diagrams with pic. I recommend using Spinellis excellent UMLGraph toolset that he developed while writing Code Reading. That book was wonderfully inspiring to me, and helped cement my desire to work on open source software.
From what I remember, the sequence diagram stuff was a clever set of pic macros, so that you could just describe a sequence diagram and then generate the picture. I love having pictures to use during a discussion because they help avoid confusion, but I absolutely hate drawing pictures or using drawing tools - I prefer to keep the diagrams in plain-text, source code, in a revision control system. Using pic for the sequence diagrams fits the bill perfectly. Code is …
[Read more]I’ve never been much of a video game player, but I do remember Quake having this really excellent console for entering commands.
As a programmer, I find myself flipping back and forth between iTerm and applications like email and web browser very frequently. On linux, I use multiple desktops to accomplish this, on OS X I just use quicksilver and try to not be irritated that I have to readjust my windows all the time.
Hosted on the same site as the excellent quicksilver is an incredible application named visor which lets you assign a hotkey to make a terminal window appear out of nowhere, and then disappear again when you hit the hotkey. Best of all, it even maintains context. I can even run screen to get multiple windows, so bye bye iTerm.
This is going to make coding on MySQL on the mac so much
easier!
Here is the link for visor:
…
There is a bug in MySQL that causes an UPDATE
to
fail with a unique index violation, even though the statement
doesn't create duplicate values. In this article I'll explain
when this bug can happen, and how to work around it.
This article is a quick pointer on MySQL’s three techniques for UPSERT (update/insert) or MERGE queries. I’ve written about this before, but since SQL 2003 has a MERGE statement (which Oracle and DB2 support), many people are asking for similar functionality in MySQL without realizing it already exists. I hope this article helps you find what you need. The three tools are REPLACE INSERT ... ON DUPLICATE KEY UPDATE .
For Wikipedia junkies out there, there's a very cool Palm Treo interface to Wikipedia available called Quickipedia from Standalone Software. This is a perfect tool for when you're stuck somewhere without access to a good browser and you need find some information. While Google on a PDA is ok for random searches, Quickipedia blows it away for most reference information. Say you're on your way to a meeting and someone asks you about The Mythical Man-Month which you haven't read in 20 years, and you don't want to be completely clueless. A few clicks, boom boom and you've got a summary from Wikipedia. Or if you're in a meeting and you're suddenly wondering who carved …
[Read more]