sql2json does not support INSERT INTO ... VALUES(a,b), (c,d) syntax #11

Closed
galz opened this Issue Aug 29, 2016 · 4 comments

Projects

None yet

2 participants

@galz
galz commented Aug 29, 2016

This came up on StackOverflow.

The following syntax for sql2jaon works well and shows both inserted rows:

CREATE TABLE `geo_tags` (
  `gt_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gt_page_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`gt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4507036 DEFAULT CHARSET=binary ROW_FORMAT=DYNAMIC;

INSERT INTO `geo_tags` VALUES (3,487781);
INSERT INTO `geo_tags` VALUES (4,487781);

But using a shorter syntax for the INSERT, which is usually used by mysqldump, would only show the first value:

CREATE TABLE `geo_tags` (
  `gt_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `gt_page_id` int(10) unsigned NOT NULL,
  PRIMARY KEY (`gt_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4507036 DEFAULT CHARSET=binary ROW_FORMAT=DYNAMIC;

INSERT INTO `geo_tags` VALUES (3,487781),  (4,487781);
@galz
galz commented Aug 29, 2016

@martindrapeau - and nice work!! Very useful tool :)

@martindrapeau
Owner

This format is not currently supported. Good feature request.

@martindrapeau
Owner

Fixed. Thanks for reporting. Here is your testcase:
http://www.csvjson.com/sql2json/688575184b1e31c39c1fd8786f0509ec

@galz
galz commented Aug 30, 2016

@martindrapeau - amazing! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment