Table doesn't exist in multi delete
Posted: Wed Apr 25, 2007 10:50 am
Can anybody tell me way MySQL thinks a table doesn't exist for the purposes of a multi-delete only and is fine for everything else?
Code: Select all
mysql> SHOW CREATE TABLE `Job`\G
*************************** 1. row ***************************
Table: Job
Create Table: CREATE TABLE `Job` (
`jobId` int(10) unsigned NOT NULL COMMENT 'Job number',
`title` varchar(255) NOT NULL,
`subtitle` varchar(255) default NULL,
`hasApproval` tinyint(1) NOT NULL default '0',
`approvalBody` mediumtext,
`hasPassword` tinyint(1) NOT NULL default '0',
`_passwordId` int(10) unsigned default NULL,
PRIMARY KEY (`jobId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> SHOW CREATE TABLE `Password`\G
*************************** 1. row ***************************
Table: Password
Create Table: CREATE TABLE `Password` (
`passwordId` int(10) unsigned NOT NULL auto_increment,
`text` char(32) NOT NULL,
`isHashed` tinyint(1) NOT NULL default '1',
PRIMARY KEY (`passwordId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> DELETE `Password` FROM `Job` WHERE `passwordId` = `_passwordId` AND `jobId` = 1;
ERROR 1109 (42S02): Unknown table 'Password' in MULTI DELETE -------- what's going on here?!
mysql> DELETE FROM `Password`;
Query OK, 0 rows affected (0.00 sec)
mysql> SELECT VERSION();
+---------------------------------+
| VERSION() |
+---------------------------------+
| 5.0.22-Debian_0ubuntu6.06.2-log |
+---------------------------------+
1 row in set (0.00 sec)