Blog

  • What was that diagnosis again?

    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.”

  • Another Parting Shot

    Related to that last quiz. Here’s the SHOW CREATE TABLE output – I’ve only cleaned up the whitespace.

    CREATE TABLE `t1` (
      `id` int(11) DEFAULT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 
    /*!50100 PARTITION BY RANGE (id) (
      PARTITION p0 VALUES LESS THAN (100) 
        ENGINE = MyISAM, 
      PARTITION p1 VALUES LESS THAN MAXVALUE 
        DATA DIRECTORY = '~/mysql/data/' 
        ENGINE = MyISAM
    ) */

    Now, pay close attention to the rows inserted:

    mysql> INSERT INTO t1 VALUES (100);
    Query OK, 1 row affected (0.00 sec)
    
    mysql> SELECT COUNT(*) FROM t1;
    +----------+
    | COUNT(*) |
    +----------+
    |        1 |
    +----------+
    1 row in set (0.00 sec)

    Ok, here’s the tricky bit:

    mysql> SELECT * FROM t1;
    Empty set (0.00 sec)

    No triggers, no BLACKHOLE, no Proxy, no events or other scheduled tasks, no other connections deleting rows, no temporary tables, and I have all the necessary privileges (including to the data directory shown, which exists and isn’t full). It’s all MyISAM, so surely no transactions. No errors or warnings have been reported.

    When you figure it out, don’t do it in your production environment. Bad things happen.

  • How’s that again?

    Iona: “Is it dried water or cold water?”

  • A Parting Shot

    mysql> INSERT IGNORE INTO trickyTable (id) VALUES (1);
    Query OK, 0 rows affected (0.00 sec)
    
    mysql> SELECT * FROM trickyTable;
    Empty set (0.00 sec)

    That’s odd – what happened to the row?

    I have the necessary privileges:

    mysql> SHOW GRANTS;
    +---------------------------------------------------+
    | Grants for root@localhost                         |
    +---------------------------------------------------+
    | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' |
    +---------------------------------------------------+
    1 row in set (0.00 sec)

    The table exists:

    mysql> SHOW TABLES;
    +------------------------+
    | Tables_in_example      |
    +------------------------+
    | trickytable            |
    +------------------------+
    1 row in set (0.00 sec)

    The field is there and adequately typed for the value:

    mysql> DESCRIBE trickyTable;
    +-------+---------+------+-----+---------+-------+
    | Field | Type    | Null | Key | Default | Extra |
    +-------+---------+------+-----+---------+-------+
    | id    | int(11) | YES  |     | NULL    |       |
    +-------+---------+------+-----+---------+-------+
    1 row in set (0.02 sec)

    Not using BLACKHOLE, and no transaction tricks:

    mysql> SELECT engine FROM information_schema.tables WHERE table_name = 'trickyTable';
    +--------+
    | engine |
    +--------+
    | MyISAM |
    +--------+
    1 row in set (0.00 sec)

    No triggers to make things tricky:

    mysql> SELECT * FROM information_schema.triggers WHERE event_object_table = 'trickyTable';
    Empty set (0.00 sec)

    Just take my word for it that I’m not using Proxy, and this has nothing to do with replication.

  • Weight for it…

    Eden (standing on bathroom scale): “42 pounds! I can’t believe it!”

  • When I grow up

    We were watching a movie with the kids. In one scene, the heroine has infiltrated the criminal mastermind’s compound, wormed her way through the laser security system, only to encounter a group of gun-toting henchman. In the midst of the ensuing fight scene in which she kicks, punches, and performs various other acrobatics to overpower three adversaries, Eden turns to me and says, in her most serious two-year-old voice, “I wish I could do that.”

  • Swimming

    I think the kids are trying to tell me something. They got up this morning and put on their swimsuits. When she said grace at breakfast, Iona said, “And thank you for us going swimming later today.” And then I went to get a glass of milk and found this:
    Trunks

    Yep, those are my swimming trunks, which a resourceful 4-year-old has strung through the refrigerator handles, so I’ll be sure to see them if I need anything from the kitchen.

    Apparently she thinks we’re going to the pool today.

  • Two for the price of one

    Haven’t done any sneaky puzzles in a while. How would you accomplish this?

    mysql> CREATE TABLE t1 (id int);
    Query OK, 0 rows affected (0.08 sec)
    
    mysql> INSERT INTO t1 VALUES (1);
    Query OK, 1 row affected (0.02 sec)
    
    mysql> SELECT COUNT(*) FROM t1;
    +----------+
    | COUNT(*) |
    +----------+
    |        2 |
    +----------+
    1 row in set (0.00 sec)
  • Kids say the darndest things…

    The white board of amusing child statements:

    Grandfather Clock: “Chime…chime…chime”
    Iona: “Hey, clock! Don’t ding-dong! You’re making me awake!”


    Eden (spinning around in circles): “I’m moving the house! And I’m moving you with the house!”


    Eden: “Why can I not get in the oven?”


    Iona: “What are you guys doing?”
    Daddy: “I don’t know. What are you guys doing?”
    Iona: I’m not two mens! I’m one men!”


    Eden: “You’re not Mommy! You’re a banana!”
    Mommy: “Well then, you’re not Eden, you’re a frog!”
    Eden: “Ribbit! Ribbit! Ribbit!”


    Eden: “You’re a princedad! Put down your computer and get up and dance with me!”

  • Proxy Projects

    When I first heard of MySQL Proxy, I thought, “That’s way cool.”

    Then I thought, “Neat toy, but I can’t think of anything I’d actually want it for. I can spell ‘SELECT’ without the client correcting me, and I’d just as soon use the built in logs. ”

    Now I’m starting to gather ideas that might be practical:
    (more…)