Skip to content

Unexpected result of using in DSN string collation and charset parameters at the same time. #745

Closed
@soslanco

Description

@soslanco

Issue description

Result of using in DSN string charset and non default collation parameters together not as expected.

In file github.com/go-sql-driver/mysql/connection.go executed SET NAMES sql command without COLLATE parameter. Therefore connection collation = default collation for charset.

Example code

sql.Open("mysql", "user:password@/db?charset=utf8mb4&collation=utf8mb4_bin")

Result

collation_connection: utf8mb4_general_ci

Configuration

Driver version (or git SHA): bc14601

Go version: go1.9.3 linux/amd64

Server version: MariaDB 10.2.12

Server OS: RHEL7

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions