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

INFORMATION_SCHEMA.TABLE_SCHEMA comparison with dynamic value no longer works #6827

Closed
aquarapid opened this issue Oct 6, 2020 · 1 comment · Fixed by #6831
Closed

INFORMATION_SCHEMA.TABLE_SCHEMA comparison with dynamic value no longer works #6827

aquarapid opened this issue Oct 6, 2020 · 1 comment · Fixed by #6831
Milestone

Comments

@aquarapid
Copy link
Contributor

#6638 seems to have broken this query (based on our 101_initial_cluster.sh cluster examples):

mysql> SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = (SELECT SCHEMA()) AND TABLE_NAME = 'product' AND COLUMN_KEY = 'PRI';
ERROR 1235 (HY000): vtgate: http://localhost:15001/: comparison with `table_schema` column not supported

However, bare comparisons with a static value still works:

mysql> SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = "commerce" AND TABLE_NAME = 'product' AND COLUMN_KEY = 'PRI';
+-------------+
| COLUMN_NAME |
+-------------+
| sku         |
+-------------+

if you revert #6638 , and run the first query, it works as expected:

mysql> SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = (SELECT SCHEMA()) AND TABLE_NAME = 'product' AND COLUMN_KEY = 'PRI';
+-------------+
| COLUMN_NAME |
+-------------+
| sku         |
+-------------+

This has broken Apache Sqoop, which generates queries like this, and the form of the query cannot be overridden (at least in Sqoop 1.4.7)

@aquarapid
Copy link
Contributor Author

In the specific case of Sqoop, this query can be avoided (and Sqoop can be made to work), by using the --split-by option, and explicitly specifying the PK for the table in question.

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

Successfully merging a pull request may close this issue.

2 participants