Closed rustyrazorblade closed 8 years ago
I have a minimal main()
you can use to verify.
extern crate cassandra;
use cassandra::*;
use std::str::FromStr;
fn main() {
let mut cluster = Cluster::new();
let contact_points = ContactPoints::from_str("127.0.0.1").unwrap();
cluster.set_contact_points(contact_points).unwrap();
cluster.set_load_balance_round_robin();
let mut session = cluster.connect().unwrap();
let query = String::from("select column_name, type from system_schema.columns where keyspace_name = 'cdmtest' and table_name = 'users'");
println!("Keyspace query: {}", query);
let schema_query = Statement::new(&query, 0);
let result = session.execute(&schema_query).wait().unwrap();
for row in result {
let name : String = row.get_col_by_name("column_name").unwrap();
let ftype : String = row.get_col_by_name("type").unwrap();
println!("{} {}", name, ftype);
}
println!("Hello, world!");
}
I've added some debug into to my main()
and it looks like the call to cass_value_type
gets back the wrong information. I've run the program several times and I've gotten back all of the following:
CASS_VALUE_TYPE_DECIMAL
CASS_VALUE_TYPE_BIGINT
CASS_VALUE_TYPE_BLOB
CASS_VALUE_TYPE_BOOLEAN
I wonder if this is due to a change on the C driver in recent builds. I'm going to regen cassandra-sys and see if the problem goes away
Did you have any different behavior after your last regen?
No, still an issue
We should verify the equiv code actually works with the C driver
Fixed in 0.7.3.
This snippet:
Causes this error:
thread 'main' panicked at 'Unsupported type: CASS_VALUE_TYPE_BLOB', /Users/jhaddad/.multirust/toolchains/nightly/cargo/registry/src/github.com-1ecc6299db9ec823/cassandra-0.6.10/src/cassandra/column.rs:279
The odd thing is that re-running the same pgoram gives me another error; except sometimes it errors with 'Unsupported type: CASS_VALUE_TYPE_BLOB'.