Commit Graph

30 Commits

Author SHA1 Message Date
Duarte Nunes
9e88b60ef5 mutation: Set cell using clustering_key_prefix
Change the clustering key argument in mutation::set_cell from
exploded_clustering_prefix to clustering_key_prefix, which allows for
some overall code simplification and fewer copies. This mostly affects
the cql3 layer.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
2017-05-04 15:59:50 +02:00
Pekka Enberg
50ec81ee67 cql3/lists: Unset value support 2017-01-27 09:24:36 +02:00
Pekka Enberg
be0351b49c cql3: Introduce raw_value and raw_value_view types
Currently, the code is using bytes_opt and bytes_view_opt to represent
CQL values, which can hold a value or null. In preparation for
supporting a third state, unset value introduced in CQL v4, introduce
new raw_value and raw_value_view types and use them instead.

The new types are based on boost::variant<> and are capable of holding
null, unset values, and blobs that represent a value.
2017-01-26 13:50:04 +02:00
Pekka Enberg
38a54df863 Fix pre-ScyllaDB copyright statements
People keep tripping over the old copyrights and copy-pasting them to
new files. Search and replace "Cloudius Systems" with "ScyllaDB".

Message-Id: <1460013664-25966-1-git-send-email-penberg@scylladb.com>
2016-04-08 08:12:47 +03:00
Calle Wilund
0f5ca342b8 lists.cc: setter_by_uuid does not require read before execute
Fixes #1082

Setting by UUID does not need existing data in list,
so need no read before execute

Message-Id: <1459325931-16387-1-git-send-email-calle@scylladb.com>
2016-03-30 11:24:20 +03:00
Calle Wilund
71170f51a8 cql3::lists: Add setter_by_uuid operation
Allows direct setting of list element by UUID key
2016-03-21 12:28:36 +00:00
Tomasz Grabiec
9d11968ad8 Rename serialization_format to cql_serialization_format 2016-02-15 16:53:56 +01:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Paweł Dziepak
6788a7afdb cql3: remove tombstone argument from do_{add, put, append}
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-07-22 15:30:13 +02:00
Asias He
898233ddcf Remove redundant const in static constexpr const
From http://en.cppreference.com/w/cpp/language/constexpr:

  A constexpr specifier used in an object declaration implies const.
2015-05-25 13:09:23 +03:00
Pekka Enberg
d50139351f cql3: Use pragma once everywhere
There's no benefit to using C include guards so switch to pragma once
everywhere for consistency.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-12 16:32:56 +03:00
Avi Kivity
4593d52444 cql3: remove gunk from lists.hh 2015-04-29 16:31:36 +03:00
Avi Kivity
ab60ed8813 db: s/shared_ptr<abstract_type>/data_type/
Also replace derived types (map_type, collection_type, etc.).

As we'll change data_type's definition, this reduces the number of places
that need to be modified later, and is more readable.
2015-04-29 15:09:04 +03:00
Avi Kivity
abca68458e cql3: convert lists::prepender to C++
Note the original code contains a bug, causing the prepended literal to
be reversed.  The conversion (and Origin) are fixed.
2015-04-28 12:13:38 +03:00
Avi Kivity
9131c094a7 cql3: convert lists::precision_time to C++ 2015-04-28 12:13:38 +03:00
Avi Kivity
38a09a6c1a cql3: remove gunk from lists.hh 2015-04-28 12:10:33 +03:00
Avi Kivity
dc9e705952 cql3: convert lists::appender to C++ 2015-04-27 14:53:51 +03:00
Avi Kivity
3d38708434 cql3: pass a database& instance to most foo::raw::prepare() variants
To prepare a user-defined type, we need to look up its name in the keyspace.
While we get the keyspace name as an argument to prepare(), it is useless
without the database instance.

Fix the problem by passing a database reference along with the keyspace.
This precolates through the class structure, so most cql3 raw types end up
receiving this treatment.

Origin gets along without it by using a singleton.  We can't do this due
to sharding (we could use a thread-local instance, but that's ugly too).

Hopefully the transition to a visitor will clean this up.
2015-04-20 16:15:34 +03:00
Tomasz Grabiec
560c972bb3 Merge tag 'avi/tuples/v3' from seastar-dev.git
Resolved trivial conflicts in:
	cql3/lists.cc
	tests/urchin/cql_query_test.cc
2015-04-15 18:01:37 +02:00
Avi Kivity
6a89d8291f cql3: fix multi_item_terminal::get_elements() signature
A tuple is a multi_item_terminal that can contain NULLs, so we need to
return a vector of bytes_opt, not bytes.

Unfortunately the lists code needs to be uglified as a result.
2015-04-15 15:35:30 +03:00
Avi Kivity
5f7f925ca0 cql3: convert lists::discarder_by_index to C++ 2015-04-12 15:13:54 +03:00
Avi Kivity
aab6d7a173 cql3: convert lists::discarder to C++
And wire it up.
2015-03-30 14:28:16 +03:00
Avi Kivity
79d1980aa3 cql3: move lists.hh code into .cc file 2015-03-24 14:38:55 +02:00
Tomasz Grabiec
e3422525c0 Use column_definition via const reference 2015-03-24 12:03:00 +01:00
Avi Kivity
21f1888f88 cql: fix lists::setter to use a tombstone
Properly squash existing value
2015-03-23 21:54:22 +02:00
Avi Kivity
62ee57b953 db: wrap collection_type_impl::mutation's vector in a struct
This will allow us to introduce a tombstone alongside.
2015-03-23 21:54:22 +02:00
Avi Kivity
39dbb40483 cql3: convert lists::setter to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
86ea3406d6 cql3: convert lists::setter_by_index() to C++ 2015-03-23 21:54:22 +02:00
Avi Kivity
30e0bf6a3c cql3: lists: convert literal, delayed_value, and value to C++ 2015-03-23 21:54:22 +02:00
Pekka Enberg
1514695437 cql3: convert Lists to C++
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:16 +02:00