Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
312 stars 134 forks source link

Coredump when saving in the water editor #724

Open mikfire opened 1 year ago

mikfire commented 1 year ago

To reproduce:

  1. Select any recipe
  2. Go to Tools -> Water Chemistry
  3. Select a base and target profile
  4. Add any salt
  5. click save
[09:44:34.936] (1diamhzmww) ERROR : int ObjectStore::impl::insertObjectInDb(QSqlDatabase&, const QObject&, bool) Error executing database query  "INSERT INTO salt (name, deleted, display, folder, addTo, amount, amount_is_weight, is_acid, percent_acid, stype) VALUES (:name, :deleted, :display, :folder, :addTo, :amount, :amount_is_weight, :is_acid, :percent_acid, :stype);" :  "ERROR:  column \"mash\" does not exist\nLINE 1: EXECUTE qpsqlpstmt_3 ('CaCl2', FALSE, TRUE, NULL, MASH, 0.00...\n                                                          ^\n(42703) QPSQL: Unable to create query"  [database/ObjectStore.cpp:756]
[09:44:34.937] (1diamhzmww) WARNING : Unable to free statement: ERROR:  current transaction is aborted, commands ignored until end of transaction block
  [:0]
[09:44:34.937] (1diamhzmww) ERROR : bool DbTransaction::commit() Unable to commit database transaction: "() QPSQL: Could not commit transaction"  [database/DbTransaction.cpp:67]
WARNING:  there is no transaction in progress
[09:44:34.939] (1diamhzmww) ERROR : int ObjectStore::impl::insertObjectInDb(QSqlDatabase&, const QObject&, bool) Error executing database query  "INSERT INTO salt (name, deleted, display, folder, addTo, amount, amount_is_weight, is_acid, percent_acid, stype) VALUES (:name, :deleted, :display, :folder, :addTo, :amount, :amount_is_weight, :is_acid, :percent_acid, :stype);" :  "ERROR:  column \"mash\" does not exist\nLINE 1: EXECUTE qpsqlpstmt_4 ('CaCl2', FALSE, TRUE, NULL, MASH, 0.00...\n                                                          ^\n(42703) QPSQL: Unable to create query"  [database/ObjectStore.cpp:756]
[09:44:34.940] (1diamhzmww) WARNING : Unable to free statement: ERROR:  current transaction is aborted, commands ignored until end of transaction block
  [:0]
[09:44:34.940] (1diamhzmww) ERROR : ASSERT: "!this->pimpl->allObjects.contains(primaryKey)" in file /home/mik/brewtarget/mik/src/database/ObjectStore.cpp, line 1224  [database/ObjectStore.cpp:1224]
matty0ung commented 1 year ago

I couldn't reproduce this, and the error message is a bit puzzling. Am I right in remembering you run PostgreSQL? I'm wondering if there's some bug in the code that's supposed to abstract away that database-specific bits of SQL.