1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-431: Cassandra storage engine

- Descriptive error messages
- Unpack PK column on range scans
This commit is contained in:
Sergey Petrunya
2012-08-19 12:50:53 +04:00
parent 9cdf5eeec9
commit d36259703b
6 changed files with 149 additions and 33 deletions

View File

@ -13,15 +13,26 @@ thrift_host='localhost' keyspace='no_such_keyspace' column_family='colfam';
ERROR HY000: Unable to connect to foreign data source: Default TException. [Keyspace no_such_keyspace does not exist]
create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
thrift_host='localhost' keyspace='no_such_keyspace';
ERROR HY000: Can't create table 'test.t1' (errno: 140)
create table t1 (rowkey char(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
ERROR HY000: Unable to connect to foreign data source: thrift_host, keyspace, and column_family table options must be s
create table t1 (rowkey varchar(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
insert into t1 values ('rowkey10', 'data1-value', 123456);
insert into t1 values ('rowkey11', 'data1-value2', 34543);
select * from t1;
rowkey data1 data2
data1-value 123456
data1-value2 34543
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;
rowkey data1 data2
rowkey12 data1-value3 454
rowkey10 data1-value 123456
rowkey11 data1-value2 34543
explain
select * from t1 where rowkey='rowkey11';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 const PRIMARY PRIMARY 38 const 1
select * from t1 where rowkey='rowkey11';
rowkey data1 data2
rowkey11 data1-value2 34543
delete from t1;
select * from t1;
rowkey data1 data2

View File

@ -25,7 +25,7 @@ create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
thrift_host='localhost' keyspace='no_such_keyspace' column_family='colfam';
# No column family specified
--error ER_CANT_CREATE_TABLE
--error ER_CONNECT_TO_FOREIGN_DATA_SOURCE
create table t1 (rowkey char(10) primary key, column1 char(10)) engine=cassandra
thrift_host='localhost' keyspace='no_such_keyspace';
@ -49,13 +49,19 @@ create columnfamily cf1 ( pk varchar primary key, data1 varchar, data2 bigint);
############################################################################
# Now, create a table for real and insert data
create table t1 (rowkey char(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
create table t1 (rowkey varchar(36) primary key, data1 varchar(60), data2 bigint) engine=cassandra
thrift_host='localhost' keyspace='mariadbtest2' column_family='cf1';
select * from t1;
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;
explain
select * from t1 where rowkey='rowkey11';
select * from t1 where rowkey='rowkey11';
# Check if deletion works
delete from t1;
select * from t1;