Fix more LastInsertId calls (#101892)
* Fix more places where LastInsertId is used without proper directive for Spanner. * Fix tests.
This commit is contained in:
@@ -374,6 +374,10 @@ func (sl *ServerLockService) createLock(ctx context.Context,
|
||||
}
|
||||
lockRow.Id = id
|
||||
} else {
|
||||
if sl.SQLStore.GetDBType() == migrator.Spanner {
|
||||
rawSQL += " THEN RETURN id" // Required for successful LastInsertId call.
|
||||
}
|
||||
|
||||
res, err := dbSession.Exec(
|
||||
rawSQL,
|
||||
lockRow.OperationUID, lockRow.LastExecution, 0)
|
||||
|
||||
Reference in New Issue
Block a user