question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Regression in `information_schema.key_column_usage`?

See original GitHub issue

CrateDB 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:closed
  • Created a year ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
amotlcommented, Oct 6, 2022

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.

0reactions
seutcommented, Oct 6, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found