You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error unable to find field with index 21 in row of 5 columns
repro:
WITH RECURSIVE __tree(tree_depth, tree_path, tree_ordering, tree_pk)
AS (
SELECT
0, -- Limit to max. 50 levels...
CAST(CONCAT(0x1f, id, 0x1f) AS char(1000)),
CAST(CONCAT(0x1f, CONCAT(_name, 0x1f)) AS char(1000)),
T.id
FROM dcim_location T
WHERE T.parent_id IS NULL
UNION ALL
SELECT
__tree.tree_depth + 1,
CONCAT(__tree.tree_path, T2.id, 0x1f),
CONCAT(__tree.tree_ordering, CONCAT(T2._name, 0x1f)),
T2.id
FROM __tree, dcim_location T2
WHERE __tree.tree_pk = T2.parent_id
)
SELECT
(__tree.tree_depth) AS tree_depth,
(__tree.tree_path) AS tree_path,
(__tree.tree_ordering) AS tree_ordering,
dcim_location.id,
dcim_location.created,
dcim_location.last_updated,
dcim_location._custom_field_data,
dcim_location.status_id,
dcim_location.parent_id,
dcim_location.name,
dcim_location._name,
dcim_location.slug,
dcim_location.location_type_id,
dcim_location.site_id,
dcim_location.tenant_id,
dcim_location.description
FROM
dcim_location ,
__tree
WHERE (
dcim_location.description = '' AND
dcim_location.id IN (
WITH RECURSIVE
__tree(tree_depth, tree_path, tree_ordering, tree_pk)
AS (
SELECT 0, -- Limit to max. 50 levels...
CAST(CONCAT(0x1f, id, 0x1f) AS char(1000)),
CAST(CONCAT(0x1f, CONCAT(_name, 0x1f)) AS char(1000)),
T.id
FROM dcim_location T
WHERE T.parent_id IS NULL
UNION ALL
SELECT
__tree.tree_depth + 1,
CONCAT(__tree.tree_path, T2.id, 0x1f),
CONCAT(__tree.tree_ordering,
CONCAT(T2._name, 0x1f)),
T2.id
FROM __tree, dcim_location T2
WHERE __tree.tree_pk = T2.parent_id
)
SELECT
U0.id
FROM dcim_location U0 , __tree
WHERE (
U0.id IN ('88325cda24804decbdd51f65811d4beb', 'cb5fe329fe3846efb8ff35dfb63cf7d3', 'd5ebb9035b194066a6b9a86ac74667b1') AND
(__tree.tree_pk = dcim_location.id)
)
) AND
(__tree.tree_pk = dcim_location.id)
)
ORDER BY (__tree.tree_ordering) ASC;
I made some progress on this one today, but am still debugging through it...
I simplified this query and found a similar error where CrossJoins can't be executed in subquery expressions because they don't receive the correct outer row context. I've got a local patch that seems to fix this issue, but it needs more testing. The original query does have a CrossJoin and with this change, it is no longer erroring out on an out of range GetField expression, but it is not yet returning the correct results.
I'll keep digging deeper and should be able to have a PR out for the fix tomorrow.
fulghum
added a commit
to dolthub/go-mysql-server
that referenced
this issue
Dec 7, 2022
I got a PR opened for the CrossJoin scope visibility bug (dolthub/go-mysql-server#1459) and after merging the latest fixes on GMS main into my dev branch, the query above is now returning the correct results. 🎉
The fix in GMS is merged to main and I'll get it into Dolt today; after that, I'll ping @PavelSafronov so he can rerun the customer's test and see how much farther we get.
error
unable to find field with index 21 in row of 5 columns
repro:
setup:
The text was updated successfully, but these errors were encountered: