mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd::db: Allow null column transactions to be ignored rather than erroneous.
This commit is contained in:
parent
918bc95d1a
commit
0652dfbc59
1 changed files with 24 additions and 3 deletions
27
ircd/db.cc
27
ircd/db.cc
|
@ -8619,7 +8619,11 @@ ircd::db::txn::append::append(txn &t,
|
|||
database &d,
|
||||
const delta &delta)
|
||||
{
|
||||
db::column c{d[std::get<1>(delta)]};
|
||||
db::column c
|
||||
{
|
||||
d[std::get<1>(delta)]
|
||||
};
|
||||
|
||||
db::append(*t.wb, c, db::column::delta
|
||||
{
|
||||
std::get<op>(delta),
|
||||
|
@ -10609,7 +10613,11 @@ void
|
|||
ircd::db::append(rocksdb::WriteBatch &batch,
|
||||
const cell::delta &delta)
|
||||
{
|
||||
auto &column(std::get<cell *>(delta)->c);
|
||||
auto &column
|
||||
{
|
||||
std::get<cell *>(delta)->c
|
||||
};
|
||||
|
||||
append(batch, column, column::delta
|
||||
{
|
||||
std::get<op>(delta),
|
||||
|
@ -10623,8 +10631,21 @@ ircd::db::append(rocksdb::WriteBatch &batch,
|
|||
column &column,
|
||||
const column::delta &delta)
|
||||
{
|
||||
database::column &c(column);
|
||||
if(unlikely(!column))
|
||||
{
|
||||
// Note: Unknown at this time whether allowing attempts at writing
|
||||
// to a null column should be erroneous or silently ignored. It's
|
||||
// highly likely this log message will be removed soon to allow
|
||||
// toggling database columns for optimization without touching calls.
|
||||
log::critical
|
||||
{
|
||||
log, "Attempting to transact a delta for a null column"
|
||||
};
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
database::column &c(column);
|
||||
const auto k(slice(std::get<1>(delta)));
|
||||
const auto v(slice(std::get<2>(delta)));
|
||||
switch(std::get<0>(delta))
|
||||
|
|
Loading…
Reference in a new issue