Skip to content
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

bug: join unable to get field named #17327

Open
1 of 2 tasks
zhyass opened this issue Jan 18, 2025 · 0 comments
Open
1 of 2 tasks

bug: join unable to get field named #17327

zhyass opened this issue Jan 18, 2025 · 0 comments
Labels
C-bug Category: something isn't working

Comments

@zhyass
Copy link
Member

zhyass commented Jan 18, 2025

Search before asking

  • I had searched in the issues and found no similar issues.

Version

main

What's Wrong?

mysql> create table t(a int);
Query OK, 0 rows affected (0.07 sec)

mysql> insert into t values(1);
+-------------------------+
| number of rows inserted |
+-------------------------+
|                       1 |
+-------------------------+
1 row in set (0.05 sec)
Read 1 rows, 5.00 B in 0.033 sec., 30.15 rows/sec., 150.75 B/sec.

mysql> insert into t values(2);
+-------------------------+
| number of rows inserted |
+-------------------------+
|                       1 |
+-------------------------+
1 row in set (0.06 sec)
Read 1 rows, 5.00 B in 0.041 sec., 24.63 rows/sec., 123.16 B/sec.

mysql> with tt as (select sum(a) as a from t) select t._row_id, t.a/tt.a from t, tt;
ERROR 1105 (HY000): BadArguments. Code: 1006, Text = Unable to get field named "3". Valid fields: ["0", "2"].

mysql> with tt as (select sum(a) as a from t) select t._row_id, t.a/tt.a from tt,t;
+----------------------+--------------------+
| _row_id              | a / a              |
+----------------------+--------------------+
| 18446735277616529408 | 0.3333333333333333 |
| 18446739675663040512 | 0.6666666666666666 |
+----------------------+--------------------+
2 rows in set (0.14 sec)
Read 4 rows, 20.00 B in 0.052 sec., 77.03 rows/sec., 385.16 B/sec.

How to Reproduce?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@zhyass zhyass added the C-bug Category: something isn't working label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant