SELECT查询时候出现panic,数组越界,对字串判断错误导致的。 #2331

Closed
opened 2023-09-14 11:46:57 +00:00 by Chair · 0 comments
data, err := obj.Select("a.secretid").Where("cluster_id = ?", clusterId).Table(
		"t_cluster").Alias("c").Join("LEFT OUTER",
		"t_cloud_provider_instance  b", "c.provider_instance_id=b.id").Join("LEFT OUTER",
		"t_secret_info a", "b.id=a.cloudaccid").QueryString()

===
刚才发现了xorm的一个bug, 就是"t_secret_info a"的a,他会认为是as,导致数组越界, 临时解决方法是,"t_secret_info as a" ,写全即可。

``` data, err := obj.Select("a.secretid").Where("cluster_id = ?", clusterId).Table( "t_cluster").Alias("c").Join("LEFT OUTER", "t_cloud_provider_instance b", "c.provider_instance_id=b.id").Join("LEFT OUTER", "t_secret_info a", "b.id=a.cloudaccid").QueryString() ``` === 刚才发现了xorm的一个bug, 就是"t_secret_info a"的a,他会认为是as,导致数组越界, 临时解决方法是,"t_secret_info as a" ,写全即可。
lunny referenced this issue from a commit 2023-10-19 08:29:51 +00:00
lunny closed this issue 2023-10-25 11:01:47 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#2331
No description provided.