1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-46 subquery sometimes causes unknown error

This was caused by Item_cache::val_str() sometimes causing a full exec of subquery before we're ready
This commit is contained in:
David Hall
2016-10-12 13:21:26 -05:00
parent e7fb2b359c
commit e4f93ea2f2

View File

@ -523,36 +523,39 @@ void debug_walk(const Item *item, void *arg)
case Item::CACHE_ITEM: case Item::CACHE_ITEM:
{ {
Item_cache* isp = (Item_cache*)item; Item_cache* isp = (Item_cache*)item;
String val, *str = NULL; // MCOL-46 isp->val_str() can cause a call to execute a subquery. We're not set up
// to execute yet.
// String val, *str = NULL;
switch (item->result_type()) switch (item->result_type())
{ {
case STRING_RESULT: case STRING_RESULT:
str = isp->val_str(&val); // str = isp->val_str(&val);
cout << "CACHE_STRING_ITEM"; cout << "CACHE_STRING_ITEM";
break; break;
case REAL_RESULT: case REAL_RESULT:
str = isp->val_str(&val); // str = isp->val_str(&val);
cout << "CACHE_REAL_ITEM"; cout << "CACHE_REAL_ITEM";
break; break;
case INT_RESULT: case INT_RESULT:
str = isp->val_str(&val); // str = isp->val_str(&val);
cout << "CACHE_INT_ITEM"; cout << "CACHE_INT_ITEM";
break; break;
case ROW_RESULT: case ROW_RESULT:
cout << "CACHE_ROW_ITEM"; // cout << "CACHE_ROW_ITEM";
break; break;
case DECIMAL_RESULT: case DECIMAL_RESULT:
str = isp->val_str(&val); // str = isp->val_str(&val);
cout << "CACHE_DECIMAL_ITEM"; cout << "CACHE_DECIMAL_ITEM";
break; break;
default: default:
cout << "CACHE_UNKNOWN_ITEM"; cout << "CACHE_UNKNOWN_ITEM";
break; break;
} }
if (str) // if (str)
cout << ": (" << str->c_ptr() << ')' << endl; // cout << ": (" << str->c_ptr() << ')' << endl;
else // else
cout << ": <NULL>" << endl; // cout << ": <NULL>" << endl;
cout << endl;
break; break;
} }
case Item::DATE_ITEM: case Item::DATE_ITEM: