-
-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'stonedb-5.7-dev' into stonedb-5.7-dev
- Loading branch information
Showing
56 changed files
with
3,005 additions
and
2,314 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
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,3 @@ | ||
ignore: | ||
- "include/boost_1_66_0" | ||
- "extra" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
DROP DATABASE IF EXISTS issue1616_test; | ||
CREATE DATABASE issue1616_test; | ||
USE issue1616_test; | ||
CREATE TABLE T1 (id int(11) NOT NULL auto_increment, parent_id int(11) DEFAULT '0' NOT NULL, level tinyint(4) | ||
DEFAULT '0' NOT NULL, PRIMARY KEY (id)) engine=tianmu; | ||
INSERT INTO T1 VALUES (3,1,1),(4,1,1); | ||
INSERT INTO T1 VALUES (3,1,1),(4,1,1); | ||
ERROR 23000: Duplicate entry '3' for key 'PRIMARY' | ||
SELECT * FROM T1; | ||
id parent_id level | ||
3 1 1 | ||
4 1 1 | ||
UPDATE IGNORE T1 SET id=id+1; | ||
SELECT * FROM T1; | ||
id parent_id level | ||
3 1 1 | ||
5 1 1 | ||
UPDATE T1 SET id =10; | ||
ERROR 23000: Duplicate entry '10' for key 'PRIMARY' | ||
SELECT * FROM T1; | ||
id parent_id level | ||
3 1 1 | ||
5 1 1 | ||
UPDATE T1 SET ID=5 WHERE ID=3; | ||
ERROR 23000: Duplicate entry '5' for key 'PRIMARY' | ||
SELECT * FROM T1; | ||
id parent_id level | ||
3 1 1 | ||
5 1 1 | ||
DROP TABLE T1; | ||
CREATE TABLE T2 (dt datetime, val int, primary key(dt)) ENGINE =tianmu; | ||
INSERT INTO T2 VALUES ('2017-11-05 20:29:36',1), ('2027-11-05 20:29:36', 2); | ||
UPDATE T2 SET dt ='2027-11-05 20:29:36' WHERE val =1; | ||
ERROR 23000: Duplicate entry '2027-11-05 20:29:36' for key 'PRIMARY' | ||
SELECT * FROM T2; | ||
dt val | ||
2017-11-05 20:29:36 1 | ||
2027-11-05 20:29:36 2 | ||
DROP TABLE T2; | ||
CREATE TABLE T3 (id int(11) NOT NULL auto_increment, parent_id int(11) DEFAULT '0' NOT NULL, level tinyint(4) | ||
DEFAULT '0' NOT NULL, PRIMARY KEY (id, parent_id)) engine=tianmu; | ||
INSERT INTO T3 VALUES (3,1,1),(4,1,1); | ||
INSERT INTO T3 VALUES (3,1,1),(4,1,1); | ||
ERROR 23000: Duplicate entry '3-1' for key 'PRIMARY' | ||
UPDATE IGNORE T3 SET id=id+1; | ||
SELECT * FROM T3; | ||
id parent_id level | ||
4 1 1 | ||
5 1 1 | ||
DROP TABLE T3; | ||
CREATE TABLE T4 (id int(11) NOT NULL auto_increment, parent_id int(11) DEFAULT '0' NOT NULL, level tinyint(4) | ||
DEFAULT '0' NOT NULL, PRIMARY KEY (id)) engine=innodb; | ||
INSERT INTO T4 VALUES (3,1,1),(4,1,1); | ||
UPDATE T4 SET id =10; | ||
ERROR 23000: Duplicate entry '10' for key 'PRIMARY' | ||
SELECT * FROM T4; | ||
id parent_id level | ||
3 1 1 | ||
4 1 1 | ||
DROP TABLE T4; | ||
DROP DATABASE issue1616_test; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
DROP DATABASE IF EXISTS issue1860_test; | ||
CREATE DATABASE issue1860_test; | ||
USE issue1860_test; | ||
CREATE TABLE tt(id decimal(18,0), dt datetime) ENGINE =TIANMU; | ||
INSERT INTO tt VALUES(1111.0, '2023-01-01'); | ||
SELECT id FROM tt UNION SELECT 2222 c1 FROM dual; | ||
id | ||
1111 | ||
2222 | ||
INSERT INTO tt VALUES(2222.0, '2023-02-02'); | ||
SELECT id FROM tt UNION SELECT 2222 c1 FROM dual; | ||
id | ||
1111 | ||
2222 | ||
SELECT id FROM tt UNION ALL SELECT 2222 c1 FROM dual; | ||
id | ||
1111 | ||
2222 | ||
2222 | ||
SELECT id FROM tt UNION SELECT 2222 ; | ||
id | ||
1111 | ||
2222 | ||
sELECT id FROM tt UNION ALL SELECT 2222; | ||
id | ||
1111 | ||
2222 | ||
2222 | ||
SELECT id, dt FROM tt UNION SELECT 2222, '2022-01-01'; | ||
id dt | ||
1111 2023-01-01 00:00:00 | ||
2222 2023-02-02 00:00:00 | ||
2222 2022-01-01 | ||
SELECT id, dt FROM tt UNION SELECT 2222, str_to_date('2022-02-03', '%Y-%m-%d'); | ||
id dt | ||
1111 2023-01-01 00:00:00 | ||
2222 2023-02-02 00:00:00 | ||
2222 2022-02-03 00:00:00 | ||
SELECT id, dt FROM tt UNION SELECT 2222, str_to_date('2023-02-02', '%Y-%m-%d'); | ||
id dt | ||
1111 2023-01-01 00:00:00 | ||
2222 2023-02-02 00:00:00 | ||
SELECT dt FROM tt UNION SELECT 2222; | ||
ERROR HY000: wrong types of columns | ||
SELECT dt FROM tt UNION SELECT '2222'; | ||
dt | ||
2023-01-01 00:00:00 | ||
2023-02-02 00:00:00 | ||
2222 | ||
SELECT * FROM tt UNION SELECT 222; | ||
ERROR 21000: The used SELECT statements have a different number of columns | ||
SELECT * FROM tt UNION ALL SELECT 222; | ||
ERROR 21000: The used SELECT statements have a different number of columns | ||
DROP TABLE tt; | ||
DROP DATABASE issue1860_test; |
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,61 @@ | ||
DROP DATABASE IF EXISTS issue1861_test; | ||
CREATE DATABASE issue1861_test; | ||
USE issue1861_test; | ||
CREATE TABLE `c1fg_pool` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
PRIMARY KEY (`ROW_ID`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
CREATE TABLE `c1fg_pl_node` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
`POOL_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
`COMPANY_ID` decimal(18,0) DEFAULT '-1', | ||
PRIMARY KEY (`ROW_ID`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
CREATE TABLE `c1fg_pl_account` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
`NODE_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
PRIMARY KEY (`ROW_ID`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
CREATE TABLE `c1fg_pl_subsidiary` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
`ACCOUNT_ID` decimal(18,0) NOT NULL DEFAULT '-1', | ||
`FISCAL_DATE` date DEFAULT NULL, | ||
`DR_AMOUNT` decimal(16,2) NOT NULL DEFAULT '0.00' , | ||
PRIMARY KEY (`ROW_ID`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
CREATE TABLE `c1md_company` ( | ||
`ROW_ID` decimal(18,0) NOT NULL DEFAULT '-1' , | ||
`SYS_ID` decimal(18,0) NOT NULL DEFAULT '-1' , | ||
PRIMARY KEY (`ROW_ID`) | ||
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4; | ||
SELECT B.company_id, | ||
'上划日' ud_type, | ||
2 sort_no, | ||
'合计' fiscal_date, | ||
DATE_FORMAT('2023-06-06', '%Y-%m-%d') fiscal_date, | ||
C.pl_amount | ||
FROM c1fg_pool A | ||
INNER JOIN c1fg_pl_node B | ||
ON A.row_id = B.pool_id | ||
LEFT JOIN (SELECT c.node_id, SUM(d.dr_amount) pl_amount | ||
FROM c1fg_pool a, | ||
c1fg_pl_node b, | ||
c1fg_pl_account c, | ||
c1fg_pl_subsidiary d | ||
WHERE a.row_id = b.pool_id | ||
AND b.row_id = c.node_id | ||
AND c.row_id = d.account_id | ||
AND b.company_id IN | ||
(SELECT t1.row_id | ||
FROM c1md_company t1, c1md_company t2 | ||
WHERE t1.sys_id = t2.sys_id) | ||
GROUP BY c.node_id) C | ||
ON B.row_id = C.node_id | ||
ORDER BY B.company_id; | ||
company_id ud_type sort_no fiscal_date fiscal_date pl_amount | ||
DROP TABLE c1md_company; | ||
DROP TABLE c1fg_pl_subsidiary; | ||
DROP TABLE c1fg_pl_account; | ||
DROP TABLE c1fg_pl_node; | ||
DROP TABLE c1fg_pool; | ||
DROP DATABASE issue1861_test; |
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,29 @@ | ||
DROP DATABASE IF EXISTS issue1865_test_db; | ||
CREATE DATABASE issue1865_test_db; | ||
USE issue1865_test_db; | ||
create table t1 (a int default 100, b int, c varchar(60))engine=tianmu; | ||
load data infile 'MYSQL_TEST_DIR/suite/tianmu/std_data/issue1865.dat' into table t1 (a, c); | ||
select * from t1; | ||
a b c | ||
NULL NULL 10 | ||
NULL NULL 15 | ||
alter table t1 alter column b drop default; | ||
alter table t1 alter column b set default 10; | ||
load data infile 'MYSQL_TEST_DIR/suite/tianmu/std_data/issue1865.dat' into table t1 (a, c); | ||
select * from t1; | ||
a b c | ||
NULL NULL 10 | ||
NULL NULL 15 | ||
NULL 10 10 | ||
NULL 10 15 | ||
alter table t1 modify c text; | ||
load data infile 'MYSQL_TEST_DIR/suite/tianmu/std_data/issue1865.dat' into table t1 (a, c); | ||
select * from t1; | ||
a b c | ||
NULL NULL 10 | ||
NULL NULL 15 | ||
NULL 10 10 | ||
NULL 10 15 | ||
NULL 10 10 | ||
NULL 10 15 | ||
DROP DATABASE issue1865_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
\N 10 | ||
\N 15 |
Oops, something went wrong.