View Issue Details

IDProjectCategoryView StatusLast Update
0026568mantisbtinstallationpublic2020-03-15 15:23
Reporterdregad Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version2.24.0Fixed in Version2.24.0 
Summary0026568: Use appropriate statement to update DB schema when generating SQL
Description

When the installer is used to generate SQL instead of directly creating the database, the last statement printed is a hardcoded INSERT to create the database_version key in the config table.

This does not consider the case of an upgrade, where the record already exists, so running the script as-is triggers an SQL error, e.g.:
ERROR 1062 (23000): Duplicate entry 'database_version-0-0' for key 'PRIMARY'

Since the installer knows whether it is installing a new database or upgrading an existing one, an UPDATE statement should be generated instead in the latter case.

TagsNo tags attached.

Relationships

related to 0026556 closeddregad Upgrading from 2.22.0 crashed when updating database 
related to 0026662 closeddregad Final statement to set database version not logged in SQL script 

Activities

Related Changesets

MantisBT: master 412f855f

2020-01-06 09:54:18

dregad

Details Diff
Use UPDATE/INSERT to update DB schema

When the installer is used to generate SQL instead of directly creating
the database, the last statement printed was a hardcoded INSERT to
create the database_version key in the config table.

This did not consider the case of an upgrade, where the record already
exists, so running the script as-is caused a duplicate key SQL error.

Since the installer knows whether it is installing a new database or
upgrading an existing one, an UPDATE statement should be generated
instead in the latter case.

Fixes 0026568
Affected Issues
0026568
mod - admin/install.php Diff File

Issue History

Date Modified Username Field Change
2020-01-06 09:12 dregad New Issue
2020-01-06 09:12 dregad Status new => assigned
2020-01-06 09:12 dregad Assigned To => dregad
2020-01-06 09:13 dregad Relationship added related to 0026556
2020-01-06 09:15 dregad Summary Install: generate appropriate SQL to update DB schema => Use appropriate statement to update DB schema when generating SQL
2020-02-02 14:07 dregad Relationship added related to 0026662
2020-02-02 14:29 dregad Note Added: 0063552
2020-02-17 05:05 dregad Changeset attached => MantisBT master 412f855f
2020-02-17 05:05 dregad Status assigned => resolved
2020-02-17 05:05 dregad Resolution open => fixed
2020-02-17 05:05 dregad Fixed in Version => 2.24.0
2020-03-15 15:23 vboctor Status resolved => closed