Incentive

June 11th, 2009

Eden: I’m not hungry. I don’t want to eat dinner. What’s that on the counter?
Daddy: Chocolate milk.
Eden: Am I going to drink some?
Daddy: No, you said you didn’t want anything.
Eden: …. I think I’m hungry now.

Flour Power

April 23rd, 2009

(two months ago)
Iona: Daddy, am I going to marry you when I get big?
Daddy: No, you’ll marry someone else, and the two of you will have your own family.
Iona: (in tears) I don’t want to leave! I want to stay with you and mommy!

(last week, after passing the display cakes in the bakery)
Iona: Daddy, what kind of cake did you and mommy have at your wedding?
Daddy: I’ll show you a picture when we get home.

Our Wedding Cake

(a few minutes later)
Iona: Daddy, I think it will be ok if I marry someone else and we have our own family.

errno: 121 (Duplicate key) with CREATE TABLE

April 9th, 2009

Trying to create a table, and getting something like this?

ERROR 1005 (HY000): Can't create table '<db>.<table>' (errno: 121)

Discovered that perror 121 says this?

MySQL error code 121: Duplicate key on write or update

Really confused how you might get a duplicate key error while creating a table?

If the table you’re trying to create includes a foreign key constraint, and you’ve provided your own name for that constraint, remember that it must be unique within the database. Run this query to see if that name is in use somewhere:

SELECT
  constraint_name,
  table_name
FROM
  information_schema.table_constraints
WHERE
  constraint_type = 'FOREIGN KEY'
  AND table_schema = DATABASE()
ORDER BY
  constraint_name;

(If you’re still on 4.1 or earlier,

mysqldump --no-data yourDbName | grep CONSTRAINT

to get a similar list)

Thanks to [raymond] on Freenode.

Error 1307 creating stored procedure

April 7th, 2009

Trying to create a stored procedure, and getting a cryptic error like this?

ERROR 1307 (HY000): Failed to CREATE PROCEDURE <procName>

Try this simple diagnostic query first:

SELECT
  IF(
    COUNT(*) XOR (CAST(VERSION() AS decimal(2, 1)) >= 5.1),
    'Wrong mysql.proc table version. Did you forget to run mysql_upgrade?',
    'The mysql.proc table looks ok. Keep hunting.'
  ) AS troubleshooting
FROM
  information_schema.columns
WHERE
  table_schema = 'mysql'
  AND table_name = 'proc'
  AND column_name LIKE 'body_utf8';

Location, location, location

February 12th, 2009

Iona: What are we watching?
Daddy: Hogan’s Heroes.
Iona: Are they on a boat?
Daddy: No, they’re in a POW camp.
Iona: Oh. New York is sort of like Texas.

Misconceptions

February 10th, 2009

Others (including the manual) have said it, and most who bother to read MySQL related blogs know it anyway, but:

* autoincrement does *not* have to be primary, or even unique. Just indexed.
* int(1) and int(100) hold the same range of values. The difference is how many zeros are added if zerofill is turned on.

Itsy Bitsy

December 17th, 2008

We found a couple of tiny spiders in the door frame of the waiting room.

Iona: “Why do they have spiders?”
Daddy: “They keep them as pets, to catch flies.”
Iona: “They need to build a water spout so they can catch more flies.”

The First Day of Christmas

November 27th, 2008

Daddy: “What do grapes grow on?”
Iona: “Grape vines.”
Daddy: “What do pears grow on?”
Iona: “Pear trees.”
Daddy: “What animal is famous for being in a pear tree in a song?”
Iona: “Polar bears?”

Captive Audience

November 24th, 2008

(while riding in the car)

Iona: Knock knock
Eden: …
Iona: Say, “who’s there?”
Eden: Who there!
Iona: Bacon.
Eden: …
Iona: Say, “bacon who?”
Eden: Bacon who?
Iona: Bakin’ a birthday cake!
Eden: …
Iona: Now, laugh at me.
Eden: ha. ha. ha.

What was that diagnosis again?

October 11th, 2008

Eden: “Iona had to go to the doctor because she had a rash.”
Daddy: “Yep, but the doctor said it wasn’t chicken pox.”
Eden: “Yeah, but the doctor didn’t say it wasn’t popsicles. Or an apple, or a banana either.”