-
-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Cause: Query execute by join->exec(). Solution: Solve limit=0 in tianmu, and fix crash in compile which refer to issue#1394. Then execute this query in tianmu.
- Loading branch information
1 parent
7321c63
commit 4b712ac
Showing
4 changed files
with
156 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
DROP DATABASE IF EXISTS issue1931_test_db; | ||
CREATE DATABASE issue1931_test_db; | ||
USE issue1931_test_db; | ||
CREATE TABLE `c1am_acct_day` ( | ||
`ACCOUNT_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '账户ID', | ||
`FISCAL_DATE` date DEFAULT NULL COMMENT '记账日期', | ||
`BALANCE` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '余额', | ||
`DELETED_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '记录删除标志 [0]-未删除;[1]-逻辑删除' | ||
) ENGINE=TIANMU; | ||
CREATE TABLE `c1md_bank_acct` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT 'ROW_ID', | ||
`CURRENCY_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '币种ID', | ||
`COMPANY_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '单位ID', | ||
`DELETED_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '记录删除标志 [0]-未删除;[1]-逻辑删除' | ||
) ENGINE=TIANMU; | ||
CREATE TABLE `c1md_company` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT 'ROW_ID', | ||
`SYS_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '系统ID' | ||
) ENGINE=TIANMU; | ||
INSERT INTO `c1am_acct_day` | ||
VALUES | ||
(3000000000028804, '2023-04-16', 7628617.08, '0'), | ||
(3000000000028804, '2023-04-17', 7626656.73, '0'), | ||
(3000000000028804, '2023-04-18', 7626471.23, '0'), | ||
(3000000000028806, '2023-04-15', 605253889.19, '0'), | ||
(3000000000028806, '2023-04-16', 611274357.27, '0'), | ||
(3000000000028806, '2023-04-17', 605257716.01, '0'), | ||
(3000000000028808, '2023-04-18', 79322521.29, '0'), | ||
(3000000000028808, '2023-04-19', 79322521.29, '0'), | ||
(3000000000028808, '2023-04-20', 79322521.29, '0'), | ||
(3000000000028809, '2023-04-18', 79322521.29, '0'), | ||
(3000000000028809, '2023-04-19', 79322521.29, '0'), | ||
(3000000000028809, '2023-04-20', 79322521.29, '0'); | ||
INSERT INTO `c1md_bank_acct` | ||
VALUES | ||
(3000000000028804, 1, 3000000000027247, '0'), | ||
(3000000000028806, 3, 3000000000027248, '0'), | ||
(3000000000028808, 15, 3000000000027249, '0'), | ||
(3000000000028809, 6, 3000000000027250, '0'); | ||
INSERT INTO `c1md_company` | ||
VALUES | ||
(3000000000027247, 2), | ||
(3000000000027248, 2), | ||
(3000000000027249, 2), | ||
(3000000000027250, 2); | ||
SELECT a.* | ||
FROM (SELECT | ||
'合计' total, | ||
a.CURRENCY_ID, | ||
'aaaa' inner_code | ||
FROM (SELECT | ||
b.CURRENCY_ID, | ||
a.account_id, | ||
a.fiscal_date, | ||
a.balance | ||
FROM | ||
c1am_acct_day a, | ||
c1md_bank_acct b | ||
WHERE a.account_id = b.ROW_ID) a | ||
JOIN c1md_bank_acct b | ||
ON b.row_id = a.account_id | ||
JOIN c1md_company c | ||
ON c.row_id = b.company_id | ||
WHERE 1 = 1 | ||
AND c.row_id IN (SELECT t1.row_id | ||
FROM c1md_company t1, c1md_company t2 | ||
WHERE t1.sys_id = t2.sys_id) | ||
GROUP BY a.CURRENCY_ID) a; | ||
total CURRENCY_ID inner_code | ||
合计 1 aaaa | ||
合计 3 aaaa | ||
合计 15 aaaa | ||
合计 6 aaaa | ||
DROP DATABASE issue1931_test_db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
--source include/have_tianmu.inc | ||
|
||
--disable_warnings | ||
DROP DATABASE IF EXISTS issue1931_test_db; | ||
--enable_warnings | ||
CREATE DATABASE issue1931_test_db; | ||
USE issue1931_test_db; | ||
|
||
CREATE TABLE `c1am_acct_day` ( | ||
`ACCOUNT_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '账户ID', | ||
`FISCAL_DATE` date DEFAULT NULL COMMENT '记账日期', | ||
`BALANCE` decimal(16,2) NOT NULL DEFAULT '0.00' COMMENT '余额', | ||
`DELETED_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '记录删除标志 [0]-未删除;[1]-逻辑删除' | ||
) ENGINE=TIANMU; | ||
|
||
CREATE TABLE `c1md_bank_acct` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT 'ROW_ID', | ||
`CURRENCY_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '币种ID', | ||
`COMPANY_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '单位ID', | ||
`DELETED_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '记录删除标志 [0]-未删除;[1]-逻辑删除' | ||
) ENGINE=TIANMU; | ||
|
||
CREATE TABLE `c1md_company` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT 'ROW_ID', | ||
`SYS_ID` decimal(18,0) NOT NULL DEFAULT '-1' COMMENT '系统ID' | ||
) ENGINE=TIANMU; | ||
|
||
INSERT INTO `c1am_acct_day` | ||
VALUES | ||
(3000000000028804, '2023-04-16', 7628617.08, '0'), | ||
(3000000000028804, '2023-04-17', 7626656.73, '0'), | ||
(3000000000028804, '2023-04-18', 7626471.23, '0'), | ||
(3000000000028806, '2023-04-15', 605253889.19, '0'), | ||
(3000000000028806, '2023-04-16', 611274357.27, '0'), | ||
(3000000000028806, '2023-04-17', 605257716.01, '0'), | ||
(3000000000028808, '2023-04-18', 79322521.29, '0'), | ||
(3000000000028808, '2023-04-19', 79322521.29, '0'), | ||
(3000000000028808, '2023-04-20', 79322521.29, '0'), | ||
(3000000000028809, '2023-04-18', 79322521.29, '0'), | ||
(3000000000028809, '2023-04-19', 79322521.29, '0'), | ||
(3000000000028809, '2023-04-20', 79322521.29, '0'); | ||
|
||
INSERT INTO `c1md_bank_acct` | ||
VALUES | ||
(3000000000028804, 1, 3000000000027247, '0'), | ||
(3000000000028806, 3, 3000000000027248, '0'), | ||
(3000000000028808, 15, 3000000000027249, '0'), | ||
(3000000000028809, 6, 3000000000027250, '0'); | ||
|
||
INSERT INTO `c1md_company` | ||
VALUES | ||
(3000000000027247, 2), | ||
(3000000000027248, 2), | ||
(3000000000027249, 2), | ||
(3000000000027250, 2); | ||
|
||
SELECT a.* | ||
FROM (SELECT | ||
'合计' total, | ||
a.CURRENCY_ID, | ||
'aaaa' inner_code | ||
FROM (SELECT | ||
b.CURRENCY_ID, | ||
a.account_id, | ||
a.fiscal_date, | ||
a.balance | ||
FROM | ||
c1am_acct_day a, | ||
c1md_bank_acct b | ||
WHERE a.account_id = b.ROW_ID) a | ||
JOIN c1md_bank_acct b | ||
ON b.row_id = a.account_id | ||
JOIN c1md_company c | ||
ON c.row_id = b.company_id | ||
WHERE 1 = 1 | ||
AND c.row_id IN (SELECT t1.row_id | ||
FROM c1md_company t1, c1md_company t2 | ||
WHERE t1.sys_id = t2.sys_id) | ||
GROUP BY a.CURRENCY_ID) a; | ||
|
||
DROP DATABASE issue1931_test_db; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters