heetch / sqalx

Nested transactions for sqlx
MIT License
159 stars 25 forks source link

Fix TestSqalxConnectMySQL failure on Mac with Apple Silicon #23

Closed thara closed 1 year ago

thara commented 1 year ago

TestSqalxConnectMySQL was failing with the following messages, so I fixed it.

=== RUN   TestSqalxConnectMySQL
[mysql] 2023/01/05 22:08:27 packets.go:37: unexpected EOF
[mysql] 2023/01/05 22:08:27 packets.go:37: unexpected EOF
[mysql] 2023/01/05 22:08:27 packets.go:37: unexpected EOF
    sqalx_test.go:66:
                Error Trace:    sqalx_test.go:66
                                                        sqalx_test.go:57
                Error:          Received unexpected error:
                                driver: bad connection
                Test:           TestSqalxConnectMySQL

Environment

MacBook Pro (14-inch, 2021) Apple M1 Max

macOS Monterey 12.6.1 (21G217)

Confirmation

I modify docker-compose.yml for using mysql/mysql-server like the following and confirmed make test is passed.

    mysql:
#        image: mysql:8.0 # intel only
         image: mysql/mysql-server:8.0 # mac M1 preview

https://github.com/heetch/sqalx/blob/6756091cec6a958e4f4377968173470ebdffd194/docker-compose.yml#L13-L14

skateinmars commented 1 year ago

Hello, and thanks for this PR! This has been backported to https://github.com/heetch/sqalx/pull/25 which includes more updates