Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ int main(int argc, char* argv[]) {
CassFuture* close_future = NULL;

/* Build statement and execute query */
const char* query = "SELECT release_version FROM system.local";
const char* query = "SELECT release_version FROM system.local WHERE key='local'";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);
Expand Down
2 changes: 1 addition & 1 deletion examples/cloud/cloud.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int main(int argc, char* argv[]) {

if (cass_future_error_code(connect_future) == CASS_OK) {
/* Build statement and execute query */
const char* query = "SELECT release_version FROM system.local";
const char* query = "SELECT release_version FROM system.local WHERE key='local'";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);
Expand Down
2 changes: 1 addition & 1 deletion examples/simple/simple.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int argc, char* argv[]) {

if (cass_future_error_code(connect_future) == CASS_OK) {
/* Build statement and execute query */
const char* query = "SELECT release_version FROM system.local";
const char* query = "SELECT release_version FROM system.local WHERE key='local'";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);
Expand Down
2 changes: 1 addition & 1 deletion examples/ssl/ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int main(int argc, char* argv[]) {

if (cass_future_error_code(connect_future) == CASS_OK) {
/* Build statement and execute query */
const char* query = "SELECT release_version FROM system.local";
const char* query = "SELECT release_version FROM system.local WHERE key='local'";
CassStatement* statement = cass_statement_new(query, 0);

CassFuture* result_future = cass_session_execute(session, statement);
Expand Down
2 changes: 1 addition & 1 deletion examples/tracing/tracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ int main(int argc, char* argv[]) {
if (cass_future_error_code(connect_future) == CASS_OK) {
/* Build statement and execute query */
CassFuture* result_future = NULL;
const char* query = "SELECT release_version FROM system.local";
const char* query = "SELECT release_version FROM system.local WHERE key='local'";
CassStatement* statement = cass_statement_new(query, 0);

/* Enable tracing on the statement */
Expand Down
2 changes: 1 addition & 1 deletion scylla-rust-wrapper/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,7 +1088,7 @@ mod tests {
CassError::CASS_OK
);

let query = make_c_str!("SELECT host_id FROM system.local");
let query = make_c_str!("SELECT host_id FROM system.local WHERE key='local'");
let statement_raw = cass_statement_new(query, 0);
let batch_raw = cass_batch_new(CassBatchType::CASS_BATCH_TYPE_LOGGED);
assert_cass_error_eq!(
Expand Down
2 changes: 1 addition & 1 deletion tests/src/integration/integration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#define ENTITY_MAXIMUM_LENGTH 48
#define SIMPLE_KEYSPACE_FORMAT "CREATE KEYSPACE IF NOT EXISTS %s WITH replication = %s"
#define REPLICATION_STRATEGY "{ 'class': %s }"
#define SELECT_SERVER_VERSION "SELECT release_version FROM system.local"
#define SELECT_SERVER_VERSION "SELECT release_version FROM system.local WHERE key='local'"
#define LOGGER_MAXIMUM_WAIT_TIME_MS 10000u
#define LOGGER_WAIT_FOR_NAP_MS 100

Expand Down
2 changes: 1 addition & 1 deletion tests/src/integration/integration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
#define CASSANDRA_SELECT_VALUE_FORMAT "SELECT value FROM %s WHERE key=%s"
#define CASSANDRA_DELETE_ROW_FORMAT "DELETE FROM %s WHERE key=%s"
#define CASSANDRA_UPDATE_VALUE_FORMAT "UPDATE %s SET value=%s WHERE key=%s"
#define SELECT_ALL_SYSTEM_LOCAL_CQL "SELECT * FROM system.local"
#define SELECT_ALL_SYSTEM_LOCAL_CQL "SELECT * FROM system.local WHERE key='local'"
#define SELECT_COUNT_FORMAT "SELECT COUNT(*) FROM %s LIMIT 1000000"

#define CASSANDRA_COMPOSITE_KEY_VALUE_TABLE_FORMAT \
Expand Down
2 changes: 1 addition & 1 deletion tests/src/integration/tests/test_exec_profile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class ExecutionProfileTest : public Integration {
void build_tokens() {
// Build the token/host mapping
Session session = cluster_.connect();
Statement statement("SELECT data_center, tokens FROM system.local");
Statement statement("SELECT data_center, tokens FROM system.local WHERE key='local'");
statement.set_execution_profile("round_robin");
for (size_t i = 0; i < total_nodes_; ++i) {
// Execute the statement and retrieve the host IP address
Expand Down
2 changes: 1 addition & 1 deletion tests/src/integration/tests/test_latency_aware_policy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ CASSANDRA_INTEGRATION_TEST_F(LatencyAwarePolicyTest, IsEnabled) {
logger_.add_critera("Calculated new minimum:");

for (int i = 0; i < 9; ++i) { // Greater than min measured
session_.execute("SELECT release_version FROM system.local");
session_.execute("SELECT release_version FROM system.local WHERE key='local'");
}

msleep(250);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/integration/tests/test_server_side_failure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ CASSANDRA_INTEGRATION_TEST_F(ServerSideFailureTests, Warning) {
SKIP_IF_CASSANDRA_VERSION_LT(2.2);

logger_.add_critera("Server-side warning: Aggregation query used without partition key");
session_.execute("SELECT sum(gossip_generation) FROM system.local");
session_.execute("SELECT sum(gossip_generation) FROM system.local WHERE key='local'");
EXPECT_EQ(logger_.count(), 1u);
}

Expand Down
10 changes: 5 additions & 5 deletions tests/src/integration/tests/test_statement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetHost) {
for (int i = 1; i <= 2; ++i) {
std::stringstream ip_address;
ip_address << ccm_->get_ip_prefix() << i;
Statement statement("SELECT rpc_address FROM system.local");
Statement statement("SELECT rpc_address FROM system.local WHERE key='local'");
statement.set_host(ip_address.str(), 9042);
Result result = session_.execute(statement);
Inet rpc_address = result.first_row().column_by_name<Inet>("rpc_address");
Expand All @@ -60,7 +60,7 @@ CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetHostInet) {
ip_address << ccm_->get_ip_prefix() << i;
CassInet inet;
ASSERT_EQ(cass_inet_from_string(ip_address.str().c_str(), &inet), CASS_OK);
Statement statement("SELECT rpc_address FROM system.local");
Statement statement("SELECT rpc_address FROM system.local WHERE key='local'");
statement.set_host(&inet, 9042);
Result result = session_.execute(statement);
Inet rpc_address = result.first_row().column_by_name<Inet>("rpc_address");
Expand All @@ -78,7 +78,7 @@ CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetHostInet) {
CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetNode) {
CHECK_FAILURE;

Statement statement("SELECT rpc_address FROM system.local");
Statement statement("SELECT rpc_address FROM system.local WHERE key='local'");
Result result1 = session_.execute(statement);
Inet rpc_address1 = result1.first_row().column_by_name<Inet>("rpc_address");
const CassNode* node = result1.coordinator();
Expand All @@ -104,7 +104,7 @@ CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetNode) {
CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetHostWithInvalidPort) {
CHECK_FAILURE;

Statement statement("SELECT rpc_address FROM system.local");
Statement statement("SELECT rpc_address FROM system.local WHERE key='local'");
statement.set_host("127.0.0.1", 8888); // Invalid port
Result result = session_.execute(statement, false);
EXPECT_EQ(result.error_code(), CASS_ERROR_LIB_NO_HOSTS_AVAILABLE);
Expand All @@ -123,7 +123,7 @@ CASSANDRA_INTEGRATION_TEST_F(StatementTests, SetHostWhereHostIsDown) {

stop_node(1);

Statement statement("SELECT rpc_address FROM system.local");
Statement statement("SELECT rpc_address FROM system.local WHERE key='local'");
statement.set_host("127.0.0.1", 9042);
Result result = session_.execute(statement, false);
EXPECT_EQ(result.error_code(), CASS_ERROR_LIB_NO_HOSTS_AVAILABLE);
Expand Down
2 changes: 1 addition & 1 deletion tests/src/integration/tests/test_tracing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ CASSANDRA_INTEGRATION_TEST_F(TracingTests, Simple) {
Uuid tracing_id;

{ // Get tracing ID.
Statement statement("SELECT release_version FROM system.local");
Statement statement("SELECT release_version FROM system.local WHERE key='local'");
statement.set_tracing(true);
Result result = session_.execute(statement);
tracing_id = result.tracing_id();
Expand Down
Loading