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

_field selects non-existing columns in a table #26

Open
zhangysh1995 opened this issue Jul 10, 2020 · 2 comments
Open

_field selects non-existing columns in a table #26

zhangysh1995 opened this issue Jul 10, 2020 · 2 comments
Assignees

Comments

@zhangysh1995
Copy link
Contributor

t2 doesn't have an a column, but ais selected in the generated SQLs:

mysql> desc t1;
+-------+---------+------+------+---------+-------+
| Field | Type    | Null | Key  | Default | Extra |
+-------+---------+------+------+---------+-------+
| a     | int(11) | YES  |      | NULL    |       |
+-------+---------+------+------+---------+-------+
1 row in set (0.00 sec)

mysql> desc t2;
+-------+---------+------+------+---------+-------+
| Field | Type    | Null | Key  | Default | Extra |
+-------+---------+------+------+---------+-------+
| b     | int(11) | YES  |      | NULL    |       |
+-------+---------+------+------+---------+-------+
1 row in set (0.00 sec)

--- SELECT `a` FROM t2; // wrong
--- SELECT `a` FROM t1 WHERE `a` > 7; // correct
@cyliu0 cyliu0 self-assigned this Aug 31, 2020
@cyliu0
Copy link
Contributor

cyliu0 commented Aug 31, 2020

Could you please attach your yy and zz file?

@zhangysh1995
Copy link
Contributor Author

zhangysh1995 commented Aug 31, 2020

I think the reason was the same as in #25. It assumes t2 has the same scheme as t1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants