mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Cassandra SE
- Support UPDATE statements - Follow what CQL does: don't show deleted rows (they show up as rows without any columns in reads)
This commit is contained in:
@ -41,7 +41,6 @@ select * from t1;
|
||||
pk data1 data2
|
||||
rowkey12 data1-value3 454
|
||||
rowkey10 data1-value 123456
|
||||
rowkey11 NULL NULL
|
||||
delete from t1;
|
||||
select * from t1;
|
||||
pk data1 data2
|
||||
@ -381,3 +380,30 @@ alter table t2 column_family='cf12';
|
||||
Writes made during ALTER TABLE
|
||||
0
|
||||
drop table t2;
|
||||
#
|
||||
# UPDATE command support
|
||||
#
|
||||
create table t1 (pk 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);
|
||||
insert into t1 values ('rowkey12', 'data1-value3', 454);
|
||||
select * from t1;
|
||||
pk data1 data2
|
||||
rowkey12 data1-value3 454
|
||||
rowkey10 data1-value 123456
|
||||
rowkey11 data1-value2 34543
|
||||
update t1 set data1='updated-1' where pk='rowkey11';
|
||||
select * from t1;
|
||||
pk data1 data2
|
||||
rowkey12 data1-value3 454
|
||||
rowkey10 data1-value 123456
|
||||
rowkey11 updated-1 34543
|
||||
update t1 set pk='new-rowkey12' where pk='rowkey12';
|
||||
select * from t1;
|
||||
pk data1 data2
|
||||
rowkey10 data1-value 123456
|
||||
new-rowkey12 data1-value3 454
|
||||
rowkey11 updated-1 34543
|
||||
delete from t1;
|
||||
drop table t1;
|
||||
|
@ -492,6 +492,25 @@ eval select ($c2 - $c1) as 'Writes made during ALTER TABLE';
|
||||
|
||||
drop table t2;
|
||||
|
||||
--echo #
|
||||
--echo # UPDATE command support
|
||||
--echo #
|
||||
create table t1 (pk 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);
|
||||
insert into t1 values ('rowkey12', 'data1-value3', 454);
|
||||
select * from t1;
|
||||
|
||||
update t1 set data1='updated-1' where pk='rowkey11';
|
||||
select * from t1;
|
||||
update t1 set pk='new-rowkey12' where pk='rowkey12';
|
||||
select * from t1;
|
||||
|
||||
delete from t1;
|
||||
drop table t1;
|
||||
|
||||
############################################################################
|
||||
## Cassandra cleanup
|
||||
############################################################################
|
||||
|
Reference in New Issue
Block a user