Invalid object name 'SYS.INDEXES' on SQL Server case sensitive collate #1414
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1414
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
xorm: v0.7.6
SQL Server: 2017 docker on Ubuntu 18.04
The database is created with case sensitive collate like this:
CREATE DATABASE testdb COLLATE Chinese_PRC_CS_AS_WS;
The line below returns an error "Invalid object name 'SYS.INDEXES'"
ce79b1cf28/dialect_mssql.go (L450)
While it doesn't fail on another database created with a default collate SQL_Latin1_General_CP1_CI_AS
CREATE DATABASE testdb2
Then I copied the SQL statement to a database terminal and modified all the system table names to lower case, it succeed.
As I see from Microsoft web site, all SQL server system objects are named in lower case
https://docs.microsoft.com/en-us/sql/relational-databases/system-catalog-views/sys-indexes-transact-sql?view=sql-server-2017
Here is my proposal of code change
d726b609a4
I only run the SQL statement directly, didn't have any go test.
If it's OK, I can submit a pull request.