Skip to content

Commit

Permalink
v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
stfnmllr committed Nov 27, 2023
1 parent 8bcdf5e commit 06fbd52
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 14 deletions.
4 changes: 4 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Release Notes

## v1.6.0

#### v1.6.2
- fixed sqlscript parsing bug
- updated dependencies

#### v1.6.1
- renamed sqlscript SplitFunc to ScanFunc

Expand Down
2 changes: 1 addition & 1 deletion driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

// DriverVersion is the version number of the hdb driver.
const DriverVersion = "1.6.1"
const DriverVersion = "1.6.2"

// DriverName is the driver name to use with sql.Open for hdb databases.
const DriverName = "hdb"
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ go 1.20

require (
github.com/prometheus/client_golang v1.17.0
golang.org/x/crypto v0.15.0
golang.org/x/crypto v0.16.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/text v0.14.0
)
Expand All @@ -18,6 +18,6 @@ require (
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lne
github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
7 changes: 3 additions & 4 deletions sqlscript/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,10 @@ func (s *scanner) scanStatement() (bool, error) {
}

func (s *scanner) _scan() (bool, error) {
if err := s.scanWhitespace(); err != nil {
return false, err
}

for {
if err := s.scanWhitespace(); err != nil {
return false, err
}
ok, err := s.scanComment()
if err != nil {
return false, err
Expand Down
6 changes: 3 additions & 3 deletions sqlscript/scan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ func testScan(t *testing.T, separator rune, comments bool, script string, result
i := 0
for scanner.Scan() {
//t.Logf("statement %d\n%s", i, scanner.Bytes())

if l <= i {
t.Fatalf("for scan line %d result line is missing", i)
}

text := scanner.Text()
if text != result[i] {
t.Fatalf("line %d got text\n%s\nexpected\n%s", i, text, result[i])
Expand All @@ -41,6 +39,8 @@ func testScan(t *testing.T, separator rune, comments bool, script string, result

func TestScript(t *testing.T) {
testScript := `
--Comment 0 followed by a newline
--Comment 1
--Comment 2
STATEMENT;
Expand Down Expand Up @@ -80,7 +80,7 @@ MULTI LINE STATEMENT WITH DOUBLE QUOTED PARAMER "
}

commentsResult := []string{
"--Comment 1\n--Comment 2\nSTATEMENT",
"--Comment 0 followed by a newline\n--Comment 1\n--Comment 2\nSTATEMENT",
"--Comment 3\nSTATEMENT WITH PARAMETERS",
"--Comment 4\nSTATEMENT WITH QUOTED LIST 'a,b,c'",
"STATEMENT WITHOUT COMMENT",
Expand Down

0 comments on commit 06fbd52

Please sign in to comment.