fix(ChatData): Fix execution failure error after manually updating SQL (#1812)

Co-authored-by: hec <he.erchuang@fujitsu.com>
This commit is contained in:
hec
2024-08-29 00:27:09 +09:00
committed by GitHub
parent e4813849c0
commit 549f256524

View File

@@ -460,7 +460,7 @@ function DbEditor() {
if (!value) { if (!value) {
return { sql: '', thoughts: '' }; return { sql: '', thoughts: '' };
} }
const match = value && value.match(/(--.*)\n([\s\S]*)/); const match = value && value.match(/(--.*)?\n?([\s\S]*)/);
let thoughts = ''; let thoughts = '';
let sql; let sql;
if (match && match.length >= 3) { if (match && match.length >= 3) {