1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Merge pull request #1771 from mariadb-SergeyZefirov/MCOL-2044-update-ranges-during-DML

Mcol 2044 update ranges during dml
This commit is contained in:
Roman Nozdrin
2021-04-06 12:46:02 +03:00
committed by GitHub
198 changed files with 2949 additions and 275 deletions

View File

@ -176,6 +176,11 @@ public:
UNDEFINED, /*!< Undefined - used in UDAF API */ UNDEFINED, /*!< Undefined - used in UDAF API */
}; };
// XXX: It is assumed here that ALL TYPES have width, scale and precision.
// XXX: And then some of them have the type tag itself.
// XXX: But, all types have type tag, some need explicit width (decimals, for example)
// XXX: and then some should have scale and precision (decimals, I guess).
// XXX: Current hierarchy is not all that straightforward to work with.
class TypeAttributesStd class TypeAttributesStd
{ {
public: public:
@ -608,7 +613,59 @@ public:
{ {
int128Min = datatypes::minInt128; int128Min = datatypes::minInt128;
int128Max = datatypes::maxInt128; int128Max = datatypes::maxInt128;
}; }
/** @brief Returns ranges that is invalid for all signed values, both small and wide. */
static MinMaxInfo invalidSignedRange()
{
MinMaxInfo tmp;
tmp.min = std::numeric_limits<int64_t>::max();
tmp.max = std::numeric_limits<int64_t>::min();
tmp.int128Max = datatypes::minInt128;
tmp.int128Min = datatypes::maxInt128;
return tmp;
}
/** @brief Returns ranges that is invalid for all unsigned values, both small and wide. */
static MinMaxInfo invalidUnsignedRange()
{
MinMaxInfo tmp;
tmp.min = static_cast<int64_t>(std::numeric_limits<uint64_t>::max());
tmp.max = static_cast<int64_t>(std::numeric_limits<uint64_t>::min());
tmp.int128Max = datatypes::minInt128; // please bear in mind that DECIMAL(38) UNSIGNED
// has representable range 0..10^38-1 which is well
// inside int128 representable range.
tmp.int128Min = datatypes::maxInt128;
return tmp;
}
/** @brief convenience function for simpler access to invalid range. */
static MinMaxInfo invalidRange(datatypes::SystemCatalog::ColDataType colType)
{
return isUnsigned(colType) ? invalidUnsignedRange() : invalidSignedRange();
}
/** @brief Internal: type-casting comparison. */
template <typename CompareAs, typename ValueType>
static bool greaterThan(ValueType a, ValueType b)
{
return static_cast<CompareAs>(a) > static_cast<CompareAs>(b);
}
/** @brief Check if range is valid
*
* A more general approach to check non-nullness of the range than
* explicit comparison with invalid bounds.
*/
static bool isRangeInvalid(const MinMaxInfo& mm, datatypes::SystemCatalog::ColDataType colType, int colWidth)
{
if (colWidth > 8)
{
return isUnsigned(colType) ? greaterThan<uint128_t, int128_t>(mm.int128Min, mm.int128Max)
: greaterThan<int128_t, int128_t>(mm.int128Min, mm.int128Max);
}
else
{
return isUnsigned(colType) ? greaterThan<uint64_t, int64_t>(mm.min, mm.max)
: greaterThan<int64_t, int64_t>(mm.min, mm.max);
}
}
bool isEmptyOrNullSInt64() const bool isEmptyOrNullSInt64() const
{ {
return min == std::numeric_limits<int64_t>::max() && return min == std::numeric_limits<int64_t>::max() &&

View File

@ -430,7 +430,14 @@ CommandPackageProcessor::processPackage(dmlpackage::CalpontDMLPackage& cpackage)
if (!cpInvalidated) if (!cpInvalidated)
{ {
fDbrm->invalidateUncommittedExtentLBIDs(0, &lbidList); // The code below assumes that in case of COMMIT all ranges for all touched LBIDs
// are either correctly set or correctly reset.
// It is also assumes that ROLLBACK or other operations but COMMIT may not return ranges
// to state that is correct. This is why we invalidate extents when we are not committing.
if (stmt != "COMMIT")
{
fDbrm->invalidateUncommittedExtentLBIDs(0, &lbidList);
}
} }
} }
} }

View File

@ -485,37 +485,7 @@ int DMLPackageProcessor::commitBatchAutoOnTransaction(uint64_t uniqueId, BRM::Tx
//set CP data before hwm. //set CP data before hwm.
//cout << "setting hwm allHwm size " << allHwm.size() << endl; //cout << "setting hwm allHwm size " << allHwm.size() << endl;
vector<BRM::LBID_t> lbidList;
if (idbdatafile::IDBPolicy::useHdfs())
{
BRM::LBID_t startLbid;
for ( unsigned i = 0; i < allHwm.size(); i++)
{
rc = fDbrm->lookupLocalStartLbid(allHwm[i].oid, allHwm[i].partNum, allHwm[i].segNum, allHwm[i].hwm, startLbid);
lbidList.push_back(startLbid);
}
}
else
fDbrm->getUncommittedExtentLBIDs(static_cast<BRM::VER_t>(txnID.id), lbidList);
vector<BRM::LBID_t>::const_iterator iter = lbidList.begin();
vector<BRM::LBID_t>::const_iterator end = lbidList.end();
BRM::CPInfoList_t cpInfos; BRM::CPInfoList_t cpInfos;
BRM::CPInfo aInfo;
while (iter != end)
{
aInfo.firstLbid = *iter;
aInfo.max = numeric_limits<int64_t>::min(); // Not used
aInfo.min = numeric_limits<int64_t>::max(); // Not used
utils::int128Min(aInfo.bigMax); // Not used
utils::int128Max(aInfo.bigMin); // Not used
aInfo.seqNum = -1;
cpInfos.push_back(aInfo);
++iter;
}
std::vector<BRM::CPInfoMerge> mergeCPDataArgs; std::vector<BRM::CPInfoMerge> mergeCPDataArgs;
rc = fDbrm->bulkSetHWMAndCP(allHwm, cpInfos, mergeCPDataArgs, txnID.id); rc = fDbrm->bulkSetHWMAndCP(allHwm, cpInfos, mergeCPDataArgs, txnID.id);

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x decimal(38)) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
NULL NULL
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x bigint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x integer unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x smallint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,13 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
delete from t where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
delete from t where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,11 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=66;
insert into t(x) values (77), (22);
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
0 -1
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=77 where x=66;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
77 44
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=33 where x=44;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 33
drop database test_ranges;

View File

@ -0,0 +1,10 @@
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
create table t(x tinyint unsigned) engine=columnstore;
insert into t(x) values (44),(55),(66);
update t set x=65 where x=55;
select max_value, min_value from information_schema.columnstore_extents;
max_value min_value
66 44
drop database test_ranges;

View File

@ -0,0 +1,13 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@ -0,0 +1,13 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
select max_value, min_value from information_schema.columnstore_extents;
delete from t where x=66; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@ -0,0 +1,11 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
delete from t where x=55; # range must stay 44..66.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@ -0,0 +1,12 @@
# tests updates within range.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=66; # range must drop to invalid
insert into t(x) values (77), (22); # range must stay invalid.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@ -0,0 +1,11 @@
# tests updates that sets invalid range when we set value at max boundary that is less than max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must drop to invalid
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@ -0,0 +1,12 @@
# tests updates that range when we updating min value to value that is bigger than min.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=65 where x=44; # range must be invalid now.
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

View File

@ -0,0 +1,11 @@
# tests updates that extend max range, for values at max.
--disable_warnings
create database if not exists test_ranges;
use test_ranges;
drop table if exists t;
--enable_warnings
create table t(x bigint) engine=columnstore;
insert into t(x) values (44),(55),(66); # range must be 44..66.
update t set x=77 where x=66; # range must be 44..77
select max_value, min_value from information_schema.columnstore_extents;
drop database test_ranges;

Some files were not shown because too many files have changed in this diff Show More