oracle 测试不能执行会报【ORA-00936: missing expression】 #1686

Open
opened 2020-05-16 02:34:47 +00:00 by zhjay999 · 6 comments

排查跟踪发现select [id] from .....
去掉[]之后就可以正常。生成的时候带了[]
core/db.go`

150行加入
query = strings.Replace(query, "[", "", -1)
query = strings.Replace(query, "]", "", -1)
`
后就正常。

排查跟踪发现select [id] from ..... 去掉[]之后就可以正常。生成的时候带了[] ` `core/db.go` 150行加入 query = strings.Replace(query, "[", "", -1) query = strings.Replace(query, "]", "", -1) ` 后就正常。
Owner

Have you tried latest version?

Have you tried latest version?
Author

yes, version1.0.1

yes, version1.0.1
Author
	xorm.io/core v0.7.3
	xorm.io/xorm v1.0.1
``` xorm.io/core v0.7.3 xorm.io/xorm v1.0.1 ```
Member

Use SetQuotePolicy(dialects.QuotePolicyNone) could avoid the problem.

Use `SetQuotePolicy(dialects.QuotePolicyNone)` could avoid the problem.
Owner

@FlyingOnion Thanks! This is a workround currently.

@FlyingOnion Thanks! This is a workround currently.
lunny added the
db
oracle
label 2020-06-04 01:27:27 +00:00
Member

这个是oracleQuoter的问题,oracle的sql用中括号、反引号都不行。大多数情况下去掉quoter可以解决问题,但还有个问题是oracle的表名在无引号时case insensitive,均视为全大写,但有引号时case sensitive。TableName全大写时无影响,但不全大写的情况会报错。

这个是oracleQuoter的问题,oracle的sql用中括号、反引号都不行。大多数情况下去掉quoter可以解决问题,但还有个问题是oracle的表名在无引号时case insensitive,均视为全大写,但有引号时case sensitive。`TableName`全大写时无影响,但不全大写的情况会报错。
Sign in to join this conversation.
No Milestone
No Assignees
3 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#1686
No description provided.