code: func extractTableList(node ast.ResultSetNode, input []*ast.TableName, asName bool) []*ast.TableName {
  	switch x := node.(type) {
  	case *ast.Join:
  		input = extractTableList(x.Left, input, asName)
  		input = extractTableList(x.Right, input, asName)
  	case *ast.TableSource:
  		if s, ok := x.Source.(*ast.TableName); ok {
  			if x.AsName.L != "" && asName {
  				newTableName := *s
  				newTableName.Name = x.AsName
  				input = append(input, &newTableName)
  			} else {
  				input = append(input, s)
  			}
  		}
  	}
  	return input
  }
docs: // extractTableList extracts all the TableNames from node.
  // If asName is true, extract AsName prior to OrigName.
  // Privilege check should use OrigName, while expression may use AsName.