Patch: Database errors when building Yocto-Yoe


Sebert, Holger.ext
 

Hi,

during a project build using Toaster and a MySQL database, there are some
database errors due to insufficient size of the data fields. This patch includes
the necessary changes in the ORM, including proper migration methods.

The implementation follows the lines of

https://www.yoctoproject.org/pipermail/toaster/2018-October/005718.html

The offensive SQL errors and queries are as follows:

* `django.db.utils.DataError: (1264, "Out of range value for column 'disk_io' at row 1")`
```
UPDATE `orm_task`
SET `build_id` = 30,
`order` = 1576,
`task_executed` = 1,
`outcome` = 0,
`sstate_checksum` = 'e47a7bb240056b47b297eea760616408ab4daad32a05f3cf86973a4d3427f8e3',
`path_to_sstate_obj` = '',
`recipe_id` = 47597,
`task_name` = 'do_unpack',
`source_url` = '',
`work_directory` = '',
`script_type` = 2,
`line_number` = 0,
`started` = '2020-11-16 11:11:30.680000',
`ended` = '2020-11-16 11:12:28.030000',
`elapsed_time` = '57.35',
`disk_io` = 2458021888,
`disk_io_read` = 269443072,
`disk_io_write` = 2188578816,
`cpu_time_user` = '28.78',
`cpu_time_system` = '12.24',
`sstate_result` = 0,
`message` = 'recipe mozjs-60.9.0-r0: task do_unpack: Succeeded',
`logfile` = '/home/holger/data/Yocto/yocto-yoe-toaster/build/tmp/work/armv7at2hf-neon-ks-linux-gnueabi/mozjs/60.9.0-r0/temp/log.do_unpack.3422'
WHERE `orm_task`.`id` = 78884
```

* `django.db.utils.DataError: (1406, "Data too long for column 'file_name' at row 1")`
```
INSERT INTO `orm_targetkernelfile` (`target_id`, `file_name`, `file_size`)
VALUES (18, '/home/holger/data/Yocto/yocto-yoe-toaster/build/tmp/deploy/images/am335x-diva/zImage--5.4.40+git0+7f8dc0f36a-0a.2-am335x-diva-20201109102412.bin', 4628992)
```

* `django.db.utils.DataError: (1406, "Data too long for column 'license' at row 1")`
```
UPDATE `orm_package`
SET `build_id` = 26,
`recipe_id` = 45765,
`name` = 'qtbase',
`installed_name` = 'qtbase',
`version` = '5.14.1+gitAUTOINC+0ab53fbdda',
`revision` = 'r0',
`summary` = 'qtbase version 5.14.1+gitAUTOINC+0ab53fbdda-r0',
`description` = 'qtbase version 5.14.1+gitAUTOINC+0ab53fbdda-r0.',
`size` = 17123154,
`installed_size` = 17123328,
`section` = 'base',
`license` = 'GFDL-1.3 & BSD & ( GPL-3.0 & The-Qt-Company-GPL-Exception-1.0 | The-Qt-Company-Commercial ) & ( GPL-2.0+ | LGPL-3.0 | The-Qt-Company-Commercial )'
WHERE `orm_package`.`id` = 18159"
```

Could you please review the patch? If it's o.k., I would prepare a pull-request and try to bring it
upstream.

Best,
Holger