-
Notifications
You must be signed in to change notification settings - Fork 11
fix null table pointer issue #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2.9.0-yb
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2407,7 +2407,7 @@ void Metadata::InternalData::update_indexes(int protocol_version, const VersionN | |
| std::string index_name; | ||
|
|
||
| KeyspaceMetadata* keyspace = NULL; | ||
| TableMetadata::Ptr table; | ||
| TableMetadata::Ptr table(NULL); | ||
|
|
||
| while (rows.next()) { | ||
| std::string temp_keyspace_name; | ||
|
|
@@ -2434,7 +2434,9 @@ void Metadata::InternalData::update_indexes(int protocol_version, const VersionN | |
| table->clear_indexes(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The main problem is here. If the table is not found the 'table_name' must be reset! |
||
| } | ||
|
|
||
| table->add_index(IndexMetadata::from_row(index_name, buffer, row)); | ||
| if (table) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. |
||
| table->add_index(IndexMetadata::from_row(index_name, buffer, row)); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to init it by NULL due to default constructor of the object:
explicit SharedRefPtr(T* ptr = NULL)So, please undo the change.