| 1333 | // |
| 1334 | |
| 1335 | static gpre_nod* explode_asterisk( gpre_nod* fields, int n, gpre_rse* selection) |
| 1336 | { |
| 1337 | TEXT s[ERROR_LENGTH]; |
| 1338 | |
| 1339 | assert_IS_NOD(fields); |
| 1340 | |
| 1341 | gpre_nod* node = fields->nod_arg[n]; |
| 1342 | tok* q_token = (tok*) node->nod_arg[0]; |
| 1343 | if (q_token) |
| 1344 | { |
| 1345 | // expand for single relation |
| 1346 | gpre_ctx* context = resolve_asterisk(q_token, selection); |
| 1347 | if (context) |
| 1348 | fields = merge_fields(fields, MET_fields(context), n, true); |
| 1349 | else |
| 1350 | { |
| 1351 | fb_utils::snprintf(s, sizeof(s), "columns \"%s.*\" cannot be resolved", q_token->tok_string); |
| 1352 | PAR_error(s); |
| 1353 | } |
| 1354 | } |
| 1355 | else |
| 1356 | { |
| 1357 | // expand for all relations in context list |
| 1358 | |
| 1359 | fields = explode_asterisk_all(fields, n, selection, true); |
| 1360 | } |
| 1361 | |
| 1362 | return fields; |
| 1363 | } |
| 1364 | |
| 1365 | |
| 1366 | //____________________________________________________________ |
no test coverage detected