[MDEV-15789] mysqlslap --auto-generate-sql-guid-primary and --auto-generate-sql-secondary-indexes use incorrect table definition Created: 2018-04-05  Updated: 2020-08-25  Resolved: 2018-06-07

Status: Closed
Project: MariaDB Server
Component/s: Scripts & Clients
Affects Version/s: 10.2.14
Fix Version/s: 5.5.61, 10.0.36, 10.1.34, 10.2.16, 10.3.8, 10.4.0

Type: Bug Priority: Major
Reporter: Chris Calender (Inactive) Assignee: Sergey Vojtovich
Resolution: Fixed Votes: 0
Labels: patch


 Description   

Note this is an upstream bug in mysqlslap:

https://bugs.mysql.com/bug.php?id=80329

But, the bug arises when one uses --auto-generate-sql-guid-primary (and --auto-generate-sql-secondary-indexes) with mysqlslap and also have sql_mode=STRICT_TRANS_TABLE.

When using this option, mysqlslap should create a column with varchar(36), but it appears to create it as a varchar(32) only. Then if one has sql_mode=STRICT_TRANS_TABLES, it throws an error, like:

mysqlslap: Cannot run query INSERT INTO t1 VALUES (uuid(),1804289383,846930886,1681692777,1714636915,1957747793,'vmC9127qJNm06sGB8R92q2j7vTiiITRDGXM9ZLzkdekbWtmXKwZ2qG1llkRw5m9DHOFilEREk3q7oce8O3BEJC0woJsm6uzFAEynLH2xCsw1KQ1lT4zg9rdxBLb97R','GHZ65mNzkSrYT3zWoSbg9cNePQr1bzSk81qDgE4Oanw3rnPfGsBHSbnu1evTdFDe83ro9w4jjteQg4yoo9xHck3WNqzs54W5zEm92ikdRF48B2oz3m8gMBAl11Wy50','w46i58Giekxik0cYzfA8BZBLADEg3JhzGfZDoqvQQk0Akcic7lcJInYSsf9wqin6LDC1vzJLkJXKn5onqOy04MTw1WksCYqPl2Jg2eteqOqTLfGCvE4zTZwWvgMz4D','Ph7kD1E6f4MMQk1ioopsoIIcoD83DD8Wu7689K6oHTAjD3Hts6lYGv8x9G0EL0k87q8G2ExJjz2o3KhnIJBbEJYFROTpO5pNvxgyBT9nSCbNO9AiKL9QYhi0x3hL9W','lwRHuWm4HE8leYmg66uGYIp6AnAr0BDd7YmuvYqCfqp9EbhKZRSymA4wx6gpHlJHI53DetH9j7Ixar90Jey5outd1ZIAJdJTjMaD7rMiqYXHFhHaB7Xr1HKuqe51GG') ERROR : Data too long for column 'id' at row 1

Table structure of t1 in 'mysqlslap' schema:

CREATE TABLE `t1` (
  `id` varchar(32) NOT NULL,
  `intcol1` int(32) DEFAULT NULL,
  `charcol1` varchar(128) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1



 Comments   
Comment by Chris Calender (Inactive) [ 2018-04-17 ]

Submitted patch here:

https://github.com/MariaDB/server/pull/708

Comment by Chris Calender (Inactive) [ 2018-04-17 ]

C:\wpafb\area51>diff mysqlslap.c mysqlslap-10.0.35.c
856c856
<     dynstr_append(&table_string, "id varchar(36) primary key");
---
>     dynstr_append(&table_string, "id varchar(32) primary key");

Comment by Chris Calender (Inactive) [ 2018-06-05 ]

I've completed a majority of the remaining steps (all that I can, and have updated the following accordingly:

https://github.com/MariaDB/server/pull/708

Please advise if I need to do anything further.

Comment by Sergey Vojtovich [ 2018-06-07 ]

Fix pushed to 5.5, rev. d9b159a2027c56c5c87385cfe1ae43b8c73a97b6

Generated at Thu Feb 08 08:24:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.