db: fix leftovers from #3716
This commit is contained in:
parent
10b693ace4
commit
ffe1ec4cb9
@ -182,7 +182,7 @@ postgres_create_tables (void *cls,
|
|||||||
SQLEXEC ("CREATE TABLE IF NOT EXISTS reserves"
|
SQLEXEC ("CREATE TABLE IF NOT EXISTS reserves"
|
||||||
"("
|
"("
|
||||||
" reserve_pub BYTEA PRIMARY KEY"
|
" reserve_pub BYTEA PRIMARY KEY"
|
||||||
",current_balance_value INT4 NOT NULL"
|
",current_balance_value INT8 NOT NULL"
|
||||||
",current_balance_fraction INT4 NOT NULL"
|
",current_balance_fraction INT4 NOT NULL"
|
||||||
",balance_currency VARCHAR(4) NOT NULL"
|
",balance_currency VARCHAR(4) NOT NULL"
|
||||||
",expiration_date INT8 NOT NULL"
|
",expiration_date INT8 NOT NULL"
|
||||||
@ -194,7 +194,7 @@ postgres_create_tables (void *cls,
|
|||||||
SQLEXEC("CREATE TABLE IF NOT EXISTS reserves_in"
|
SQLEXEC("CREATE TABLE IF NOT EXISTS reserves_in"
|
||||||
"("
|
"("
|
||||||
" reserve_pub BYTEA REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
|
" reserve_pub BYTEA REFERENCES reserves (reserve_pub) ON DELETE CASCADE"
|
||||||
",balance_value INT4 NOT NULL"
|
",balance_value INT8 NOT NULL"
|
||||||
",balance_fraction INT4 NOT NULL"
|
",balance_fraction INT4 NOT NULL"
|
||||||
",balance_currency VARCHAR(4) NOT NULL"
|
",balance_currency VARCHAR(4) NOT NULL"
|
||||||
",expiration_date INT8 NOT NULL"
|
",expiration_date INT8 NOT NULL"
|
||||||
@ -217,7 +217,7 @@ postgres_create_tables (void *cls,
|
|||||||
" coin_pub BYTEA NOT NULL PRIMARY KEY"
|
" coin_pub BYTEA NOT NULL PRIMARY KEY"
|
||||||
",denom_pub BYTEA NOT NULL"
|
",denom_pub BYTEA NOT NULL"
|
||||||
",denom_sig BYTEA NOT NULL"
|
",denom_sig BYTEA NOT NULL"
|
||||||
",expended_value INT4 NOT NULL"
|
",expended_value INT8 NOT NULL"
|
||||||
",expended_fraction INT4 NOT NULL"
|
",expended_fraction INT4 NOT NULL"
|
||||||
",expended_currency VARCHAR(4) NOT NULL"
|
",expended_currency VARCHAR(4) NOT NULL"
|
||||||
",refresh_session_hash BYTEA"
|
",refresh_session_hash BYTEA"
|
||||||
@ -280,7 +280,7 @@ postgres_create_tables (void *cls,
|
|||||||
",denom_sig BYTEA NOT NULL"
|
",denom_sig BYTEA NOT NULL"
|
||||||
",transaction_id INT8 NOT NULL"
|
",transaction_id INT8 NOT NULL"
|
||||||
",amount_currency VARCHAR(4) NOT NULL"
|
",amount_currency VARCHAR(4) NOT NULL"
|
||||||
",amount_value INT4 NOT NULL"
|
",amount_value INT8 NOT NULL"
|
||||||
",amount_fraction INT4 NOT NULL"
|
",amount_fraction INT4 NOT NULL"
|
||||||
",merchant_pub BYTEA NOT NULL CHECK (length(merchant_pub)=32)"
|
",merchant_pub BYTEA NOT NULL CHECK (length(merchant_pub)=32)"
|
||||||
",h_contract BYTEA NOT NULL CHECK (length(h_contract)=64)"
|
",h_contract BYTEA NOT NULL CHECK (length(h_contract)=64)"
|
||||||
|
@ -179,7 +179,7 @@ TALER_DB_extract_amount_nbo (PGresult *result,
|
|||||||
curr_num = PQfnumber (result, curr_name);
|
curr_num = PQfnumber (result, curr_name);
|
||||||
GNUNET_assert (curr_num >= 0);
|
GNUNET_assert (curr_num >= 0);
|
||||||
|
|
||||||
r_amount_nbo->value = *(uint32_t *) PQgetvalue (result, row, val_num);
|
r_amount_nbo->value = *(uint64_t *) PQgetvalue (result, row, val_num);
|
||||||
r_amount_nbo->fraction = *(uint32_t *) PQgetvalue (result, row, frac_num);
|
r_amount_nbo->fraction = *(uint32_t *) PQgetvalue (result, row, frac_num);
|
||||||
memset (r_amount_nbo->currency,
|
memset (r_amount_nbo->currency,
|
||||||
0,
|
0,
|
||||||
@ -212,7 +212,7 @@ TALER_DB_extract_amount (PGresult *result,
|
|||||||
frac_name,
|
frac_name,
|
||||||
curr_name,
|
curr_name,
|
||||||
&amount_nbo);
|
&amount_nbo);
|
||||||
r_amount->value = ntohl (amount_nbo.value);
|
r_amount->value = GNUNET_ntohll (amount_nbo.value);
|
||||||
r_amount->fraction = ntohl (amount_nbo.fraction);
|
r_amount->fraction = ntohl (amount_nbo.fraction);
|
||||||
(void) strncpy (r_amount->currency, amount_nbo.currency, TALER_CURRENCY_LEN);
|
(void) strncpy (r_amount->currency, amount_nbo.currency, TALER_CURRENCY_LEN);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user