Commit Graph

1787 Commits

Author SHA1 Message Date
Tomasz Grabiec
a37baeb81b transport: server: Guard against buffer overrun when parsing CQL3 frame 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
a51460508d exceptions: Convert ProtocolException 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
83a78055eb transport: Import ProtocolException.java 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
edbdd1dd1a exceptions: Make exception_code an enum class 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
73b143c491 db: Compare serialized bytes when reconciling cells
That's what Origin does, it does not use cell's actual type.
2015-02-16 12:00:03 +01:00
Tomasz Grabiec
f074aa6a15 cql3: Add missing header inclusion guard 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
a6fd48e334 unimplemented: Warn about mising features only once 2015-02-16 12:00:03 +01:00
Tomasz Grabiec
e5e9723023 build: Use sed on the correct target file
Current code worked always on the 'release' version of the generated
file, leaving the 'debug' one unchanged.
2015-02-16 12:52:01 +02:00
Nadav Har'El
e3b34a9efc build: fix annoying warning messages
It seems antlr has a bug: It takes code which looks like this in Cql.g:

	t=IDENT

and compiles it into the following in CqlParser.cpp:

	ImplTraits::CommonTokenType* t = NULL;
	...
	t =  this->matchToken(IDENT, &FOLLOW_IDENT_in_cident976);

But matchToken is declared as

	const CommonTokenType* matchToken( ANTLR_UINT32 ttype, BitsetListType* follow );

Obviously, assigning a const pointer into a non-const pointer generates a
warning, and on a clean compilation of Urchin we get dozens of these
annoying messages.

I'm not sure why Antlr has this bug and why nobody noticed it before or
who to report it to (I'm new to Antlr...), but it's easy to work around:
This patch adds to our build an ugly "sed" command which changes lines like

	ImplTraits::CommonTokenType* varname = NULL;

into
	const ImplTraits::CommonTokenType* varname = NULL;

and now Urchin compiles without annoying warning messages.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-02-15 17:28:11 +02:00
Avi Kivity
3aada4735a Merge branch 'master' of github.com:cloudius-systems/seastar into db 2015-02-15 16:01:33 +02:00
Avi Kivity
8ca0f21ae6 posix: add missing include 2015-02-15 15:55:35 +02:00
Avi Kivity
39596a0334 Merge branch 'master' of github.com:cloudius-systems/seastar into db
Conflicts:
	configure.py
2015-02-15 09:58:29 +02:00
Avi Kivity
adcefcf694 Merge branch 'tgrabiec/cql3' of github.com:cloudius-systems/seastar-dev into db
Enable parsing of INSERT and UPDATE CQL3 statements, from Tomasz.
2015-02-15 09:52:00 +02:00
Tomasz Grabiec
6a998e2d78 tests: Add test for parsing and execution of CQL3 queries 2015-02-12 19:40:59 +01:00
Tomasz Grabiec
ebb8a11206 types: Add helper tuple_type::serialize_value_deep()
It works on fully deserialized values.
2015-02-12 19:40:59 +01:00
Tomasz Grabiec
14546bf5c5 cql3: Convert rules for parsing UPDATE statements 2015-02-12 19:40:59 +01:00
Tomasz Grabiec
87821f2d12 Add missing copyright banners 2015-02-12 19:40:59 +01:00
Tomasz Grabiec
572b61a2bb cql3: Convert more of ColumnCondition and ColumnCondition::Raw 2015-02-12 19:40:59 +01:00
Tomasz Grabiec
08eed72021 cql3: Convert more of SingleColumnRelation 2015-02-12 19:40:59 +01:00
Tomasz Grabiec
6ca084fdb3 cql3: Implement operator== for column_identifier::raw 2015-02-12 19:40:59 +01:00
Tomasz Grabiec
ee699bff1c cql3: Convert more of constants:: 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
aaf9463568 db: Take names by const& in find_*() functions 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
6cd524988d db: Add more methods to schema 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
bd2892c8fb cql3: Cleanup code formatting 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
3b2c32a9fd cql3: Fix misinitialization of relation::_relation_type 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
abaf309b6c cql3: Add operator_type::operator!=() 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
0293b151dc cql3: Fix bug in modification_statement::process_where_clause() 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
43300e9998 cql3: Use find() instead of [] when looking up processed keys
find() is sufficient and it has less surprising side effects. This
doesn't fix any issue.
2015-02-12 19:40:58 +01:00
Tomasz Grabiec
5e742cc13d cql3: Convert QueryProcessor 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
42049e0671 cql3: Convert ErrorListener and ErrorCollector 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
0c5e2da0e0 cql3: Convert more of query_options
Needed by query_processor.
2015-02-12 19:40:58 +01:00
Tomasz Grabiec
63d152ece8 types: Introduce abstract_type::as_cql3_type()
Origin also has it.
2015-02-12 19:40:58 +01:00
Tomasz Grabiec
863d305a66 types: Make from_string() work on sstring_view 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
3aea084f2b types: Add sstring_view type alias 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
b3544238d1 service: Implement query_state:: get_client_state() and get_timestamp()
Needed by query_options and query_processor.
2015-02-12 19:40:58 +01:00
Tomasz Grabiec
9a307918ef db: Cleanup comment 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
0f2a1dffb6 cql3: Pass bound term count around as unsigned integer
It's compared with size_t and is set from size_t. To avoid ugly casts
we can store it as unsigned int. It's always positive anyway. Origin
uses signed int ("int") because there is no unsigned int in Java.
2015-02-12 19:40:58 +01:00
Tomasz Grabiec
0973d7df7c cql3: Avoid unnecessary copy of a string 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
ca4688540f cql3: Drop redundant optional<> around shared_ptr<> 2015-02-12 19:40:58 +01:00
Tomasz Grabiec
d6fcb92dd3 cql3: Add missing set_bound_variables() call
Resulted in nullptr dereference.
2015-02-12 19:40:57 +01:00
Tomasz Grabiec
0b39d284b8 service: Return keyspace name by const&
It should be up to the caller if copy is needed.
2015-02-12 19:40:57 +01:00
Tomasz Grabiec
43e693e72d service: Implement client_state::get_timeout() 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
5359200ee4 cql3: Use @context instead of @members in Cql.g
There is a difference in meaning of @members between Cpp and Java
targets, because of reasons which are not clear to me. In Cpp @members
section is not put inside parser/lexer class definition, so any
varaible definitions declared there become program-global variables
instead of instance-local. We should use @context instead.
2015-02-12 19:40:57 +01:00
Tomasz Grabiec
7c7c23b5b6 service: Stub PagingState 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
b7e3c46a42 service: Import PagingState.java 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
6601e6a24f exceptions: Convert SyntaxException and its base classes 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
c27bdb652b exceptions: Import CassandraException.java 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
59803cce10 exceptions: Import RequestValidationException.java 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
54dbc5de25 exceptions: Import SyntaxException.java 2015-02-12 19:40:57 +01:00
Tomasz Grabiec
09c54d256d excpetions: Convert ExceptionCode 2015-02-12 19:40:57 +01:00