1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-20 09:07:44 +03:00
Gagan Goel 60eb0f86ec MCOL-5021 non-AUX column files are opened in read-only mode during
the DELETE operation. ColumnOp::readBlock() calls can cause writes
to database files when the active chunk list in ChunkManager is full.
Since non-AUX columns are read-only for the DELETE operation, we prevent
writes of compressed chunks and header for these columns by passing
an isReadOnly flag to CompFileData which indicates whether the column
is read-only or read-write.
2022-08-05 14:40:49 -04:00

113 lines
3.9 KiB
C++

/* Copyright (C) 2014 InfiniDB, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2 of
the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
MA 02110-1301, USA. */
/*****************************************************************************
* $Id: we_colopbulk.cpp 4726 2013-08-07 03:38:36Z bwilkinson $
*
****************************************************************************/
/** @file
* Implementation of the ColumnOpBulk class
*
*/
#include "we_colopbulk.h"
#include <exception>
#include "we_type.h"
#include "we_log.h"
namespace WriteEngine
{
//------------------------------------------------------------------------------
// Default ColumnOpBulk constructor
//------------------------------------------------------------------------------
ColumnOpBulk::ColumnOpBulk()
{
m_compressionType = 0;
}
//------------------------------------------------------------------------------
// Alternate ColumnOpBulk Constructor
//------------------------------------------------------------------------------
ColumnOpBulk::ColumnOpBulk(Log* logger, int compressionType) : ColumnOp(logger)
{
m_compressionType = compressionType;
}
//------------------------------------------------------------------------------
// ColumnOpBulk Destructor
//------------------------------------------------------------------------------
ColumnOpBulk::~ColumnOpBulk()
{
}
//------------------------------------------------------------------------------
// Open specified column file
//------------------------------------------------------------------------------
// @bug 5572 - HDFS usage: add *.tmp file backup flag
IDBDataFile* ColumnOpBulk::openFile(const WriteEngine::Column& column, uint16_t dbRoot, uint32_t partition,
uint16_t segment, std::string& segFile, bool useTmpSuffix,
const char* mode, int ioBuffSize, bool isReadOnly) const
{
return FileOp::openFile(column.dataFile.fid, dbRoot, partition, segment, segFile, mode, column.colWidth,
useTmpSuffix);
}
//------------------------------------------------------------------------------
// Stub for abbreviatedExtent
//------------------------------------------------------------------------------
bool ColumnOpBulk::abbreviatedExtent(IDBDataFile*, int) const
{
throw std::logic_error("Unauthorized use of ColumnOpBulk::abbreviatedExtent");
return false;
}
//------------------------------------------------------------------------------
// Stub for blocksInFile
//------------------------------------------------------------------------------
int ColumnOpBulk::blocksInFile(IDBDataFile*) const
{
throw std::logic_error("Unauthorized use of ColumnOpBulk::blocksInFile");
return 0;
}
//------------------------------------------------------------------------------
// Stub for readBlock
//------------------------------------------------------------------------------
int ColumnOpBulk::readBlock(IDBDataFile*, unsigned char*, const uint64_t)
{
throw std::logic_error("Unauthorized use of ColumnOpBulk::readBlock");
return 0;
}
//------------------------------------------------------------------------------
// Stub for writeBlock
//------------------------------------------------------------------------------
int ColumnOpBulk::saveBlock(IDBDataFile*, const unsigned char*, const uint64_t)
{
throw std::logic_error("Unauthorized use of ColumnOpBulk::saveBlock");
return 0;
}
} // namespace WriteEngine