spanner-annotationsimpls-fixes (#102622)
* Fix DELETE statements. * Reset sequence generator when truncating tables. * Quote "at", since it's a keyword in Spanner.
This commit is contained in:
@@ -333,10 +333,11 @@ func (r *xormRepositoryImpl) Get(ctx context.Context, query annotations.ItemQuer
|
||||
}
|
||||
|
||||
if len(tags) > 0 {
|
||||
// "at" is a keyword in Spanner and needs to be quoted.
|
||||
tagsSubQuery := fmt.Sprintf(`
|
||||
SELECT SUM(1) FROM annotation_tag at
|
||||
INNER JOIN tag on tag.id = at.tag_id
|
||||
WHERE at.annotation_id = a.id
|
||||
SELECT SUM(1) FROM annotation_tag `+r.db.Quote("at")+`
|
||||
INNER JOIN tag on tag.id = `+r.db.Quote("at")+`.tag_id
|
||||
WHERE `+r.db.Quote("at")+`.annotation_id = a.id
|
||||
AND (
|
||||
%s
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user