Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.4.10, 10.3(EOL), 10.4(EOL)
-
None
Description
Create a table with a check constraint:
create table t (i int, constraint a check (i > 0));
|
Now consider this query, which should produce the above check constraint:
select
|
tc.TABLE_SCHEMA,
|
tc.TABLE_NAME,
|
cc.CONSTRAINT_NAME,
|
cc.CHECK_CLAUSE
|
from information_schema.TABLE_CONSTRAINTS tc
|
join information_schema.CHECK_CONSTRAINTS cc
|
using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
|
;
|
It does not produce any results.
Add two columns to the projection and ta-dah, we get the desired output:
select
|
tc.TABLE_SCHEMA,
|
tc.TABLE_NAME,
|
cc.CONSTRAINT_NAME,
|
cc.CHECK_CLAUSE,
|
tc.CONSTRAINT_CATALOG,
|
tc.CONSTRAINT_SCHEMA
|
from information_schema.TABLE_CONSTRAINTS tc
|
join information_schema.CHECK_CONSTRAINTS cc
|
using (CONSTRAINT_CATALOG, CONSTRAINT_SCHEMA, TABLE_NAME, CONSTRAINT_NAME)
|
;
|
Attachments
Issue Links
- duplicates
-
MDEV-19990 JOIN USING not behaving like 'equals'
- Closed
- is duplicated by
-
MDEV-24466 logic bug when joining INFROMATION_SCHEMA tables using USING
- Closed