🎨 文档名虚拟引用遵循搜索大小写设置 Fix https://github.com/siyuan-note/siyuan/issues/7372

This commit is contained in:
Liang Ding 2023-02-15 18:40:16 +08:00
parent 3739177f97
commit 411a99fb0e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D

View file

@ -247,7 +247,11 @@ func queryAliases() (ret []string) {
func queryDocIDsByTitle(title string, excludeIDs []string) (ret []string) {
ret = []string{}
notIn := "('" + strings.Join(excludeIDs, "','") + "')"
sqlStmt := "SELECT id FROM blocks WHERE type = 'd' AND content = ? AND id NOT IN " + notIn + " LIMIT ?"
sqlStmt := "SELECT id FROM blocks WHERE type = 'd' AND content LIKE ? AND id NOT IN " + notIn + " LIMIT ?"
if caseSensitive {
sqlStmt = "SELECT id FROM blocks WHERE type = 'd' AND content = ? AND id NOT IN " + notIn + " LIMIT ?"
}
rows, err := query(sqlStmt, title, 32)
if nil != err {
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)