#3282 (ok 3.4.0-rc2) Insert ajax form generate wrong query.

3.4.0
fixed
AJAX (99)
1
2013-06-11
2011-04-23
No

I tried to select insert with 5 rows (or 10 rows is the same, just do not choose default 2 rows) and make an insert into following table:

-- phpMyAdmin SQL Dump
-- version 3.4.0-rc1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 23, 2011 at 05:46 PM
-- Server version: 5.1.33
-- PHP Version: 5.2.9

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";

--
-- Database: `game_tat`
--

-- --------------------------------------------------------

--
-- Table structure for table `tat_data_item_collection`
--

CREATE TABLE IF NOT EXISTS `tat_data_item_collection` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`codename` varchar(50) DEFAULT NULL,
`image_name` varchar(50) NOT NULL,
`description` text NOT NULL,
`dropable` tinyint(1) NOT NULL DEFAULT '1',
`collection_id` int(11) DEFAULT NULL,
`is_showcase` tinyint(4) NOT NULL DEFAULT '0',
`data_serialized` text NOT NULL,
`enable` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;

--
-- Dumping data for table `tat_data_item_collection`
--

INSERT INTO `tat_data_item_collection` (`id`, `name`, `codename`, `image_name`, `description`, `dropable`, `collection_id`, `is_showcase`, `data_serialized`, `enable`) VALUES
(1, 'collection_1_1', 'collection_1_1', 'collections/collection_1_1.png', '1', 1, 0, 1, '', 1),
(2, 'collection_1_2', 'collection_1_2', 'collections/collection_1_2.png', '1', 1, 0, 1, '', 1),
(3, 'collection_1_3', 'collection_1_3', 'collections/collection_1_3.png', '1', 1, 0, 1, '', 1),
(4, 'collection_1_4', 'collection_1_4', 'collections/collection_1_4.png', '1', 1, 0, 1, '', 1),
(5, 'collection_1_5', 'collection_1_5', 'collections/collection_1_5.png', '1', 1, 0, 1, '', 1),
(6, 'collection_1_6', 'collection_1_6', 'collections/collection_1_6.png', '0', 1, 1, 1, '', 1);

It generate below query when I input 3 row data:

INSERT INTO `game_tat`.`tat_data_item_collection` (`id`, `name`, `codename`, `image_name`, `description`, `dropable`, `collection_id`, `is_showcase`, `data_serialized`, `enable`) VALUES
(NULL , '1', '2', '3', '4', '5', '6', '7', '8', '9'),
(NULL , '1', '2', '3', '', '5', '6', '7', '', '9'),
(NULL , '1', '2', '3', '5', '6', '7', '9');

Expected result should be:

INSERT INTO `game_tat`.`tat_data_item_collection` (`id`, `name`, `codename`, `image_name`, `description`, `dropable`, `collection_id`, `is_showcase`, `data_serialized`, `enable`) VALUES
(NULL, '1', '2', '3', '4', '5', '6', '7', '8', '9'),
(NULL, '1', '2', '3', '4', '5', '6', '7', '8', '9'),
(NULL, '1', '2', '3', '4', '5', '6', '7', '8', '9');

You can see that there's some value missing like '4' and '8' in row 2 and missing value in row 3

Discussion

  • Marc Delisle

    Marc Delisle - 2011-04-24
    • priority: 5 --> 1
    • assigned_to: nobody --> lem9
    • summary: Insert ajax form generate wrong query. --> (ok 3.4.0-rc2) Insert ajax form generate wrong query.
    • status: open --> open-fixed
     
  • Marc Delisle

    Marc Delisle - 2011-04-24

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

     
  • Marc Delisle

    Marc Delisle - 2011-04-26
    • status: open-fixed --> closed-fixed
     
  • Michal Čihař

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

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks