Skip to content

Commit

Permalink
Merge branch 'stonedb-5.7-dev' into stonedb-5.7-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
RingsC authored Jun 28, 2023
2 parents 80564d1 + 60a8cf7 commit 4fcab22
Show file tree
Hide file tree
Showing 56 changed files with 3,005 additions and 2,314 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,10 @@ jobs:
- name: create coverage.info
run: |
cat codecov.yml | curl --data-binary @- https://codecov.io/validate
cd build
lcov --capture --directory . --output-file coverage.info --test-name coverage
lcov --capture --directory . --output-file coverage.info --test-name coverage
- name: Codecov
uses: codecov/codecov-action@v3.1.1
uses: codecov/codecov-action@v3.1.4

3 changes: 3 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ignore:
- "include/boost_1_66_0"
- "extra"
15 changes: 10 additions & 5 deletions mysql-test/suite/tianmu/r/alter_table1.result
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CREATE TABLE st1
name VARCHAR(25),
deptId INT(11),
salary FLOAT
);
) engine=tianmu;
alter table st1 add column test varchar(4);
alter table st1 add column test1 varchar(4) after test;
alter table st1 add column test3 varchar(4);
Expand All @@ -36,7 +36,7 @@ CREATE TABLE st2
name VARCHAR(25),
deptId INT(11),
salary FLOAT
);
) engine=tianmu;
insert into st2 values(3,'haha1',45,4.5);
insert into st2 values(1,'haha2',12,1.2);
insert into st2 values(4,'haha3',31,3.2);
Expand Down Expand Up @@ -68,7 +68,7 @@ name VARCHAR(25),
deptId INT(11),
salary FLOAT,
PRIMARY KEY(id)
);
) engine=tianmu;
ALTER TABLE st3 RENAME to st4 ;
ALTER TABLE st4 RENAME as st3 ;
ALTER TABLE st3 RENAME to st4 ;
Expand All @@ -87,7 +87,7 @@ name VARCHAR(25),
deptId INT(11),
salary FLOAT,
PRIMARY KEY(id)
);
) engine=tianmu;
alter table st5 modify name varchar(20);
alter table st5 modify column name varchar(24);
alter table st5 modify column name varchar(15) after salary;
Expand All @@ -98,7 +98,7 @@ name VARCHAR(25),
deptId INT(11),
salary FLOAT,
PRIMARY KEY(id)
);
) engine=tianmu;
alter table st6 rename to st7,add name1 varchar(10);
desc st7;
Field Type Null Key Default Extra
Expand Down Expand Up @@ -138,4 +138,9 @@ salary float YES NULL
name varchar(20) YES NULL
name2 varchar(10) YES NULL
name3 varchar(10) YES NULL
DROP TABLE st8;
DROP TABLE st5;
DROP TABLE st4;
DROP TABLE st2;
DROP TABLE st1;
drop database alter_table1_test;
61 changes: 61 additions & 0 deletions mysql-test/suite/tianmu/r/issue1616.result
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;
14 changes: 14 additions & 0 deletions mysql-test/suite/tianmu/r/issue1855.result
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ SUM(LENGTH(p_val))
SELECT SUM(LENGTH(p_val)/2) FROM ttt;
SUM(LENGTH(p_val)/2)
3.0000
Variable_name Value
tianmu_groupby_parallel_degree 0
tianmu_groupby_parallel_rows_minimum 655360
Variable_name Value
tianmu_groupby_parallel_degree 4
tianmu_groupby_parallel_rows_minimum 100
SUM(LENGTH(p_id))
158949
SUM(LENGTH(p_id)/2)
79474.5000
SUM(LENGTH(p_val))
38901
SUM(LENGTH(p_val)/2)
19450.5000
55 changes: 55 additions & 0 deletions mysql-test/suite/tianmu/r/issue1860.result
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;
61 changes: 61 additions & 0 deletions mysql-test/suite/tianmu/r/issue1861.result
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;
29 changes: 29 additions & 0 deletions mysql-test/suite/tianmu/r/issue1865.result
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;
23 changes: 12 additions & 11 deletions mysql-test/suite/tianmu/r/issue848.result
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
create database test_issue848;
use test_issue848;
DROP DATABASE IF EXISTS issue848_test;
CREATE DATABASE issue848_test;
USE issue848_test;
CREATE TABLE `t1` (
`c_char` char(10) DEFAULT NULL COMMENT 'char',
`c_varchar` varchar(10) DEFAULT NULL COMMENT 'varchar',
Expand Down Expand Up @@ -29,7 +30,7 @@ t1 CREATE TABLE `t1` (
`c_varchar` varchar(10) CHARACTER SET gbk DEFAULT NULL COMMENT 'varchar',
`c_text` text CHARACTER SET gbk COMMENT 'text'
) ENGINE=TIANMU DEFAULT CHARSET=latin1
alter table t1 add column ex_column char(30);
ALTER TABLE t1 ADD COLUMN ex_column char(30) AFTER c_text;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
Expand All @@ -38,15 +39,15 @@ t1 CREATE TABLE `t1` (
`c_text` text CHARACTER SET gbk COMMENT 'text',
`ex_column` char(30) DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=latin1
ALTER TABLE t1 MODIFY c_char char(10) CHARACTER SET UTF8MB4;
ALTER TABLE t1 MODIFY c_varchar char(10) CHARACTER SET UTF8MB4;
ALTER TABLE t1 MODIFY c_text char(10) CHARACTER SET UTF8MB4;
ALTER TABLE t1 MODIFY c_char char(15) CHARACTER SET UTF8MB4;
ALTER TABLE t1 MODIFY c_varchar char(15) CHARACTER SET UTF8MB4;
ALTER TABLE t1 MODIFY c_text char(15) CHARACTER SET UTF8MB4;
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`c_char` char(10) CHARACTER SET utf8mb4 DEFAULT NULL,
`c_varchar` char(10) CHARACTER SET utf8mb4 DEFAULT NULL,
`c_text` char(10) CHARACTER SET utf8mb4 DEFAULT NULL,
`c_char` char(15) CHARACTER SET utf8mb4 DEFAULT NULL,
`c_varchar` char(15) CHARACTER SET utf8mb4 DEFAULT NULL,
`c_text` char(15) CHARACTER SET utf8mb4 DEFAULT NULL,
`ex_column` char(30) DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=latin1
select hex(c_char),hex(c_varchar),hex(c_text) from t1;
Expand All @@ -66,5 +67,5 @@ t1 CREATE TABLE `t1` (
`c_text` char(10) CHARACTER SET gbk DEFAULT NULL,
`ex_column` char(30) DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=latin1
drop table t1;
drop database test_issue848;
DROP TABLE t1;
DROP DATABASE issue848_test;
2 changes: 2 additions & 0 deletions mysql-test/suite/tianmu/std_data/issue1865.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
\N 10
\N 15
Loading

0 comments on commit 4fcab22

Please sign in to comment.