[MDEV-31331] preinst broken due to unset variable Created: 2023-05-23  Updated: 2023-06-07  Resolved: 2023-05-31

Status: Closed
Project: MariaDB Server
Component/s: Platform Debian
Affects Version/s: 10.6.13
Fix Version/s: 10.6.15, 10.9.8, 10.10.6, 10.11.5, 11.1.2

Type: Bug Priority: Critical
Reporter: William Edwards Assignee: Tuukka Pasanen
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Issue split
split to MDEV-31367 Fail on undefined variables in Debian... Open
Relates
relates to MDEV-31423 /etc/init.d/mariadb: line 90: [: : in... Closed

 Description   

Commit fe32a4a broke `debian/mariadb-server.preinst`, which causes the following error on install and upgrade. Tested with upgrade from 10.6.12 to 10.6.13.

df: '': No such file or directory
/var/lib/dpkg/tmp.ci/preinst: line 215: [: : integer expression expected

The `df` command (on line 201 in the 11.1 branch) refers to the unset variable `$datadir`. The variable that is set is `$mysql_datadir`.



 Comments   
Comment by Tuukka Pasanen [ 2023-05-30 ]

Thank you for reporting this! Corrected cut'n'paste problem and I'll make shortly PR that should sort this out.

Comment by William Edwards [ 2023-05-30 ]

@illuusio Perhaps it would be useful to use `set -u` to prevent such mistakes in the future.

Comment by Tuukka Pasanen [ 2023-05-30 ]

Very good point indeed and yes I think it would be nice add. Could you open JIRA task for that and point it to me?

Besides that here are Salsa-CI (they should be ok with Debian 12) builded debs that should fix issue. I'll give them testing and commit PR if they are ok. If you have docker or similar to test could you also give them a try?

Comment by Tuukka Pasanen [ 2023-05-30 ]

But actually you can't test MariaDB 10.6 on Debian 12 so I'll make a PR soon which builds correct debs

Comment by William Edwards [ 2023-05-30 ]

Created Jira issue MDEV-31367.

Comment by Tuukka Pasanen [ 2023-05-30 ]

Thanks now there is PR: #2650

Comment by Daniel Black [ 2023-05-31 ]

good

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