-
Notifications
You must be signed in to change notification settings - Fork 7
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
avoid CatalogType::TABLE_MACRO_ENTRY which can cause SIGABRT #5
Changes from 2 commits
be15f39
4a85d59
d97b1ad
0fa32b3
53453b7
02abb22
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 |
---|---|---|
|
@@ -517,9 +517,13 @@ unique_ptr<TableRef> StatementGenerator::GenerateSubqueryRef() { | |
} | ||
|
||
unique_ptr<TableRef> StatementGenerator::GenerateTableFunctionRef() { | ||
auto function = make_uniq<TableFunctionRef>(); | ||
auto &table_function_ref = Choose(generator_context->table_functions); | ||
auto &entry = table_function_ref.get().Cast<TableFunctionCatalogEntry>(); | ||
auto original_val = generator_context->table_functions.size(); | ||
auto random_fun = RandomValue(original_val); | ||
auto table_function_ref = &generator_context->table_functions[random_fun]; | ||
while (table_function_ref->get().type == CatalogType::TABLE_MACRO_ENTRY) { | ||
table_function_ref = &generator_context->table_functions[RandomValue(original_val)]; | ||
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. can the logic of the while loop change a bit?
This way we can prevent an infinite loop 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.
|
||
} | ||
auto &entry = table_function_ref->get().Cast<TableFunctionCatalogEntry>(); | ||
auto table_function = entry.functions.GetFunctionByOffset(RandomValue(entry.functions.Size())); | ||
|
||
auto result = make_uniq<TableFunctionRef>(); | ||
|
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.
random_val
?