Skip to content

Commit

Permalink
Release v1.12.5
Browse files Browse the repository at this point in the history
- Ignore all leading and trailing white spaces of the field name when specifying a field name.
  • Loading branch information
mithrandie committed Apr 11, 2020
2 parents 62da6e9 + cf1378c commit 29d1491
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -5,6 +5,7 @@ go:
- 1.11.x
- 1.12.x
- 1.13.x
- 1.14.x

install: true

Expand Down Expand Up @@ -34,7 +35,7 @@ deploy:
on:
tags: true
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+$
go: '1.13.x'
go: '1.14.x'
- provider: releases
api_key: $GITHUB_API_TOKEN
skip_cleanup: true
Expand All @@ -45,4 +46,4 @@ deploy:
on:
tags: true
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+\-pr\.[0-9]+$
go: '1.13.x'
go: '1.14.x'
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,11 @@
# Change Log

## Version 1.12.5

Released on April 11, 2020

- Ignore all leading and trailing white spaces of the field name when specifying a field name.

## Version 1.12.4

Released on February 4, 2020
Expand Down
6 changes: 6 additions & 0 deletions docs/changelog.md
Expand Up @@ -5,6 +5,12 @@ title: Change Log - csvq

# Change Log

## Version 1.12.5

Released on April 11, 2020

- Ignore all leading and trailing white spaces of the field name when specifying a field name.

## Version 1.12.4

Released on February 4, 2020
Expand Down
6 changes: 3 additions & 3 deletions docs/index.md
Expand Up @@ -13,10 +13,10 @@ In the multiple operations, you can use variables, cursors, temporary tables, an

## Latest Release

Version 1.12.4
: Released on February 4, 2019
Version 1.12.5
: Released on April 11, 2019

<a class="waves-effect waves-light btn" href="https://github.com/mithrandie/csvq/releases/tag/v1.12.4">
<a class="waves-effect waves-light btn" href="https://github.com/mithrandie/csvq/releases/tag/v1.12.5">
<i class="material-icons left">file_download</i>download
</a>

Expand Down
4 changes: 2 additions & 2 deletions docs/sitemap.xml
Expand Up @@ -6,7 +6,7 @@
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://mithrandie.github.io/csvq/</loc>
<lastmod>2020-02-04T14:39:45+00:00</lastmod>
<lastmod>2020-04-11T02:22:24+00:00</lastmod>
</url>
<url>
<loc>https://mithrandie.github.io/csvq/reference.html</loc>
Expand Down Expand Up @@ -178,7 +178,7 @@
</url>
<url>
<loc>https://mithrandie.github.io/csvq/changelog.html</loc>
<lastmod>2020-02-04T14:39:45+00:00</lastmod>
<lastmod>2020-04-11T02:22:24+00:00</lastmod>
</url>
<url>
<loc>https://mithrandie.github.io/csvq/license.html</loc>
Expand Down
7 changes: 4 additions & 3 deletions lib/query/header.go
Expand Up @@ -179,17 +179,18 @@ func (h Header) FieldIndex(fieldRef parser.FieldReference) (int, error) {
if 0 < len(fieldRef.View.Literal) {
view = fieldRef.View.Literal
}
column := fieldRef.Column.Literal
column := strings.TrimSpace(fieldRef.Column.Literal)

idx := -1

for i := range h {
hcol := strings.TrimSpace(h[i].Column)
if 0 < len(view) {
if !strings.EqualFold(h[i].View, view) || !strings.EqualFold(h[i].Column, column) {
if !strings.EqualFold(h[i].View, view) || !strings.EqualFold(hcol, column) {
continue
}
} else {
isEqual := strings.EqualFold(h[i].Column, column)
isEqual := strings.EqualFold(hcol, column)
if isEqual && h[i].IsJoinColumn {
idx = i
break
Expand Down
17 changes: 17 additions & 0 deletions lib/query/header_test.go
Expand Up @@ -285,6 +285,18 @@ var headerFieldIndexTests = []struct {
},
Result: 5,
},
{
Ref: parser.FieldReference{
Column: parser.Identifier{Literal: " c4 "},
},
Result: 5,
},
{
Ref: parser.FieldReference{
Column: parser.Identifier{Literal: "c5"},
},
Result: 6,
},
{
Ref: parser.FieldReference{
Column: parser.Identifier{Literal: "c1"},
Expand Down Expand Up @@ -333,6 +345,11 @@ func TestHeader_FieldIndex(t *testing.T) {
IsFromTable: true,
IsJoinColumn: true,
},
{
View: "t4",
Column: " c5 ",
IsFromTable: true,
},
}

for _, v := range headerFieldIndexTests {
Expand Down
2 changes: 1 addition & 1 deletion lib/query/version.go
@@ -1,3 +1,3 @@
package query

var Version = "v1.12.4"
var Version = "v1.12.5"

0 comments on commit 29d1491

Please sign in to comment.