コード例 #1
0
ファイル: conn.go プロジェクト: Jaekyun/cockroach
func (c *conn) normalizeTableName(table *parser.TableName) error {
	if table.Qualifier == "" {
		if c.database == "" {
			return fmt.Errorf("no database specified")
		}
		table.Qualifier = c.database
	}
	if table.Name == "" {
		return fmt.Errorf("empty table name: %s", table)
	}
	return nil
}
コード例 #2
0
ファイル: server.go プロジェクト: greener98103/cockroach
func (s *Server) normalizeTableName(database string, table *parser.TableName) error {
	if table.Qualifier == "" {
		if database == "" {
			return fmt.Errorf("no database specified")
		}
		table.Qualifier = database
	}
	if table.Name == "" {
		return fmt.Errorf("empty table name: %s", table)
	}
	return nil
}