mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🐛 索引嵌入块内容可能会导致内核崩溃 https://github.com/siyuan-note/siyuan/issues/7213
This commit is contained in:
parent
dbf6965c30
commit
204580bf36
4 changed files with 29 additions and 14 deletions
|
|
@ -66,12 +66,7 @@ func updateRootContent(tx *sql.Tx, content, updated, id string) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func UpdateBlockContent(block *Block) {
|
||||
tx, err := beginTx()
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
func updateBlockContent(tx *sql.Tx, block *Block) (err error) {
|
||||
stmt := "UPDATE blocks SET content = ? WHERE id = ?"
|
||||
if err = execStmtTx(tx, stmt, block.Content, block.ID); nil != err {
|
||||
tx.Rollback()
|
||||
|
|
@ -89,6 +84,7 @@ func UpdateBlockContent(block *Block) {
|
|||
return
|
||||
}
|
||||
}
|
||||
tx.Commit()
|
||||
|
||||
putBlockCache(block)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue