Evil MySQL Tricks

I just ran the following SQL to define a new lbpool replication slave:


mysql> INSERT INTO HOST SET POOLNAME = 'server.db.tailrank.com' AND HOSTNAME = 'server100.tailrank.com';
Query OK, 1 row affected (0.00 sec)

… which is obviously wrong and got back this:


mysql> SELECT * FROM HOST;
+----+-----------------------+---------------------+---------+
| ID | POOLNAME              | HOSTNAME            | OFFLINE |
+----+-----------------------+---------------------+---------+
| 29 | 0                     |                     |       0 |

Yup.. that’s DEF not what I meant to do.

Can you spot the problem? It’s the AND …



%d bloggers like this: