Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every public key after the first added is a 'duplicate' for MSSQL #697

Closed
2 of 7 tasks
btrepp opened this issue Jan 19, 2017 · 2 comments · Fixed by #911
Closed
2 of 7 tasks

Every public key after the first added is a 'duplicate' for MSSQL #697

btrepp opened this issue Jan 19, 2017 · 2 comments · Fixed by #911
Labels
Milestone

Comments

@btrepp
Copy link
Contributor

btrepp commented Jan 19, 2017

  • Gitea version (or commit ref): d2bb8ef
  • Git version: 2.9.1
  • Operating system: Windows 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist: n/a

Description

Using mssql results in every key after the first key being detected as already existing.
It appears the check for "does this key exists" is actually running "does any key exist"

models/ssh_key.go line 360 is the line.

This is most likely caused by go-xorm. It appears as if it is ignoring the text condition for mssql.
A workaround is
has, err := x.Where("content=?",content).Where("type=?",KeyTypeUser).Get(&PublicKey{})

...

@btrepp btrepp changed the title Every public key after the first added is a 'duplicate' Every public key after the first added is a 'duplicate' for MSSQL Jan 19, 2017
@lunny lunny added the type/bug label Jan 19, 2017
@lunny lunny added this to the 1.1.0 milestone Jan 19, 2017
@lunny
Copy link
Member

lunny commented Jan 24, 2017

There should be a checksum column for compression and as a query condition but not directly content.

@lunny
Copy link
Member

lunny commented Feb 14, 2017

@btrepp please confirm #911 has fixed this issue.

@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants