Commit 06ea60d2 authored by Sergey Petrunya's avatar Sergey Petrunya

Make ha_cassandra work with filesort().

parent 81817412
......@@ -45,4 +45,17 @@ rowkey11 NULL NULL
delete from t1;
select * from t1;
rowkey data1 data2
#
# A query with filesort (check that table_flags() & HA_REC_NOT_IN_SEQ,
# also check ::rnd_pos()
#
insert into t1 values ('rowkey10', 'data1-value', 123456);
insert into t1 values ('rowkey11', 'data1-value2', 34543);
insert into t1 values ('rowkey12', 'data1-value3', 454);
select * from t1 order by data2;
rowkey data1 data2
rowkey12 data1-value3 454
rowkey11 data1-value2 34543
rowkey10 data1-value 123456
delete from t1;
drop table t1;
......@@ -84,6 +84,16 @@ select * from t1;
delete from t1;
select * from t1;
--echo #
--echo # A query with filesort (check that table_flags() & HA_REC_NOT_IN_SEQ,
--echo # also check ::rnd_pos()
--echo #
insert into t1 values ('rowkey10', 'data1-value', 123456);
insert into t1 values ('rowkey11', 'data1-value2', 34543);
insert into t1 values ('rowkey12', 'data1-value3', 454);
select * from t1 order by data2;
delete from t1;
drop table t1;
############################################################################
......
......@@ -755,7 +755,10 @@ int ha_cassandra::rnd_init(bool scan)
bool bres;
DBUG_ENTER("ha_cassandra::rnd_init");
if (!scan)
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
{
/* Prepare for rnd_pos() calls. We don't need to anything. */
DBUG_RETURN(0);
}
se->clear_read_columns();
for (uint i= 1; i < table->s->fields; i++)
......
......@@ -78,11 +78,17 @@ class ha_cassandra: public handler
ulonglong table_flags() const
{
/*
We are saying that this engine is just statement capable to have
an engine that can only handle statement-based logging. This is
used in testing.
HA_BINLOG_STMT_CAPABLE
We are saying that this engine is just statement capable to have
an engine that can only handle statement-based logging. This is
used in testing.
HA_REC_NOT_IN_SEQ
If we don't set it, filesort crashes, because it assumes rowids are
1..8 byte numbers
*/
return HA_BINLOG_STMT_CAPABLE;
return HA_BINLOG_STMT_CAPABLE |
HA_REC_NOT_IN_SEQ;
}
/** @brief
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment