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

recursive cte returns invalid type 6 #40323

Open
wjhuang2016 opened this issue Jan 4, 2023 · 0 comments
Open

recursive cte returns invalid type 6 #40323

wjhuang2016 opened this issue Jan 4, 2023 · 0 comments
Assignees
Labels
fuzz/schrddl severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.

Comments

@wjhuang2016
Copy link
Member

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE `e638a30b-01a5-41f7-a3c4-fc5b8e91c080` (
  `09aae2bf-433a-4356-b15e-2da9fde724ef` varchar(25) DEFAULT 'nosh5qussphq14',
  `c27b7674-24f0-434e-97de-bc3126b74b08` year(4) DEFAULT '2053'
);
CREATE TABLE `afc9484d-7e41-4240-8097-befb4abb7bbc` (
  `a0a2dbc1-f3db-4a8f-9ae1-e36b66883220` mediumint(9) DEFAULT '6380173',
  `3534d6e6-2aa4-4ce9-8580-117a54594161` tinyint(4) NOT NULL DEFAULT '-26',
  PRIMARY KEY (`3534d6e6-2aa4-4ce9-8580-117a54594161`) /*T![clustered_index] CLUSTERED */,
  KEY `ea77e784-e310-4c6e-af4d-2e058da53907` (`a0a2dbc1-f3db-4a8f-9ae1-e36b66883220`),
  UNIQUE KEY `4514675b-775b-4820-bd18-1563d1a9442d` (`a0a2dbc1-f3db-4a8f-9ae1-e36b66883220`,`3534d6e6-2aa4-4ce9-8580-117a54594161`),
  UNIQUE KEY `bba9a7e0-4b07-44da-92da-58651a024dc1` (`3534d6e6-2aa4-4ce9-8580-117a54594161`)
) ENGINE=InnoDB DEFAULT CHARSET=gbk COLLATE=gbk_chinese_ci;
INSERT INTO `e638a30b-01a5-41f7-a3c4-fc5b8e91c080` VALUES ('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',2021),('_xdlh=',1979),('_xdlh=',2021),('_xdlh=',2011),('_xdlh=',2024),('_xdlh=',1979),('_xdlh=',2016),('_xdlh=',2024),('_xdlh=',2003),('q8its3h2jcxh1',1961);
INSERT INTO `afc9484d-7e41-4240-8097-befb4abb7bbc` VALUES (6380173,-128),(2026965,-121),(6380173,-116),(2026965,-70),(2026965,-64),(2026965,-59),(2026965,-55),(2026965,-48),(7772134,-34),(2026965,-19),(2026965,0),(2026965,1),(2026965,8),(2026965,16),(2026965,29),(2026965,32),(2026965,35),(2026965,50),(2026965,72),(2026965,84),(2026965,98),(2026965,127);
with recursive cte_1 ( col_1,col_2,col_3,col_4 ) AS ( select 1, 1+1,null,'' from `e638a30b-01a5-41f7-a3c4-fc5b8e91c080` UNION DISTINCT select col_1 + 1,concat(col_3, 1),col_2+1,concat(col_4, 1) from cte_1 where col_1 < 5 limit 6 ) ,cte_2 ( col_5,col_6,col_7 ) AS ( select 1, '~XSDD+','' from `afc9484d-7e41-4240-8097-befb4abb7bbc` UNION ALL select col_5 + 1,concat(col_6, 1),concat(col_7, 1) from cte_2 where col_5 < 5 limit 14 ) ( select 1,cte_as_3.col_5,cte_as_3.col_6,cte_as_3.col_7,cte_as_4.col_1,cte_as_4.col_2,cte_as_4.col_3,cte_as_4.col_4 from cte_2 as cte_as_3,cte_1 as cte_as_4  order by 1,2,3,4,5,6,7,8 limit 17 );

2. What did you expect to see? (Required)

No error

3. What did you see instead (Required)

ERROR 8057 (HY000): invalid type 6

4. What is your TiDB version? (Required)

master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fuzz/schrddl severity/moderate sig/sql-infra SIG: SQL Infra type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

3 participants