Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bjmayor/mysql
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: go-sql-driver/mysql
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Able to merge. These branches can be automatically merged.
Loading
Showing with 8,252 additions and 3,399 deletions.
  1. 0 { → .github}/CONTRIBUTING.md
  2. +41 −0 .github/workflows/codeql.yml
  3. +114 −0 .github/workflows/test.yml
  4. +0 −93 .travis.yml
  5. +0 −5 .travis/docker.cnf
  6. +0 −7 .travis/gofmt.sh
  7. +0 −8 .travis/wait_mysql.sh
  8. +67 −1 AUTHORS
  9. +228 −3 CHANGELOG.md
  10. +159 −40 README.md
  11. +0 −19 appengine.go
  12. +484 −0 auth.go
  13. +1,381 −0 auth_test.go
  14. +0 −93 benchmark_go18_test.go
  15. +208 −8 benchmark_test.go
  16. +78 −74 buffer.go
  17. +198 −183 collations.go
  18. +214 −0 compress.go
  19. +119 −0 compress_test.go
  20. +55 −0 conncheck.go
  21. +18 −0 conncheck_dummy.go
  22. +39 −0 conncheck_test.go
  23. +391 −131 connection.go
  24. +0 −202 connection_go18.go
  25. +0 −30 connection_go18_test.go
  26. +142 −3 connection_test.go
  27. +227 −0 connector.go
  28. +30 −0 connector_test.go
  29. +32 −6 const.go
  30. +65 −140 driver.go
  31. +0 −806 driver_go18_test.go
  32. +1,749 −150 driver_test.go
  33. +285 −168 dsn.go
  34. +47 −0 dsn_fuzz_test.go
  35. +221 −66 dsn_test.go
  36. +27 −9 errors.go
  37. +22 −3 errors_test.go
  38. +57 −27 fields.go
  39. +5 −0 go.mod
  40. +2 −0 go.sum
  41. +34 −33 infile.go
  42. +71 −0 nulltime.go
  43. +62 −0 nulltime_test.go
  44. +410 −359 packets.go
  45. +109 −42 packets_test.go
  46. +32 −4 result.go
  47. +11 −2 rows.go
  48. +42 −37 statement.go
  49. +31 −6 statement_test.go
  50. +2 −2 transaction.go
  51. +383 −375 utils.go
  52. +0 −40 utils_go17.go
  53. +0 −50 utils_go18.go
  54. +0 −57 utils_go18_test.go
  55. +360 −117 utils_test.go
File renamed without changes.
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "18 19 * * 1"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ go ]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{ matrix.language }}"
114 changes: 114 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: test
on:
pull_request:
push:
workflow_dispatch:

env:
MYSQL_TEST_USER: gotest
MYSQL_TEST_PASS: secret
MYSQL_TEST_ADDR: 127.0.0.1:3306
MYSQL_TEST_CONCURRENT: 1

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dominikh/staticcheck-action@v1.3.1

list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: list
id: set-matrix
run: |
import json
import os
go = [
# Keep the most recent production release at the top
'1.23',
# Older production releases
'1.22',
'1.21',
]
mysql = [
'9.0',
'8.4', # LTS
'8.0',
'5.7',
'mariadb-11.4', # LTS
'mariadb-11.2',
'mariadb-11.1',
'mariadb-10.11', # LTS
'mariadb-10.6', # LTS
'mariadb-10.5', # LTS
]
includes = []
# Go versions compatibility check
for v in go[1:]:
includes.append({'os': 'ubuntu-latest', 'go': v, 'mysql': mysql[0]})
matrix = {
# OS vs MySQL versions
'os': [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ],
'go': [ go[0] ],
'mysql': mysql,
'include': includes
}
output = json.dumps(matrix, separators=(',', ':'))
with open(os.environ["GITHUB_OUTPUT"], 'a', encoding="utf-8") as f:
print(f"matrix={output}", file=f)
shell: python
test:
needs: list
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.list.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: shogo82148/actions-setup-mysql@v1
with:
mysql-version: ${{ matrix.mysql }}
user: ${{ env.MYSQL_TEST_USER }}
password: ${{ env.MYSQL_TEST_PASS }}
my-cnf: |
innodb_log_file_size=256MB
innodb_buffer_pool_size=512MB
max_allowed_packet=48MB
; TestConcurrent fails if max_connections is too large
max_connections=50
local_infile=1
performance_schema=on
- name: setup database
run: |
mysql --user 'root' --host '127.0.0.1' -e 'create database gotest;'
- name: test
run: |
go test -v '-race' '-covermode=atomic' '-coverprofile=coverage.out' -parallel 10
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
flag-name: ${{ runner.os }}-Go-${{ matrix.go }}-DB-${{ matrix.mysql }}
parallel: true

# notifies that all test jobs are finished.
finish:
needs: test
if: always()
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
93 changes: 0 additions & 93 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .travis/docker.cnf

This file was deleted.

7 changes: 0 additions & 7 deletions .travis/gofmt.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .travis/wait_mysql.sh

This file was deleted.

Loading