很高兴向大家宣布,StoneDB-5.7-V1.0.4 版本今天正式发布了! 自三月份发布 1.0.3-GA 版本后,我们的研发同学把大量的精力投入到了 1.0.4 版本的研发中,在本次版本中,我们对 StoneDB 的稳定性做了大幅的优化提升,新增了一些实用特性并修复了一批已知Bug,欢迎大家前往 Github/Gitee 下载体验:
Github:
https://github.com/stoneatom/stonedb/releases/tag/5.7-v1.0.4-alpha
Gitee:
https://gitee.com/StoneDB/stonedb/releases/tag/5.7-v1.0.4-alpha
当然,从上游讯息和未来趋势上看,MySQL 5.7 版本的生命周期已经接近尾声(存量市场是否会被快速迭代有待观察,不过增量市场势必会用新、用好、用低成本、用高效能),所以,StoneDB 团队在过去的一年里除了积极做 5.7 版本的存量市场,我们其实很早就开始布局了 8.0 的版本规划,在今年的 6 月初,我们就顺利地发布了 StoneDB-8.0-V1.0.1 版本,后续的研发重点也会逐渐以 8.0 为主替代 5.7 的主干开发位置,同步上游,持续增强 AP 能力,顺势而行,满足更多的增量市场需求。以下,是本次版本的发布日志:
Release Notes for StoneDB-5.7-V1.0.4-alpha
稳定性
- 修复在导入数据时候,增量数据导致的 crash(「#1805」)
- 修复在 union all 字句结果集导致的 crash(「#1875」)
- 修复在大数据量情况下使用聚合函数导致的 crash(「#1855」)
- 修复主从复制下的内存溢出导致的 crash(「#1549」)
新特性
2.1 支持 insert/update ignore 语法特性
当更新 Tianmu 时候,对于主键冲突的记录将被跳过,然后执行后续的更新操作。例如:
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);
执行 update ignore t1 set id=id+1;
语句会忽略 PK=3 的更新,因为更新后的主键会与 PK=4 冲突。继续执行 PK=4 的更新,更新后 PK=5。
mysql> 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;
Query OK, 0 rows affected (0.01 sec)
mysql> INSERT INTO t1 VALUES (3,1,1),(4,1,1);
Query OK, 2 rows affected (0.01 sec)
Records: 2 Duplicates: 0 Warnings: 0
mysql> update t1 set id=id+1;
ERROR 1062 (23000): Duplicate entry '4' for key 'PRIMARY'
mysql> select * from t1;
+----+-----------+-------+
| id | parent_id | level |
+----+-----------+-------+
| 3 | 1 | 1 |
| 4 | 1 | 1 |
+----+-----------+-------+
2 rows in set (0.00 sec)
mysql> update ignore t1 set id=id+1;
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2 Changed: 2 Warnings: 0
mysql> select * from t1;
+----+-----------+-------+
| id | parent_id | level |
+----+-----------+-------+
| 3 | 1 | 1 |
| 5 | 1 | 1 |
+----+-----------+-------+
2 rows in set (0.00 sec)
2.2 ROW 格式支持 Load 语句转换为 write row
当 StoneDB 作为主机时候,Load 语句将以 insert into 的方式被写进 binlog。
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 4
#230630 10:50:51 server id 1 end_log_pos 123 CRC32 0x050a2c27 Start: binlog v 4, server v 5.7.36-StoneDB-v1.0.1.42e5a3ad4 created 230630 10:50:51 at startup
# Warning: this binlog is either in use or was not closed properly.
ROLLBACK/*!*/;
BINLOG '
C0OeZA8BAAAAdwAAAHsAAAABAAQANS43LjM2LVN0b25lREItdjEuMC4xLjQyZTVhM2FkNAAAAAAA
AAAAAAAAAAAAAAAAAAALQ55kEzgNAAgAEgAEBAQEEgAAXwAEGggAAAAICAgCAAAACgoKKioAEjQA
AScsCgU=
'/*!*/;
# at 123
#230630 10:50:51 server id 1 end_log_pos 154 CRC32 0x3407f97c Previous-GTIDs
# [empty]
# at 154
#230630 10:50:51 server id 1 end_log_pos 219 CRC32 0x1631cab7 Anonymous_GTID last_committed=0 sequence_number=1 rbr_only=no
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 219
#230630 10:50:51 server id 1 end_log_pos 334 CRC32 0x1b721a4f Query thread_id=2 exec_time=0 error_code=0
use `test`/*!*/;
SET TIMESTAMP=1688093451/*!*/;
SET @@session.pseudo_thread_id=2/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=1436549152/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
create table t1(id int, name varchar(10))
/*!*/;
# at 334
#230630 10:50:51 server id 1 end_log_pos 399 CRC32 0x092fa235 Anonymous_GTID last_committed=1 sequence_number=2 rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 399
#230630 10:50:51 server id 1 end_log_pos 471 CRC32 0x417b2366 Query thread_id=2 exec_time=0 error_code=0
SET TIMESTAMP=1688093451/*!*/;
BEGIN
/*!*/;
# at 471
#230630 10:50:51 server id 1 end_log_pos 519 CRC32 0x563c6d07 Table_map: `test`.`t1` mapped to number 108
# at 519
#230630 10:50:51 server id 1 end_log_pos 580 CRC32 0x99df1dba Write_rows: table id 108 flags: STMT_END_F
BINLOG '
C0OeZBMBAAAAMAAAAAcCAAAAAGwAAAAAAAEABHRlc3QAAnQxAAIDDwIKAAMHbTxW
C0OeZB4BAAAAPQAAAEQCAAAAAGwAAAAAAAEAAgAC//wBAAAAB0FBQUFBQUH8AgAAAAdCQkJCQkJC
uh3fmQ==
'/*!*/;
### INSERT INTO `test`.`t1`
### SET
### @1=1 /* INT meta=0 nullable=1 is_null=0 */
### @2='AAAAAAA' /* VARSTRING(10) meta=10 nullable=1 is_null=0 */
### INSERT INTO `test`.`t1`
### SET
### @1=2 /* INT meta=0 nullable=1 is_null=0 */
### @2='BBBBBBB' /* VARSTRING(10) meta=10 nullable=1 is_null=0 */
# at 580
#230630 10:50:51 server id 1 end_log_pos 611 CRC32 0x8ee952db Xid = 3
COMMIT/*!*/;
# at 611
#230630 10:50:51 server id 1 end_log_pos 676 CRC32 0x5d2a5859 Anonymous_GTID last_committed=2 sequence_number=3 rbr_only=no
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 676
#230630 10:50:51 server id 1 end_log_pos 791 CRC32 0x929d7148 Query thread_id=2 exec_time=0 error_code=0
SET TIMESTAMP=1688093451/*!*/;
DROP TABLE `t1` /* generated by server */
/*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
2.3 支持 AggregatorGroupConcat 函数
mysql> select GROUP_CONCAT(t.id) from sequence t;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GROUP_CONCAT(t.id) |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| 3000000000010000,3000000000010001,3000000000010002,3000000000010003,3000000000010004,3000000000010005,3000000000010006,3000000000010007,3000000000010008,3000000000010009,3000000000010010 |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)
2.4 支持 uion/union all 中使用 select 111 或者 select 111 from dual 场景
mysql> select id from tt union all select 2222 c1 from dual;
+------+
| id |
+------+
| 1111 |
| 2222 |
+------+
mysql> select id from tt union all select 2222 ;
+------+
| id |
+------+
| 1111 |
| 2222 |
+------+
-- PS:select 111( from dual) 出现位置非第一子句位置
其他 Bug fixs
- 修复主备场景下,新增列默认值问题(「#1187」)
- 修复 derived table 中使用 case...when... 结果集不正确问题(「#1784」)
- 修复类型为 TIME 时候,位操作时由于精度丢失导致结果不正确问题(「#1173」)
- 修复类型为 BIGINT 时候,由于类型溢出导致查询结果不正确问题(「#1564」)
- 修复当过滤条件为十六进制时候,结果不正确问题(「#1625」)
- 修复使用 load 命令导入数据时候,表上缺省值未生效问题(「#1865」)
- 修改 load 命令默认字段分隔符,使其与 MySQL 行为一致(「#1609」)
- 修复由于元数据异常导致,查询错误(「#1822」)
- 修复自动提交被关闭导致数据无法写入的问题(「#1510」)
- 提升 GitHub 上 MTR 稳定性,完善代码覆盖率测试流程。
支持平台
- CentOS 7.6 以上
- Ubuntu 20
加入StoneDB社区
Github: https://github.com/stoneatom/stonedb
Gitee: https://gitee.com/StoneDB/stonedb
社区官网: https://stonedb.io/
哔哩哔哩: https://space.bilibili.com/1154290084
Twitter: https://twitter.com/StoneDataBase
Linkedin: https://www.linkedin.com/in/stonedb/