Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3506 (ok 3.4.10) Missing set fields and erroneous INSERT query

3.4.9
fixed
1
2013-06-11
2012-01-21
Mario Rohkrämer
No

phpMyAdmin 3.4.5 and 3.4.9 on MySQL 5.5.16 in a fresh xampp-win32-1.7.7 installation:

Using the "Insert" tab, if no option in a set is selected, generated INSERT queries with empty set() field values lack of field names and value placeholders. The result is an error that the number of fields does not match the table definition.

Example:

CREATE TABLE IF NOT EXISTS `ingredient_uses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ingredient` varchar(40) NOT NULL,
`byproduct` varchar(40) NOT NULL,
`general` set('Health','Mana','Mental recovery','Physical recovery') NOT NULL,
`stats` set('Agility','Charisma','Endurance','Intelligence','Strength','Will') NOT NULL,
`power` enum('low','average','high','important') NOT NULL DEFAULT 'average',
PRIMARY KEY (`id`),
KEY `general` (`general`),
KEY `stats` (`stats`),
KEY `power` (`power`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

If I try to insert two datasets using the "Insert" tab, the following SQL query is generated:

INSERT INTO `ps_alchemy`.`ingredient_uses` (
`id` ,
`ingredient` ,
`byproduct` ,
`general` ,
-- `stats` is missing
`power`
)
VALUES (
NULL , 'Feverfew', '', 'Health', 'average' -- a placeholder for the empty set for `stats` is missing
), (
NULL , 'Yarrow', 'Aphrodisiac', 'Physical recovery', 'Endurance', 'low'
)

Such a result was not usual with older MySQL versions. I got reports that it happens for some older phpMyAdmin versions (3.3.x) too. Therefore I wonder if the reason is PHP 5.5.x reporting the structure of tables differently, so phpMyAdmin may fail interpreting it.

Discussion

  • Works correctly on: MySQL 5.1.41, PHP 5.3.1, phpMyAdmin 3.2.4, Windows XP SP3

    Fields missing on: MySQL 5.5.16, PHP 5.3.8, phpMyAdmin 3.4.5 and 3.4.9, Windows 7 SP1

     
  • This bug was fixed in repository and will be part of a future release; thanks for reporting.

     
    • priority: 5 --> 1
    • assigned_to: nobody --> madhuracj
    • summary: Missing set fields and values in generated INSERT query --> (ok 3.4.10) Missing set fields and erroneous INSERT query
    • status: open --> open-fixed
     
  • Marc Delisle
    Marc Delisle
    2012-02-14

    • status: open-fixed --> closed-fixed
     
  • Michal Čihař
    Michal Čihař
    2013-06-11

    • Status: closed-fixed --> fixed