Commit Graph

20 Commits

Author SHA1 Message Date
Avi Kivity
fcb8d040e8 treewide: use Software Package Data Exchange (SPDX) license identifiers
Instead of lengthy blurbs, switch to single-line, machine-readable
standardized (https://spdx.dev) license identifiers. The Linux kernel
switched long ago, so there is strong precedent.

Three cases are handled: AGPL-only, Apache-only, and dual licensed.
For the latter case, I chose (AGPL-3.0-or-later and Apache-2.0),
reasoning that our changes are extensive enough to apply our license.

The changes we applied mechanically with a script, except to
licenses/README.md.

Closes #9937
2022-01-18 12:15:18 +01:00
Avi Kivity
d768e9fac5 cql3, related: switch to data_dictionary
Stop using database (and including database.hh) for schema related
purposes and use data_dictionary instead.

data_dictionary::database::real_database() is called from several
places, for these reasons:

 - calling yet-to-be-converted code
 - callers with a legitimate need to access data (e.g. system_keyspace)
   but with the ::database accessor removed from query_processor.
   We'll need to find another way to supply system_keyspace with
   data access.
 - to gain access to the wasm engine for testing whether used
   defined functions compile. We'll have to find another way to
   do this as well.

The change is a straightforward replacement. One case in
modification_statement had to change a capture, but everything else
was just a search-and-replace.

Some files that lost "database.hh" gained "mutation.hh", which they
previously had access to through "database.hh".
2021-12-15 13:54:23 +02:00
Avi Kivity
a55b434a2b treewide: extent copyright statements to present day 2021-06-06 19:18:49 +03:00
Pavel Solodovnikov
c4bbeb80db cql3: pass column_specification by ref to cql3::assignment_testable functions
This patch changes the signatures of `test_assignment` and
`test_all` functions to accept `cql3::column_specification` by
const reference instead of shared pointer.

Mostly a cosmetic change reducing overall shared_ptr bloat in
cql3 code.

Tests: unit(dev, debug)

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
Message-Id: <20200529195249.767346-1-pa.solodovnikov@scylladb.com>
2020-05-30 09:49:29 +03:00
Pavel Solodovnikov
f6e765b70f cql3: pass column_specification via lw_shared_ptr
`column_specification` class is marked as "final": it's safe
to use non-polymorphic pointer "lw_shared_ptr" instead of a
more generic "shared_ptr".

tests: unit(dev, debug)

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
Message-Id: <20200427084016.26068-1-pa.solodovnikov@scylladb.com>
2020-04-27 12:47:42 +03:00
Pavel Solodovnikov
f2feeb4b10 cql3: Propagate "const" to some virtual methods in cql hierarchy
Add "const" attributes to `assignment_testable::test_assignment`
and `term::raw::prepare` methods. These should have been marked as
"const" even before the change but for some reason were missing
these qualifiers.

Mark other supplementary methods with "const" attributes as
necessary.

Tests: unit(dev, debug)

Signed-off-by: Pavel Solodovnikov <pa.solodovnikov@scylladb.com>
Message-Id: <20200127213215.494000-1-pa.solodovnikov@scylladb.com>
2020-01-29 00:23:40 +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
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +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
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
Avi Kivity
874249800d cql3: provide ostream operator for assignment_testable
To prevent name clashes, we don't call the virtual function implementing
this to_string(), but rather assignment_testable_source_context(), as its
use will be error reporting.
2015-04-01 20:12:39 +03:00
Avi Kivity
c6bee5ee2e cql3: don't require a vector<> for assignment_testable::test_all()
Allow any range.  Apologies for error message spew.
2015-04-01 20:12:39 +03:00
Avi Kivity
08b07f5093 cql3: add helpers to assignment_testable
Less qualification needed.
2015-03-12 10:10:43 +02:00
Tomasz Grabiec
e589d71a89 cql3: add missing virtual destructors 2015-02-04 10:29:00 +01:00
Tomasz Grabiec
d243fb7a01 cql3: Pass sstrings as const& where applicable 2015-02-04 10:29:00 +01:00
Avi Kivity
d9f287421d cql: add missing include to assignment_testable.hh 2015-01-12 11:15:34 +02:00
Pekka Enberg
4500874bfc cql3: Use shared_ptr for column_specification
We pass column_specification instances around wrapped in shared_ptr. Fix
up the last remaining const reference.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:16 +02:00
Pekka Enberg
3da3de8ab0 cql3: Fix assignment_testable.hh include guard
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-09 13:00:16 +02:00
Pekka Enberg
0b77fae1c7 cql3: Switch to our own shared_ptr
It's already used by core code so make life easier for us and just
switch to it.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-01-07 13:58:54 +02:00
Pekka Enberg
18d92f6cd6 cql3: convert AssignmentTestable to C++
The conversion is not 1:1 because 'enum class' in C++ does not support
methods. As the methods are rather simple, I moved them out of the class
as standalone functions.

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-12-31 18:04:08 +02:00