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: zhong821/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.

Commits on Sep 8, 2015

  1. Update README.md

    julienschmidt committed Sep 8, 2015
    Copy the full SHA
    527bcd5 View commit details

Commits on Oct 29, 2015

  1. Actually zero out the bytes in the HandshakeResponse320

    :
    The specification says these bytes should be zero but the
    current implementation simply ignores them. Since
    takeSmallBuffer ends up reusing a buffer for this packet the
    values might not be all zeros.
    Carrotman42 committed Oct 29, 2015
    Copy the full SHA
    fd85cc8 View commit details

Commits on Oct 30, 2015

  1. Merge pull request go-sql-driver#378 from Carrotman42/master

    Actually zero out the bytes in the HandshakeResponse320
    julienschmidt committed Oct 30, 2015
    Copy the full SHA
    69e3ed7 View commit details

Commits on Nov 8, 2015

  1. Copy the full SHA
    7ec062f View commit details

Commits on Nov 10, 2015

  1. Add _binary prefix when interpolating []byte data.

    Since 5.6.27, mysql server produces a warning if string literals cannot
    be interpreted in a given character set (see Bug #20238729).
    As a consequence, the driver may fail to insert []byte data into
    BLOB columns when interpolateParams is true.
    
    This commit adds "_binary" encoding prefix when interpolating []byte data
    to avoid that warning.
    
    http://dev.mysql.com/doc/refman/5.7/en/charset-literal.html
    ymmt2005 committed Nov 10, 2015
    Copy the full SHA
    934e845 View commit details

Commits on Nov 12, 2015

  1. Merge pull request go-sql-driver#382 from ymmt2005/interpolate_binary

    Add _binary prefix when interpolating []byte data.
    arnehormann committed Nov 12, 2015
    Copy the full SHA
    f368b3b View commit details
  2. Race on LOAD DATA called from different routines

    Maps are not routine safe so if you register readers/files from differents routines, the
    registry must be locked.
    mrsinham authored and Julien Lefevre committed Nov 12, 2015
    Copy the full SHA
    d4c1329 View commit details
  3. Merge pull request go-sql-driver#383 from mrsinham/thrdsafeinfile

    Race on LOAD DATA called from different routines
    arnehormann committed Nov 12, 2015
    Copy the full SHA
    d512f20 View commit details

Commits on Dec 6, 2015

  1. Fixes go-sql-driver#389 by not sending COM_QUIT until authenticated. …

    …Also refactors auth response handling code into func to reduce some duplication of logic. Test requires a MySQL socket and user having privs to use it.
    daniel-nichter committed Dec 6, 2015
    Copy the full SHA
    0da0f4e View commit details

Commits on Dec 24, 2015

  1. QueryUnescape the tlsConfig name during DSN parsing.

    Also add unit test.
    Carrotman42 committed Dec 24, 2015
    Copy the full SHA
    0874761 View commit details

Commits on Jan 6, 2016

  1. Merge pull request go-sql-driver#380 from refl/master

    Fix tests with MySQL 5.7.9
    julienschmidt committed Jan 6, 2016
    Copy the full SHA
    bb006fd View commit details
  2. Update AUTHORS

    Carrotman42 committed Jan 6, 2016
    Copy the full SHA
    5e93316 View commit details
  3. Merge pull request go-sql-driver#397 from Carrotman42/master

    QueryUnescape the tlsConfig name during DSN parsing.
    julienschmidt committed Jan 6, 2016
    Copy the full SHA
    c9c5955 View commit details
  4. Copy the full SHA
    0f5d83a View commit details
  5. Merge pull request go-sql-driver#390 from daniel-nichter/fix-389-sock…

    …et-auth-fail-broken-pipe-error
    
    Fixes go-sql-driver#389 by not sending COM_QUIT until authenticated. Also refactor…
    julienschmidt committed Jan 6, 2016
    Copy the full SHA
    d8a5f6c View commit details

Commits on Jan 7, 2016

  1. Merge pull request go-sql-driver#2 from go-sql-driver/master

    Pull recent changes from the main fork
    Carrotman42 committed Jan 7, 2016
    Copy the full SHA
    de5a0de View commit details
  2. Copy the full SHA
    a4041c6 View commit details
  3. Merge pull request go-sql-driver#400 from Carrotman42/master

    Use Errorf instead of Error in the correct places
    arnehormann committed Jan 7, 2016
    Copy the full SHA
    7a8740a View commit details

Commits on Jan 12, 2016

  1. Update CHANGELOG

    julienschmidt committed Jan 12, 2016
    Copy the full SHA
    d164b60 View commit details

Commits on Jan 13, 2016

  1. Copy the full SHA
    481fa10 View commit details
  2. Merge pull request go-sql-driver#402 from go-sql-driver/go1.5

    Travis: Test with Go 1.5
    julienschmidt committed Jan 13, 2016
    Copy the full SHA
    6fd058c View commit details
  3. Copy the full SHA
    c2d7e96 View commit details
  4. Copy the full SHA
    ec658e9 View commit details

Commits on Jan 18, 2016

  1. Merge pull request go-sql-driver#403 from go-sql-driver/dsn

    Export ParseDSN and Config
    julienschmidt committed Jan 18, 2016
    Copy the full SHA
    809154b View commit details

Commits on Jan 19, 2016

  1. read_timeout and write_timeout

    chakrit authored and julienschmidt committed Jan 19, 2016
    Copy the full SHA
    de0bbfa View commit details
  2. Improve timeouts implementation

    - use local attributes for timeouts
    - do not type assert to net.Conn each time
    - DSN params are CamelCase
    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    68ca989 View commit details
  3. Update README.md

    Add readTimeout and writeTimeout params
    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    2cd96dd View commit details
  4. Update README.md

    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    f7f9f33 View commit details
  5. Merge pull request go-sql-driver#401 from go-sql-driver/timeout

    read / write timeouts
    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    72ea5d0 View commit details
  6. lint

    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    618fbd9 View commit details
  7. Copy the full SHA
    ca130be View commit details
  8. reformat errors

    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    a059889 View commit details
  9. Revert formating of MySQLError.Error()

    users may rely on it
    julienschmidt committed Jan 19, 2016
    Copy the full SHA
    4cad0fb View commit details
  10. Copy the full SHA
    11d51ab View commit details

Commits on Jan 20, 2016

  1. Copy the full SHA
    280e61d View commit details
  2. Copy the full SHA
    acb04ff View commit details
  3. Enable Multi Results support and discard additional results

    - packets.go: flag clientMultiResults, update status when receiving an
    EOF packet, discard additional results on readRow when EOF is reached
    - statement.go: currently a nil rows.mc is used as an eof, don’t set it
    if there are no columns to avoid that Next() waits indefinitely
    - rows.go: discard additional results on close and avoid panic on
    Columns()
    lucalooz authored and julienschmidt committed Jan 20, 2016
    Copy the full SHA
    8cbeffa View commit details
  4. Copy the full SHA
    5ce0b98 View commit details
  5. Copy the full SHA
    1bdf5bd View commit details
  6. add test for the new dsn param

    badoet authored and julienschmidt committed Jan 20, 2016
    Copy the full SHA
    71c5db6 View commit details
  7. TestMultiQuery

    discard additional OK response after Multi Statement Exec Calls
    badoet authored and julienschmidt committed Jan 20, 2016
    Copy the full SHA
    4aa920d View commit details
  8. Fix driver tests

    julienschmidt committed Jan 20, 2016
    Copy the full SHA
    acb3ebd View commit details
  9. Copy the full SHA
    c1e44c4 View commit details
  10. Copy the full SHA
    023343e View commit details

Commits on Jan 22, 2016

  1. Copy the full SHA
    416bd11 View commit details

Commits on Jan 23, 2016

  1. Copy the full SHA
    8d8957e View commit details

Commits on Jan 25, 2016

  1. Merge pull request go-sql-driver#414 from go-sql-driver/json

    Add field type JSON support
    julienschmidt committed Jan 25, 2016
    Copy the full SHA
    7c7f556 View commit details

Commits on Jan 29, 2016

  1. Copy the full SHA
    bba2f88 View commit details

Commits on Jan 30, 2016

  1. Merge pull request go-sql-driver#411 from go-sql-driver/multistmt

    Multistatements and multi results
    julienschmidt committed Jan 30, 2016
    Copy the full SHA
    b4db83c View commit details

Commits on Jan 31, 2016

  1. Copy the full SHA
    8b688fb View commit details
Showing with 10,800 additions and 2,323 deletions.
  1. +0 −17 { → .github}/CONTRIBUTING.md
  2. +21 −0 .github/ISSUE_TEMPLATE.md
  3. +9 −0 .github/PULL_REQUEST_TEMPLATE.md
  4. +41 −0 .github/workflows/codeql.yml
  5. +114 −0 .github/workflows/test.yml
  6. +1 −0 .gitignore
  7. +0 −10 .travis.yml
  8. +108 −0 AUTHORS
  9. +261 −9 CHANGELOG.md
  10. +274 −65 README.md
  11. +0 −19 appengine.go
  12. +484 −0 auth.go
  13. +1,381 −0 auth_test.go
  14. +213 −17 benchmark_test.go
  15. +82 −67 buffer.go
  16. +199 −183 collations.go
  17. +214 −0 compress.go
  18. +119 −0 compress_test.go
  19. +55 −0 conncheck.go
  20. +18 −0 conncheck_dummy.go
  21. +39 −0 conncheck_test.go
  22. +484 −166 connection.go
  23. +206 −0 connection_test.go
  24. +227 −0 connector.go
  25. +30 −0 connector_test.go
  26. +37 −7 const.go
  27. +67 −98 driver.go
  28. +2,239 −273 driver_test.go
  29. +701 −0 dsn.go
  30. +47 −0 dsn_fuzz_test.go
  31. +442 −0 dsn_test.go
  32. +38 −86 errors.go
  33. +22 −3 errors_test.go
  34. +224 −0 fields.go
  35. +5 −0 go.mod
  36. +2 −0 go.sum
  37. +61 −41 infile.go
  38. +71 −0 nulltime.go
  39. +62 −0 nulltime_test.go
  40. +577 −381 packets.go
  41. +349 −0 packets_test.go
  42. +32 −4 result.go
  43. +155 −36 rows.go
  44. +117 −51 statement.go
  45. +151 −0 statement_test.go
  46. +2 −2 transaction.go
  47. +434 −577 utils.go
  48. +385 −211 utils_test.go
17 changes: 0 additions & 17 deletions CONTRIBUTING.md → .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -4,28 +4,11 @@

Before creating a new Issue, please check first if a similar Issue [already exists](https://github.com/go-sql-driver/mysql/issues?state=open) or was [recently closed](https://github.com/go-sql-driver/mysql/issues?direction=desc&page=1&sort=updated&state=closed).

Please provide the following minimum information:
* Your Go-MySQL-Driver version (or git SHA)
* Your Go version (run `go version` in your console)
* A detailed issue description
* Error Log if present
* If possible, a short example


## Contributing Code

By contributing to this project, you share your code under the Mozilla Public License 2, as specified in the LICENSE file.
Don't forget to add yourself to the AUTHORS file.

### Pull Requests Checklist

Please check the following points before submitting your pull request:
- [x] Code compiles correctly
- [x] Created tests, if possible
- [x] All tests pass
- [x] Extended the README / documentation, if necessary
- [x] Added yourself to the AUTHORS file

### Code Review

Everyone is invited to review and comment on pull requests.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
### Issue description
Tell us what should happen and what happens instead

### Example code
```go
If possible, please enter some example code here to reproduce the issue.
```

### Error log
```
If you have an error log, please paste it here.
```

### Configuration
*Driver version (or git SHA):*

*Go version:* run `go version` in your console

*Server version:* E.g. MySQL 5.6, MariaDB 10.0.20

*Server OS:* E.g. Debian 8.1 (Jessie), Windows 10
9 changes: 9 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Description
Please explain the changes you made here.

### Checklist
- [ ] Code compiles correctly
- [ ] Created tests which fail without the change (if possible)
- [ ] All tests passing
- [ ] Extended the README / documentation, if necessary
- [ ] Added myself / the copyright holder to the AUTHORS file
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -6,3 +6,4 @@
Icon?
ehthumbs.db
Thumbs.db
.idea
10 changes: 0 additions & 10 deletions .travis.yml

This file was deleted.

108 changes: 108 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -12,33 +12,141 @@
# Individual Persons

Aaron Hopkins <go-sql-driver at die.net>
Achille Roussel <achille.roussel at gmail.com>
Aidan <aidan.liu at pingcap.com>
Alex Snast <alexsn at fb.com>
Alexey Palazhchenko <alexey.palazhchenko at gmail.com>
Andrew Reid <andrew.reid at tixtrack.com>
Animesh Ray <mail.rayanimesh at gmail.com>
Arne Hormann <arnehormann at gmail.com>
Ariel Mashraki <ariel at mashraki.co.il>
Artur Melanchyk <artur.melanchyk@gmail.com>
Asta Xie <xiemengjun at gmail.com>
B Lamarche <blam413 at gmail.com>
Bes Dollma <bdollma@thousandeyes.com>
Bogdan Constantinescu <bog.con.bc at gmail.com>
Brian Hendriks <brian at dolthub.com>
Bulat Gaifullin <gaifullinbf at gmail.com>
Caine Jette <jette at alum.mit.edu>
Carlos Nieto <jose.carlos at menteslibres.net>
Chris Kirkland <chriskirkland at github.com>
Chris Moos <chris at tech9computers.com>
Craig Wilson <craiggwilson at gmail.com>
Daemonxiao <735462752 at qq.com>
Daniel Montoya <dsmontoyam at gmail.com>
Daniel Nichter <nil at codenode.com>
Daniël van Eeden <git at myname.nl>
Dave Protasowski <dprotaso at gmail.com>
Dirkjan Bussink <d.bussink at gmail.com>
DisposaBoy <disposaboy at dby.me>
Egor Smolyakov <egorsmkv at gmail.com>
Erwan Martin <hello at erwan.io>
Evan Elias <evan at skeema.net>
Evan Shaw <evan at vendhq.com>
Frederick Mayle <frederickmayle at gmail.com>
Gustavo Kristic <gkristic at gmail.com>
Gusted <postmaster at gusted.xyz>
Hajime Nakagami <nakagami at gmail.com>
Hanno Braun <mail at hannobraun.com>
Henri Yandell <flamefew at gmail.com>
Hirotaka Yamamoto <ymmt2005 at gmail.com>
Huyiguang <hyg at webterren.com>
ICHINOSE Shogo <shogo82148 at gmail.com>
Ilia Cimpoes <ichimpoesh at gmail.com>
INADA Naoki <songofacandy at gmail.com>
Jacek Szwec <szwec.jacek at gmail.com>
Jakub Adamus <kratky at zobak.cz>
James Harr <james.harr at gmail.com>
Janek Vedock <janekvedock at comcast.net>
Jason Ng <oblitorum at gmail.com>
Jean-Yves Pellé <jy at pelle.link>
Jeff Hodges <jeff at somethingsimilar.com>
Jeffrey Charles <jeffreycharles at gmail.com>
Jennifer Purevsuren <jennifer at dolthub.com>
Jerome Meyer <jxmeyer at gmail.com>
Jiajia Zhong <zhong2plus at gmail.com>
Jian Zhen <zhenjl at gmail.com>
Joe Mann <contact at joemann.co.uk>
Joshua Prunier <joshua.prunier at gmail.com>
Julien Lefevre <julien.lefevr at gmail.com>
Julien Schmidt <go-sql-driver at julienschmidt.com>
Justin Li <jli at j-li.net>
Justin Nuß <nuss.justin at gmail.com>
Kamil Dziedzic <kamil at klecza.pl>
Kei Kamikawa <x00.x7f.x86 at gmail.com>
Kevin Malachowski <kevin at chowski.com>
Kieron Woodhouse <kieron.woodhouse at infosum.com>
Lance Tian <lance6716 at gmail.com>
Lennart Rudolph <lrudolph at hmc.edu>
Leonardo YongUk Kim <dalinaum at gmail.com>
Linh Tran Tuan <linhduonggnu at gmail.com>
Lion Yang <lion at aosc.xyz>
Luca Looz <luca.looz92 at gmail.com>
Lucas Liu <extrafliu at gmail.com>
Lunny Xiao <xiaolunwen at gmail.com>
Luke Scott <luke at webconnex.com>
Maciej Zimnoch <maciej.zimnoch at codilime.com>
Michael Woolnough <michael.woolnough at gmail.com>
Nao Yokotsuka <yokotukanao at gmail.com>
Nathanial Murphy <nathanial.murphy at gmail.com>
Nicola Peduzzi <thenikso at gmail.com>
Oliver Bone <owbone at github.com>
Olivier Mengué <dolmen at cpan.org>
oscarzhao <oscarzhaosl at gmail.com>
Paul Bonser <misterpib at gmail.com>
Paulius Lozys <pauliuslozys at gmail.com>
Peter Schultz <peter.schultz at classmarkets.com>
Phil Porada <philporada at gmail.com>
Minh Quang <minhquang4334 at gmail.com>
Rebecca Chin <rchin at pivotal.io>
Reed Allman <rdallman10 at gmail.com>
Richard Wilkes <wilkes at me.com>
Robert Russell <robert at rrbrussell.com>
Runrioter Wung <runrioter at gmail.com>
Samantha Frank <hello at entropy.cat>
Santhosh Kumar Tekuri <santhosh.tekuri at gmail.com>
Sho Iizuka <sho.i518 at gmail.com>
Sho Ikeda <suicaicoca at gmail.com>
Shuode Li <elemount at qq.com>
Simon J Mudd <sjmudd at pobox.com>
Soroush Pour <me at soroushjp.com>
Stan Putrya <root.vagner at gmail.com>
Stanley Gunawan <gunawan.stanley at gmail.com>
Steven Hartland <steven.hartland at multiplay.co.uk>
Tan Jinhua <312841925 at qq.com>
Tetsuro Aoki <t.aoki1130 at gmail.com>
Thomas Wodarek <wodarekwebpage at gmail.com>
Tim Ruffles <timruffles at gmail.com>
Tom Jenkinson <tom at tjenkinson.me>
Vladimir Kovpak <cn007b at gmail.com>
Vladyslav Zhelezniak <zhvladi at gmail.com>
Xiangyu Hu <xiangyu.hu at outlook.com>
Xiaobing Jiang <s7v7nislands at gmail.com>
Xiuming Chen <cc at cxm.cc>
Xuehong Chan <chanxuehong at gmail.com>
Zhang Xiang <angwerzx at 126.com>
Zhenye Xie <xiezhenye at gmail.com>
Zhixin Wen <john.wenzhixin at gmail.com>
Ziheng Lyu <zihenglv at gmail.com>

# Organizations

Barracuda Networks, Inc.
Counting Ltd.
DigitalOcean Inc.
Dolthub Inc.
dyves labs AG
Facebook Inc.
GitHub Inc.
Google Inc.
InfoSum Ltd.
Keybase Inc.
Microsoft Corp.
Multiplay Ltd.
Percona LLC
PingCAP Inc.
Pivotal Inc.
Shattered Silicon Ltd.
Stripe Inc.
ThousandEyes
Zendesk Inc.
Loading