View Issue Details

IDProjectCategoryView StatusLast Update
0006437Talermerchant backend API (C)public2020-07-22 21:54
ReporterFlorian Dold Assigned ToChristian Grothoff  
PriorityhighSeveritymajorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Versiongit (master) 
Target Version0.8Fixed in Version0.8 
Summary0006437: errors in database initialization files are not reported
DescriptionWhen there is an error in, say, merchant-0001.sql, the database initialization does not fail. Only later when the merchant tries to actually access the DB, errors are raised because tables were not created.

Instead, the code should already check for errors when executing merchant-0001.sql.

The logs currently make it look like the changes from the sql file were executed successfully (see "Steps to Reproduce" for details).
Steps To ReproduceDo something in merchant-0001.sql that causes the transaction to abort.

The logs will contain something like this:

Jul 22 20:04:28-970467 taler-merchant-dbinit-367481 INFO Applying SQL file `/home/dold/local/share/taler//sql/merchant/merchant-0001.sql' on database postgres:///talercheck
Jul 22 20:04:29-145005 pq-367481 DEBUG Preparing SQL statement `COMMIT' as `end_transaction'

However, running the script manually with "psql -f ..." will show that the transaction was rolled back.
TagsNo tags attached.

Activities

Christian Grothoff

2020-07-22 21:54

manager   ~0016503

Fixed in 422e7a031..8703a0516 (gnunet.git). psql needs the "--set ON_ERROR_STOP=1" argument to actually return with a failure in case of syntax errors in the SQL.

Issue History

Date Modified Username Field Change
2020-07-22 16:47 Florian Dold New Issue
2020-07-22 16:47 Florian Dold Status new => assigned
2020-07-22 16:47 Florian Dold Assigned To => Christian Grothoff
2020-07-22 17:05 Christian Grothoff Priority normal => high
2020-07-22 17:05 Christian Grothoff Severity minor => major
2020-07-22 21:54 Christian Grothoff Note Added: 0016503
2020-07-22 21:54 Christian Grothoff Status assigned => resolved
2020-07-22 21:54 Christian Grothoff Resolution open => fixed
2020-07-22 21:54 Christian Grothoff Fixed in Version => 0.8