Regression in `information_schema.key_column_usage`?
See original GitHub issueCrateDB version
crate/crate:nightly (still works on 5.0.1)
CrateDB setup information
docker pull crate/crate:nightly
docker run --rm -it --publish=4200:4200 crate/crate:nightly -Cdiscovery.type=single-node -Ccluster.routing.allocation.disk.threshold_enabled=false
vs.
docker run --rm -it --publish=4200:4200 crate/crate:5.0.1 -Cdiscovery.type=single-node -Ccluster.routing.allocation.disk.threshold_enabled=false
Steps to Reproduce
crash <<SQL
CREATE TABLE testdrive ("id" TEXT PRIMARY KEY);
SELECT column_name FROM information_schema.key_column_usage WHERE table_name = 'testdrive' AND table_catalog = 'doc';
SQL
Expected Result
cr> CREATE TABLE testdrive ("id" TEXT PRIMARY KEY);
CREATE OK, 1 row affected (0.217 sec)
cr> SELECT column_name FROM information_schema.key_column_usage WHERE table_name = 'testdrive' AND table_catalog = 'doc';
+-------------+
| column_name |
+-------------+
| id |
+-------------+
SELECT 1 row in set (0.006 sec)
Actual Result
cr> CREATE TABLE testdrive ("id" TEXT PRIMARY KEY);
CREATE OK, 1 row affected (0.235 sec)
cr> SELECT column_name FROM information_schema.key_column_usage WHERE table_name = 'testdrive' AND table_catalog = 'doc';
+-------------+
| column_name |
+-------------+
+-------------+
SELECT 0 rows in set (0.080 sec)
Issue Analytics
- State:
- Created a year ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
MySQL 8.0.22 regression in information_schema-related query
I have an information_schema query that works fine on MySQL 5.7.19, but behaves very strangely on MySQL 8.0.22.
Read more >The KEY_COLUMN_USAGE table ... - MySQL :: Developer Zone
The KEY_COLUMN_USAGE table describes which key columns have constraints. This table provides no information about functional key parts because they are ...
Read more >5.0.1 mysql foreign_keys is crazy slow · Issue #27579 - GitHub
maclover7 added activerecord needs feedback regression With reproduction ... AS 'on_delete' FROM information_schema.key_column_usage fk JOIN ...
Read more >information_schema performance in Postgres 12 - PostgreSQL
I've noticed a ~50x regression in execution time for a query when moving ... information_schema.key_column_usage kcu ON tc.constraint_name =
Read more >KEY_COLUMN_USAGE | Databricks on AWS
INFORMATION_SCHEMA.KEY_COLUMN_USAGE lists the columns of the primary or foreign key constraints within the catalog.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi again,
this issue has been converged into a patch to the Python driver, see https://github.com/crate/crate-python/pull/459. As far as I can see, no other relevant/popular driver for CrateDB needs to be updated.
With kind regards, Andreas.
But unfortunately
key_column_usage.table_schema
did return a wrong, hardcoded value on CrateDB 2.3.x, which was fixed at CrateDB 3.0. So we have to add a switch at the SQLAlchemy dialect for this versions unfortunately.