fix: pg invalid query #2324
No reviewers
xorm/Maintainers
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#2324
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "bug-pg-invalid-query"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For postgres dialect when GetColumn is used, and when schema is not empty then the resulting interpolated query is invalid.
Attaching the screenshots of the resulting query and the error below.
@ -1079,3 +1079,3 @@
LEFT JOIN pg_class AS g ON p.confrelid = g.oid
LEFT JOIN INFORMATION_SCHEMA.COLUMNS s ON s.column_name=f.attname AND c.relname=s.table_name
WHERE n.nspname= s.table_schema AND c.relkind = 'r' AND c.relname = $1%s AND f.attnum > 0 ORDER BY f.attnum;`
WHERE n.nspname= s.table_schema AND c.relkind = 'r' AND c.relname = $1 %s AND f.attnum > 0 ORDER BY f.attnum;`
It's wired because there is a space before
AND
in line 1085Oh wait, I noticed my version of xorm does not have space in line 1085. Will check and close this PR
This issue was related to an older version.
Pull request closed