When trying to edit a row in a many-to-many table with no primary key defined and a binary value, I receive this message:
"MySQL returned an empty result set (i.e. zero rows)."
The problem is related to the binary field and the way it is received from the web browser. Here is the table structure with some data:
--
-- Table structure for table `clients_addresses`
--
CREATE TABLE IF NOT EXISTS `clients_addresses` (
`client_id` int(11) NOT NULL,
`address_id` int(11) NOT NULL,
`primary_address` bit(1) NOT NULL DEFAULT '>',
KEY `client_id` (`client_id`),
KEY `address_id` (`address_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
INSERT INTO `clients_addresses` (`client_id`, `address_id`, `primary_address`) VALUES
(2001, 1, '>'),
(2002, 2, '>'),
(2003, 3, '>'),
(2004, 4, '>'),
(2005, 5, '>')
As you can see in the attached screen shot of the address bar, this is what shows up. If I change the binary box in the address bar to 0001 everything works just fine. I am unsure if this is a browser or phpMyAdmin problem.
Regan
Screenshot of Address Bar
Cannot create your example table, I receive:
#1067 - Invalid default value for 'primary_address'
under MySQL 5.1.34
Sorry, I forgot to mention that where you see the > in the INSERT field, that should be a binary 1 (00000001).
Moved to bugs.
Fixed in subversion, thanks for reporting.