code: func ResolveAlterAlgorithm(alterSpec *ast.AlterTableSpec, specify ast.AlterAlgorithm) (ast.AlterAlgorithm, error) {
  	switch alterSpec.Tp {
  	// For now, TiDB only support inplace algorithm and instant algorithm.
  	case ast.AlterTableAddConstraint:
  		return getProperAlgorithm(specify, inplaceAlgorithm)
  	default:
  		return getProperAlgorithm(specify, instantAlgorithm)
  	}
  }
docs: // ResolveAlterAlgorithm resolves the algorithm of the alterSpec.
  // If specify algorithm is not supported by the alter action, errAlterOperationNotSupported will be returned.
  // If specify is the ast.AlterAlgorithmDefault, then the default algorithm of the alter action will be returned.