* [refac] Fix the error of parsing the SQL for creating indexes.

This commit is contained in:
liugang
2026-01-08 16:50:21 +08:00
parent 100f841be2
commit 700db558e3
+22
View File
@@ -449,6 +449,28 @@ class upgradeZen extends upgrade
{
$full = trim($full); // 去除首尾空白
// 截断第一个未被反引号包围的左括号之前的内容
$trimmed = '';
$inBacktick = false;
for($i = 0; $i < strlen($full); $i++)
{
$c = $full[$i];
if($c === '`')
{
$inBacktick = !$inBacktick;
$trimmed .= $c;
}
elseif($c === '(' && !$inBacktick)
{
break; // 遇到未在反引号内的 '(',截断
}
else
{
$trimmed .= $c;
}
}
$full = trim($trimmed);
/* 按未被反引号包围的点分割 */
$parts = [];
$current = '';