Regular columns may have names of arbitrary type. See
https://issues.apache.org/jira/browse/CASSANDRA-8178
Primary key columns are UTF8.
This change also does some refactoring of the schema object to make
the change easier to digest (more encapsulation).
The method may defer so the result is wrapped in future<>.
I think we don't need to wrap arguments in shared_ptr<> because they
may come from the request state object.
Parsed statements are not CQL statements so we shouldn't inherit from the
latter although commit 485620a ("cql3: Fix cql_statement and parsed_statement
confusion") claims otherwise.
This is needed to convert classes such as UpdateStatement.ParsedInsert.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Cassandra's ParsedStatement does not implement CqlStatement. Classes
such as UseStatement extend ParsedStatement and implement CqlStatement
which causes JVM to dispatch methods such as usesFunction to
ParsedStatement.
This doesn't happen in C++, of course, which leaves classes such as
use_statement abstract and thus uninstantiable.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
Use shared_from_this instead of the synthetic unique_ptr argument for
parsed_statement::prepare() to preserve the original Cassandra API for
parsed statements.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
This is the second conversion pass over the VariableSpecifications
class. I also had to fix up callers in parsed_statement class.
Note: I did not convert the toString() function as there's no toString()
in the column_specification class so Cassandra is just printing out list
of references here.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
There are cf_statement derived classes that pass 'null' as 'cf_name'.
Switch to unique_ptr to allow that.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
We cannot keep a C++ reference to the statement object because we then
lose ownership information. Start using unique_ptr as suggested by Avi
instead.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>