Segfault when preparing statement for table whose name exists in multiple keyspaces

Description

When I try to prepare a statement for a table that exists (same name) in multiple keyspaces, the C++ driver segfaults. I traced the crash back to a bug in Metadata::InternalData::update_columns():

if (keyspace_name != temp_keyspace_name) { keyspace_name = temp_keyspace_name; keyspace = get_or_create_keyspace(keyspace_name); // XXX This needs to clear the "table_or_view_name" variable, because // XXX the new keyspace may have a table/view with the same name. // XXX We need to force the next if-statement to run. } if (table_or_view_name != temp_table_or_view_name) { // Build keys for the previous table if (table_or_view) { table_or_view->build_keys_and_sort(config); } table_or_view_name = temp_table_or_view_name; ... }

Environment

None

Pull Requests

None

Attachments

1

Activity

Show:
Michael Penick
March 25, 2016 at 10:01 PM

Thanks for reporting and the example. Working on reproducing the issue on my end and a fix.

Fixed

Details

Assignee

Reporter

Reviewer

Sprint

Fix versions

Affects versions

Priority

Created March 24, 2016 at 10:33 PM
Updated January 16, 2017 at 8:43 PM
Resolved May 20, 2016 at 8:33 PM

Flag notifications