#3217·Archery

v1.12版本 ,mysql执行工单报list index out of range

Author: FLGBetterCreated Jul 14, 2026Updated Jul 14, 2026

重现步骤

查询没问题,

Image 执行工单的时候遇见报错list index out of range : Traceback (most recent call last): File "/opt/venv4archery/lib/python3.11/site-packages/django_q/cluster.py", line 432, in worker res = f(*task["args"], **task["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/archery/sql/utils/execute_sql.py", line 44, in execute return execute_engine.execute_workflow(workflow=workflow_detail) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/archery/sql/engines/mysql.py", line 690, in execute_workflow read_only = self.query(sql="SELECT @@global.read_only;").rows[0][0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ IndexError: list index out of rangeImage 真实的权限是有的,Image archery报错日志,SELECT @@global.read_only; 变成了 SELECT @@global_read_only;Image

预期外的结果

4046-a4fa-bcc6469b8bf2" /> 执行工单的时候遇见报错list index out of range : Traceback (most recent call last): File "/opt/venv4archery/lib/python3.11/site-packages/django_q/cluster.py", line 432, in worker res = f(*task["args"], **task["kwargs"]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/archery/sql/utils/execute_sql.py", line 44, in execute return execute_engine.execute_workflow(workflow=workflow_detail) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/archery/sql/engines/mysql.py", line 690, in execute_workflow read_only = self.query(sql="SELECT @@global.read_only;").rows[0][0]

IndexError: list index out of range

### 日志文本

```shell
2026-07-14 14:11:04,664 - default - WARNING - MySQL语句执行报错,语句:explain SELECT @@global_read_only;,错误信息Traceback (most recent call last):
  File "/opt/archery/sql/engines/mysql.py", line 526, in query
    effect_row = cursor.execute(sql, parameters)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv4archery/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
    res = self._query(mogrified_query)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/venv4archery/lib/python3.11/site-packages/MySQLdb/cursors.py", line 330, in _query
    db.query(q)
  File "/opt/venv4archery/lib/python3.11/site-packages/MySQLdb/connections.py", line 280, in query
    _mysql.connection.query(self, query)
MySQLdb.OperationalError: (1193, "Unknown system variable 'global_read_only'")
```

### 版本

1.12.0

### 部署方式

Docker

### 是否还有其他可以辅助定位问题的信息?比如数据库版本等

_No response_