Skip to content

ANSI mode breaks the tool for some tables #26

@PrzemekMalkowski

Description

@PrzemekMalkowski

When ANSI and/or ANSI_QUOTES is listed in sql_mode, the tool fails to insert rows to some tables.
It works with simple table like this:

mysql [localhost:5727] {msandbox} (test) > show create table t1\G
*************************** 1. row ***************************
       Table: t1
Create Table: CREATE TABLE "t1" (
  "id" int(11) DEFAULT NULL,
  KEY "id" ("id")
)
1 row in set (0.00 sec)
$ mysql_random_data_load test t1 10 -u msandbox -p msandbox --host="127.0.0.1" -P 5727
INFO[2019-06-24T11:56:21+02:00] Starting                                     
   0s [====================================================================] 100%
INFO[2019-06-24T11:56:21+02:00] 10 rows inserted

But does not work for this table:

mysql [localhost:5727] {msandbox} (test) > show create table t3\G
*************************** 1. row ***************************
       Table: t3
Create Table: CREATE TABLE "t3" (
  "id" int(11) NOT NULL AUTO_INCREMENT,
  "tcol01" tinyint(4) DEFAULT NULL,
  "tcol02" smallint(6) DEFAULT NULL,
  "tcol03" mediumint(9) DEFAULT NULL,
  "tcol04" int(11) DEFAULT NULL,
  "tcol05" bigint(20) DEFAULT NULL,
  "tcol06" float DEFAULT NULL,
  "tcol08" decimal(10,2) DEFAULT NULL,
  "tcol09" date DEFAULT NULL,
  "tcol10" datetime DEFAULT NULL,
  "tcol11" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  "tcol12" time DEFAULT NULL,
  "tcol13" year(4) DEFAULT NULL,
  "tcol14" varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  "tcol15" char(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  "tcol16" blob,
  "tcol17" text CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  "tcol18" mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  "tcol19" mediumblob,
  "tcol20" longblob,
  "tcol21" longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  "tcol22" mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci,
  "tcol23" varchar(3) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  "tcol24" varbinary(10) DEFAULT NULL,
  "tcol25" enum('a','b','c') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  "tcol26" set('red','green','blue') CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  "tcol27" float(5,3) DEFAULT NULL,
  "tcol28" double(4,2) DEFAULT NULL,
  PRIMARY KEY ("id","tcol11")
)
1 row in set (0.00 sec)
$ mysql_random_data_load test t3 10 -u msandbox -p msandbox --host="127.0.0.1" -P 5727
INFO[2019-06-24T11:56:49+02:00] Starting                                     
  --- [--------------------------------------------------------------------]   0%
INFO[2019-06-24T11:56:50+02:00] 0 rows inserted             

Tested with

Version   : v0.1.10
Commit    : 77ba5b493094d79318d941ea45f43268115c7be1
Branch    : master
Build     : 2018-10-10T16:39:41-0300
Go version: go1.11.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions